Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
2.0k views
in Technique[技术] by (71.8m points)

vscode settings - Is there a way to flatten or merge single-folder folders in vs code explorer?

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?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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.

compact folders demo


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

57.0k users

...