IntelliJ showing source and test files in same package

497 Views Asked by At

I am using IntelliJ 2011.1.1 CE and now suddenly it start showing source (.java) and test classed in same package. I have selected "packages" view which is used to show only src files

Screenshot

1

There are 1 best solutions below

1
Andrey On

Packages view has always shown both test and production classes.

If test and production files are located in different modules you can enable Show Modules option to separate them: enter image description here

It also shows test files with different background colors, which you can configure in Settings (Preferences on macOS) | Appearance & Behavior | File Colors | Appearance & Behavior | File Colors.

A related request: IDEA-144965 Add option to hide test files in the 'Packages' of 'Project' tool window