intellij-idea

How can I prevent IntelliJ IDEA from autocolapsing folders


I use intellIJ. Sometimes I have two packages, A and B, that are nested such that A contains B and nothing else. When this happens then the folder structure on the left displays them like this:

enter image description here

I don't like how it groups A.B together into a single tree node. Is there a setting to prevent IntelliJ from doing this?

(I've googled around a bit and dug through the settings menu and I'm not seeing anything but may'be I've missed it.)


Solution

  • Click on the gear icon on top of the project panel and look for "Compact empty middle packages".

    In IDEA 2024 and later you might need to mouse over project view for buttons to appear, then click "vertical ellipsis" ("⋮") button and select "Tree Appearance" (or "Appearance") and then "Compact Middle Packages" from pop-up menu.