Hard to exclude node_modules from scope
Hey,
I created a scope to include just the test folder of my project. Using the Scopes window, I pointed to the test folder and said Include Recursively. The scope regex became:
file[site]:test//*
Looks good, but when I do a search with that scope, it includes files from my node_modules folder. And, presumably because node_modules is excluded in Settings | Directories, node_modules does not appear in the tree so that can select it and say Exclude Recursively. The only way to do it is to manually add this to the regex:
file[site]:test//*&&!file[site]:node_modules//*
Why make this so difficult? Why isn't node_modules just automatically excluded?
Thanks,
Eric
请先登录再写评论。
node_modulesare only partially excluded - direct dependencies listed inpackage.jsonare added to JavaScript libraries and thus included.Excluding libraries from custom scope is a bit tricky... To make it work, you need to prefix your scope pattern with
file[your_project_name]:*/&&to overwrite the default scope - see https://youtrack.jetbrains.com/issue/IDEA-145142#comment=27-1156171 for explanationRelated feature request: https://youtrack.jetbrains.com/issue/IDEA-103560, please feel free to vote