简体   繁体   中英

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 cmd alt F7 (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 shift cmd alt F7 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? (Ie, find the real usages instead of a text search for occurrences).

Instead of cmd alt F7 , use the shortcut alt F7 . 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 alt F7 then your choices are remembered.

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

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

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

用法发现

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

范围列表

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

创建范围

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM