Reputation: 34498
When I use Enable Typescript Compiler
, the TypeScript compiler generates a .js
file for every .ts
and .tsx
file.
When doing code completion, WebStorm does not know that the files were generated and therefore it suggests completion from the generated files as well as from the TypeScript files. To prevent this, I have to go to every generated .js
file and right click and Mark as Plain Text
:
However, when I do a text search, I still get the hits from the generated JavaScript files:
Is there a simple way to exclude the generated files the way it is possible to exclude directories (except for creating a scope that excludes all the generated files)?
Upvotes: 9
Views: 2433
Reputation:
build/$FileDirRelativeToProjectRoot$
-- the variable is important to avoid potential naming conflicts. It's best to use a build output directory that is excluded by .gitignore
(assuming Git repo).(Tested with WebStorm 2016.1.1 on OS X El Capitan)
Upvotes: 1
Reputation: 93728
Text search supports scopes. I'd suggest adding a custom scope in Preferences | Appearance & Behavior | Scopes
with your generated files excluded and using this scope in the Find in Path
dialog as the custom scope.
Upvotes: 3