Exclude a file (library) from inspection

Aloha,

As most projects, I too use a js framework (ember.js), and placed it in a folder named "lib".
I use the integrated jsLint in addition to the IDE's builtin inspection tools.
The problem is that I cannot find a way to (1) exclude the file from inspection, (2) without interfering with the IDE's code completion (variables and methods declared in that file).
I've tried:

  • Excluding the file from project - I lose (2).
  • Mark file as text - I lose (2).
  • Add a new scope (which excludes the file) - can't get the inspection to be other than "project default".
  • Move it to External libraries - I tried adding it to Settings->Javasript->Libraries, and didn't see any affect.


Ideas?

Thanks in advance,
Oren

0

Hi Oren,

  1. Create separate scope (Settings | Scopes) to include such file(s)
  2. Settings | Inspections:
    • select inspection you want to disable
    • right click and choose "Add scope" -- now you can disable this particular inspection (or configure it differently, if such inspections has extra options) just for that scope.
2
Avatar
Permanently deleted user

Thank you Andriy :)

This removes some erros, but not all since they stem from jsLint.
In addition, having the files in the project also affects the code coverage (using builtin jsTestDriver), i.e. I can never get to 100%.

Cheers,
Oren

0

This is similar to what I want to do, but what I'm looking for is excluding certain files from the "ctrl-click to go to declaration" feature.  Sencha Touch requires you to structure your app a certain way.  You wind up with a folder with subfolders with all the various javascript units for each object.  But you also have several single javascript files that are all the units in the library together.  When I ctrl-click, I want it to pop up with the single units, not the huge library files.  I followed the directions for adding a scope and removing those files from it, but they still appear in the ctrl-click popups.

0

That's completely different. I think you need to look at JavaScript libraries functionality (check "Settings | JavaScript ..." -- should be there).

Check the blog as well -- it has useful articles there, for example: http://blog.jetbrains.com/webide/2012/03/new-in-4-0-more-convenient-javascript-libraries-configuration/

0

Thanks for the reply.  It's probably not quite as different as you think.  I don't know if you're familiar with out they do things in Sencha Touch 2 and onwards, but they pull in the whole javascript library as a subdirectory under your project.  So it's all a self-contained thing.  So I might have:

ProjectName
ProjectName\app
ProjectName\app\controller
ProjectName\app\view
ProjectName\touch
ProjectName\touch\src
ProjectName\touch\src\core
ProjectName\touch\src\dataview

etc.

In the ProjectName\touch directory, there are four files: sencha-touch.js, sencha-touch-debug.js, sencha-touch-all.js, sencha-touch-all-debug.js that contain in a single file all the files in all the subdirectories of ProjectName\touch\src.

The annoying thing is when I click to go to a declaration, it mixes all the hits in those sencha-touch*.js files with all the individual files like List.js or Button.js that are buried down in the subdirectories of ProjectName\touch\src.

Does that make sense?

0

I'm not working with JavaScript myself much -- just basic jQuery usage + jQuery plugins (nothing more). So .. yes -- I'm not familiar Sencha Touch library and how it works (file structure etc).

As I understand you want to exclude some files from being indexed at all (so it is not used for code completion or whatever), right ? If so -- then marking those all-in-one files as Plain Text (special command available via right click in Projevt View) should do what you want.

0

That works for me!  Maybe there's a "better" way of doing it (like if I ever actually did care about opening those files and seeing javascript highlighting, etc.), but for now I'm happy.

Thanks!

0

Currently there is no other way of avoiding file from being indexed while still having it as part of the project (not excluded completely).

0

Well, I'd actually be fine to exclude those files from the project.  But as far as I can tell you can only exclude folders, not files, and I need the subfolders underneat it so I'm stuck.  Woudl be nice if the project folder exclusions allowed you to choose recursive/non-recursive like the scope exclusions do.  Though I can see how that would be a little trickier.

0

You can exclude by file name, but it will affect ALL projects not only current one (Settings | File Types -- that field on the bottom) and therefore this is not a real option in vast majority of cases.

0

请先登录再写评论。