Pregunta

Most of my JavaScript projects have a folder lib containing source files and a folder dist containing builds of the project.

I use WebStorm (great IDE!), and WebStorm's code inspector and code navigation always reckons with both sources and build files. For example when clicking "Goto declaration" on a method, instead of going to the declaration I first have to select the right one from two or three options: the source file, the library, and the minified library (the latter via the source map I guess).

To solve this, I can mark the dist directory as "Excluded", but then the folder isn't visible at all in the IDE, not even for the version control system so I can't easily commit changes to github.

Is there a way to disable inspection of the files in the folder dist without making the folder completely invisible for everything in the IDE?

Edit:

I found the same question for PHPStorm: How to exclude files/folders from code inspection in PHPStorm?. The provided answer works: create a scope where dist is excluded, then for each individual inspection add the created scope and remove the default scope (there are hundreds of inspections...). However this is so extremely cumbersome and error-prone that its hardly worth it :(

¿Fue útil?

Solución

Adding scopes to inspections won't help with 'goto declaration' issues I can suggest the following: - in Settings/javascript/libraries, add dist folder as a library - disable this library

Does it help? See also IDEA-23537

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top