How to suppress all inspection (including errors) in one file/class in Actionscript

Answered

Sometimes you use in your code third party libraries which don't have stellar code (for example Mochimedia's API) and because of that, if you run full code inspection they are there clogging your results. I know how to suppress single statement, but there seems to be no option to suppress them for class or whole file in *.as files. Not to mention I have no idea how to suppress error detection. Is it even possible?

1
7 comments
Avatar
Permanently deleted user

Thank you, I didn't know about the scopes!

0
Avatar
Permanently deleted user

I know about scopes, but these do no solves my need to suppress inspection for specific files not only locally but *team-wide*.

- provided XML, JSON, Text, ... files

- Third party Javascript files

Furthermore, a few set of inspection do not work if you use them with a scope restriction (i.e. most of the "Unused" inspections).

Does IDEA 2016.2 already provide more means to do this now?

0

The links in your answer both point to the same thing. It refers to scopes but there does not seem to explain any way to select a file or folder and say "Do not inspect this code"  but without any explanation as to how to do this, I can use the 'generated code' scope on the project and set it to scan only non-generated code.

The application is a Typescript Nodejs application. Javascript code is generated into a folder (or two) and the scans are not needed for the generated code. So I mark the folders where the Javascript gets put as 'generated root' using the right mouse and set the general option for inspections to only inspect the non-generated and it works.

I suggest you work on that page you linked to in the docs. Its not very clear that that is something that can be done.

0

Here's a more direct answer, for those wanting to suppress inspections for a particular file (or group of files).

  1. Go to File -> Settings.
  2. In the left-hand pane of the window that appears, go to Appearance & Settings -> Scopes.
  3. Click the "plus" icon, select "Local"*, and name your scope. Include the files you want to suppress inspections on to the scope.
  4. Click the "Apply" button in the lower-right-hand corner. This must be done in order for the inspection settings to "see" your scope.
  5. Go to Editor -> Inspections. Select the inspection or inspection category you want to suppress. You can select multiple inspections by holding down the "Ctrl" key while clicking.
  6. On the right-hand-side of the window, click the scope-selection drop-down menu (normally set to "In All Scopes"), next to the severity selector. In the menu, click your previously created scope.
  7. The severity and scope selectors should be replaced with a "Severity by scope" area. In this area, click the check-box next to the previously created scope.
    Note - If you add additional scopes, and a file is present in more than one scope, the file will have the severity of the first scope that it is found in (starting from the top, going down). You can click the gear icon to modify the scope order.
  8. Click "Apply" or "OK"
2

That last solution doesn't help with every error, there's a solution that does and is easier:

Right click the file, Analyze -> Configure Current File Analysis... Then you can select None or Syntax, depending on which you want

0

Please sign in to leave a comment.