any way to exclude certain generated *.js files or *.min.js files from the JavaScript/TypeScript navigation?

I'm using TypeScript in EAP 12, its working great! I've got sourcemaps enabled for nice debugging; though its meant to get TypeScript + sourcemaps working, I need to put the *.ts and generated *.js file in the same directory.

I'd like to hide the generated app.js file (created from the TypeScript) in 1 directory - and not hide any of the other JS libraries I use in the application; so that when trying to navigate to functions in code, it ignores those generated files. (Actually I'd also love it to ignore *.min.js files too while we're at it :)

I did wonder about setting my global ignore hide settings in  Settings -> File Types -> Ignore files and folders and explicitly adding globally "app.js" and "*.min.js" as being the js file to hide but it does feel a bit dirty being global. I wonder is there any other way to mark certain wildcards of JS files as being excluded from the code navigation stuff, on a more per-project basis?

5 comments

The big downside of hiding the *.js.map and *.js files is that they disappear from the source control UI in IDEA; so it feels like that hack isn't a good idea :)

0

I can think about marking these files as plain text, but this needs to be done explicitly for every file (context menu).

Kirill

0

Thanks for that Kirill, the "mark as plain text" works a treat for the generated app.js file - and avoids the issue of the file being excluded (so the VCS plugin doesn't detect the file has changed so it gets hidden from the commit UI etc). For now I've gone with, the generated "app.js" I mark as plain text, then I exclude the *.min.js from IDEA

0

I use a combination of all four methods to keep my JS code completion/navigation clean:

  • add to global ignore pattern - e.g. for *.min.js
  • exclude from project - e.g. for entire lib directories that are outside the code base. Usually I add them to VCS (git) first, then exclude, or I manage those directories from the cli
  • mark as plain text - only for individual files
  • create javascript libraries and exclude them from the project - that only helps for code completion, not for file navigation (which I use most often), so I rarely use this.

See a previous post of mine (very similar to yours): http://devnet.jetbrains.com/thread/438601
There is a feature request for marking entire directories as 'plain text': http://youtrack.jetbrains.com/issue/IDEA-97846.
Unfortunately there are no plans yet to implement this.

0

I found when searching for a string within specific file types, I found 

*.js,!*.min.js

Seems to work well for filtering out the minified .js or .css files.

0

Please sign in to leave a comment.