Exclude files when using "Find Usages" in IntelliJ IDEA - intellij-idea

In Java source files, when I select a class or a method, then click the right button of mouse, in the pop up context menu, and run Find Usages, the files that use the class or methods are searched out.
But I would like to exclude certain files (e.g. JUnit test files) from the search results.
Where could I configure this?

From the docs; you can confgure the Find Usages scope by clicking on the tools icon in the top left hand corner of the Find Usages results.
Here are some screenshots:
Click on the tools icon here:
Click on the build button (... next to the Scope field) to create a Scope and define it like so (in this examples I have included production classes and excluded test classes):
Choose that scope in the Find Usages dialog:
Notes:
You can also chose the precanned scope named Project Production Files from the Scope dropdown
All subsequent searches will use this scope by default until you choose a different scope.

Related

How to find package for a dictionary object in Eclipse ADT?

I am trying to determine a package for an data element, or domain, or whatever via Eclipse ADT, but have no luck. I'm doing usual object search via project search (Ctrl-Shift-A), and both Global search (Ctrl-H), the result is the same.
I see domain properties window
and it has no clue about what package it is.
What I've tried so far:
Using filters in project search bar, callable via Ctrl-Space
Package filter does not help, it lists all packages, not the relevant ones, where this domain was found. Picking each and every package will take infinity amount of time, because the hierarchy is huge.
Pressing "Link with editor" button
For some reason it doesn't work, should it with DDIC objects? When I press it with domain opened right-side, just nothing happens. In the help and e.g. here they describe it should open the object in the left within hierarchy.
Is it something broken with my ADT or this button doesn't work with DDIC objects?
P.S. It is ABAP Cloud trial system, if that matters.
Package can be seen in Properties tool (see the bottom part of the screenshot below)

Can I use the module structure (collapse Java package paths) for the Project Pane -> Changed Files view in IntelliJ?

When I use the "Project Pane -> Project" view in IntelliJ, my Java package paths are collapsed based on the Modules in my Project Structure (e.g. com.company.project). I would like to use IntelliJ for code reviews, so I've checked out the changes locally and am looking at the "Project Pane -> Changed Files" view, but this doesn't pick up the project structure, so each folder takes an extra line. Can I get the best of both worlds here?
I figured this out with the help of this answer about expanding the folders (which I also wanted to do) How to expand folded package chain in Intellij IDEA?
Right click on "1:Project" to see the options for the project pane and then check "Flatten Packages".

Filter by scopes in the project tool window?

In IntelliJ 2017.1.2
I defined a scope with the intention to filter files with specific file endings in the project tool window. Yet I don't see a way to make this happen.
How can I filter by scope in the project tool window?
I'm not sure if it's the same under 2017.1.2, but in IntelliJ 2018.1.6 you just need to click the Project dropdown menu, and select the Scope you want to see.
PS. I found this here.

List of all errors in project in CLion

CLion 2016.2 helpfully detects potential errors in the file you're editing, which can be seen in the validation bar to the right of the code.
That's just a single file though, is there a way (like a tool window) to get a list of all such warnings in the whole project, or specific parts of it?
Bonus points if it also lists warnings and errors from the compiler, though that's less important, because the compiler output already includes any it found.
Yes, it is possible. The feature you are looking for is called the Inspector.
Do: Find Action... | Inspect Code. It will show a pop-up that will allow you to select the scope: file, whole project, custom, and the Inspection profile (you can choose the type of errors you want to see):
After clicking OK, this is an example of the output, that you can navigate with the mouse or with keyboard shortcuts:
In version 2017.2, I have it under Code | Inspect Code....
You can also right click a folder in Project view and select Inspect Code... there to be able to check only that folder.

Eclipse "Go Into" with Intellij

In Eclipse if you right-click on a project folder, you have the option to "Go Into". Is there something similar in IntelliJ?
In large projects it can be useful to narrow your working space down to a single module or directory.
The easiest option is to use the "Add to Favorites" action to add a module or directory to a favorites list. Then the Favorites list will show only that module/directory and its children.
Another option is to set up a scope in Settings | Appearance and Behavior | Scopes and to switch to the view of that scope in the Project view. This is more difficult to set up than Favorites, but also more flexible and less cluttered.