195

If child folder is empty, vscode get them merged like on screenshot. Is there an option to disable it? It's confusing and harder to use for me.

enter image description here

2
  • 40
    It's a horrible default Commented Feb 4, 2023 at 16:42
  • 1
    Java loves massive towers of nested folders, so if you frequently use Java (ugh), this might be a reasonable thing to turn on. But it's certainly a poor default. Commented May 22, 2024 at 22:07

5 Answers 5

359

Disable/uncheck Explorer: Compact Folders in your settings.

Related info from release notes: Is there a way to flatten or merge single-folder folders in vs code explorer?

Or directly in your settings.json, add "explorer.compactFolders": false.

To reach settings.json, use Ctrl+Shift+P to open the command palette, then type "settings.json" and hit enter (the item is called "Preferences: Open Settings(JSON)")

Sign up to request clarification or add additional context in comments.

5 Comments

Also, if you use JSON settings, this property is "explorer.compactFolders": false.
I am wondering who thought that was a good idea in the first place...
It should be disable by default, because this is really annoying!
Incredibly annoying feature
@Mirko for Java packages it is really useful, but I agree that it should be disabled by default
65

In VsCode on MAC go to Code (top left hand corner)

  1. Select Preferences
  2. then Settings
  3. then Search for compact folders
  4. Uncheck the

enter image description here

Comments

16

In VsCode on WINDOWS go to File (top left hand corner)

  1. Select Preferences
  2. then Settings (or you can simply press Ctrl/Cmd+,)
  3. then search for Compact Folders
  4. Unckeck the option

Comments

6
  1. Press the ctrl + shift + p and type settings.json in the textbox then select Open User Settings (JSON), if you can't find User Settings press ctrl + , at the same time and select the top right icon with a tooltip of Open Settings (JSON)

  2. In that particular file, paste "explorer.compactFolders": false to disable merging file names

Comments

4

For the Explorer View, put the following in settings.json:

"explorer.compactFolders": false, 

For the SCM (Source Control) View, add "scm.compactFolders": false,.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.