Martin Marconcini
Martin Marconcini

Reputation: 27246

How can I set the default Scope in IntelliJ 12 for Find Usages?

I've returned to IntelliJ after a long hiatus for Android development so I'm getting used to it again. The problem I have is that for example when you want to see where is a class being used, you'd position the caret in the class declaration and issue cmdaltF7 (on Mac OS X) to Find Usages, which is returning stuff from mapping.txt and seeds.txt as well as the .java results, and even tho I can set up the defaults by doing shiftcmdaltF7 and un-tick the: search for text occurrences and even change the scope from Project Files to a custom scope (for example), these options are not saved when I invoke Find Usages again.

Does anybody know of a way to personalize the Find Usages so it's more close to what Eclipse would do? (I.e., find the real usages instead of a text search for occurrences).

Upvotes: 29

Views: 7714

Answers (2)

verybadalloc
verybadalloc

Reputation: 5806

Reporting back from the future: the behaviour described in the question has now been implemented (Intellij issue mentioned in the comments).

To configure cmdaltF7 to run in a default scope, start by running it against some Symbol

Usages found

Clicking on the wrench icon, one can select one of the pre-defined scopes, or create a new one (using the ... button).

List of scopes

The + creates a new scope. Find the folder in which to look, and click Include recursively. And voila!

Create a scope

Any consequent searches will use that scope until it is changed.

Upvotes: 11

Jen S.
Jen S.

Reputation: 4234

Instead of cmdaltF7, use the shortcut altF7. This will open a pop-up for you to make a selection about Scope, Test occurrences, and types of usage. You will have to make this selection one time. The next time you press altF7 then your choices are remembered.

The result is that altF7 followed by enter gives you what you need.

Upvotes: 7

Related Questions