Question
How to prevent PhpStorm from searching through the code of specific libraries when using 'Find in Path' (Ctrl+Shift+F), without having to fully exclude these directories from the project?
Answer
To exclude libraries from the 'Find in Path' search results, a custom scope must be defined that specifically excludes the directories you don't want PhpStorm to search. Follow the steps below to create and implement a custom scope:
- Navigate to File | Settings | Appearance & Behavior | Scopes in Intellij IDEA (for Windows and Linux), or Intellij IDEA | Preferences | Appearance & Behavior | Scopes (for MacOS).
- Click the + button to add a new scope.
- Assign a name to this new scope, such as "Without Libraries".
- In the scope definition area, specify which directories to exclude.
- Save settings by clicking 'OK'.
Upon completing these steps, you will be able to select your custom scope "TestScope" from the 'Scope' dropdown menu whenever you execute a 'Find in Path' (Ctrl+Shift+F) search operation. As a result, search results will exclude codes from the directories specified in your custom scope.
Note
This article applies to all Intellij-based IDEs.
Steps and pattern syntax may differ slightly depending on your PhpStorm version. For the most accurate instructions, refer to the official documentation or seek assistance from the IDE's help feature if the above instructions do not align with your version of PhpStorm.
Comments
0 comments
Please sign in to leave a comment.