I don't know if there's a name for this kind of behavior.
I've seen it in IntelliJ, where single-folder folders are unified or flattened in the project tree pane, where instead of:
.
├── pom.xml
├── src
│ ├── main
│ │ ├── java
│ │ │ └── com
│ │ │ └── somepkg
│ │ │ └── coreapi
│ │ │ ├── controllers
│ │ │ │ ├── AssetMutations.java
│ │ │ │ ├── HomeController.java
│ │ │ │ └── SessionsQuery.java
│ │ │ ├── CoreApiApplication.java
You see:
.
├── pom.xml
├── src
│ ├── main
│ │ ├── java
│ │ │ └── com.somepkg.coreapi
│ │ │ ├── controllers
│ │ │ │ ├── AssetMutations.java
│ │ │ │ ├── HomeController.java
│ │ │ │ └── SessionsQuery.java
│ │ │ ├── CoreApiApplication.java
Is there a way to make vs code tree-view file explorer to show subfolders this way?
You can use drag and drop to add folders to a workspace. Drag a folder to the File Explorer to add it to the current workspace. You can even select and drag multiple folders. Note: Dropping a single folder into the editor region of VS Code will still open the folder in single folder mode.
It looks like it is in the iteration plan for June, 2019.
See Iteration plan for June, 2019: release in July, 2019 and issue: merging single child directories.
Update: making it into v1.41 to be released in December, 2019. See https://github.com/microsoft/vscode-docs/blob/vnext/release-notes/v1_41.md#compact-folders-in-explorer
Compact folders in Explorer
In the File Explorer, we now render single child folders in a compact form. In such a form, single child folders will be compressed in a combined tree element. Useful for Java package structures, for example.
Setting
explorer.compactFolders
controls this behavior. By default, this setting is turned on.
So "explorer.compactFolders": false,
will disable the feature.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With