Any way to exclude individual .java files?

Putting them in Settings | Compiler | Excludes is only able to make the compiler happy but searching for an compiler-excluded .java file still shows that file.

1 comment

No, it is not possible to exclude individual files from IDEA for indexing, refactoring and searching. That said, you can define a scope (File > Settings > [Project Settings] > Scopes) that excluded the file(s) you want to exclude. For example to exclude the class Foo:

!src:com.example.Foo

To exclude multiple files:

!src:com.example.Foo&&!src:com.example.Bar

Then select that scope whenever you are doing you search. IDEA will then not search those files.

For more information, see the following topics in the Help menu:

  • IntelliJ IDEA > Reference > Scope Language Syntax
  • IntelliJ IDEA > Reference > Settings Dialog > Project Settings > Scopes
0

Please sign in to leave a comment.