Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Exclude directory from intellij inspection, but not exclude from autocomplete

As far as I know, the only way to exclude a directory is to mark it as excluded in project structure. However, this would make IntelliJ totally ignore the directory. Thus it will not appear in autocomplete options.

I do not want this. I want exclusion from inspections but inclusion in everything else. Is this possible?

I'm using Intellij 12.0.2. And, it's actually the bootstrap css and js failing the inspection.

like image 857
NimChimpsky Avatar asked Jan 21 '13 11:01

NimChimpsky


People also ask

What is excluded directory in IntelliJ?

Excludes Use this page to specify files and directories within your project that should not be passed to the compiler. In this field, the path to a file or directory to be excluded from compilation is shown. For a directory: select this option to exclude from compilation all the corresponding subdirectories.

How do I add excluded folder in IntelliJ?

Add a folder to the list of excluded paths in the Remote Host tool window From the main menu, choose Tools | Deployment | Browse Remote Host or View | Tool Windows | Remote Host. In the Remote Host tool window that opens, select the relevant server configuration from the list.

How do I exclude a class in IntelliJ?

In the Settings/Preferences dialog ( Ctrl+Alt+S ), go to Build, Execution, Deployment| Compiler | Excludes.


2 Answers

As suggested by Peter Lawrey, the proper solution would be to use the custom inspection scope that excludes the directories where you don't want the inspections to be run.

like image 145
CrazyCoder Avatar answered Oct 11 '22 09:10

CrazyCoder


With IntelliJ 15, you can mark the directory as Generated Sources Root. This skips the inspections but auto-complete will still work.

  1. Right click on the desired directory
  2. Select Mark Directory As/Generated Sources Root

NB: It seems, that you cannot select this type in the Project Structure dialogue, only via the right click.

like image 38
mmmichl Avatar answered Oct 11 '22 09:10

mmmichl