Like @Justinas and commenters said: You could make a custom scope and annoy yourself every time by selecting that custom scope when using Find in Path (and similar) because PhpStorm does not use that custom scope by default 🤦🏻♂️
Excluding the node_modules directory breaks autocompletion and other code assistance functionality anyway. You don't want to do that.
However, I found a hack which does not require any directory exclusion of node_modules nor a custom scope:
- Close PhpStorm. Ensure it's not running.
- Open name_of_your_project.iml in the .idea directory within your project directory with your favourite text editor. As long as it isn't PhpStorm.
- Remove the line
<content url="file://$MODULE_DIR$/node_modules" />
- Save.
- Enjoy life again.
I find it amateurish of JetBrains to include dependency storage directories like node_modules of JavaScript/TypeScript and vendor of PHP by default.
There is barely any use case to include those directories in find & replace functionality, left alone refactor functionality.
core
folder. But I am looking for alternative ways.