Reputation: 2583
I'm using IntelliJ IDEA 14.0.3 on Linux.
In the menu there Edit - Find - Find In Path. In the search dialog there is a combobox Context with values anywhere, in comments, ...
Is it possible to define my own contexts and how?
Upvotes: 0
Views: 860
Reputation: 16709
You can't add your own context, but you can add a scope:
To create and edit scopes, use the Scopes page of the Settings dialog. Scopes are defined in the following modes:
Manually, by specifying file masks according to the scope language syntax in the Pattern text box. By selecting files and folders and clicking the buttons Include, Include Recursively, Exclude, and Exclude Recursively. Based on the inclusion/exclusion, IntelliJ IDEA creates an expression and displays it in the Pattern. Refer to the section Configuring Scopes and File Colors.
So basically a scope defines, which files belong to it (e.g. all files in src/test).
After you have defined your own scope, you can use it in Find in Path
by changing the scope
to custom
and selecting your scope. This will perform a search only for files defined in your scope. You can additionally use a context to further narrow down your search.
Here's a configuration and result for the example you have provided in the comment:
Upvotes: 1