Visual Studio Code - Group pending changes by folder

自作多情 提交于 2020-07-07 05:31:34

问题


I want to get rid of my current IDE (Jetbrains) and migrate to Visual Studio Code because of some supported extensions.

There is only one thing I'm missing in VS Code...

If I have multiple files in source control as pending changes, they are just shown as a flat list. In e.g. IntelliJ it is possible to group pending changes files by their folder. This is very helpful, because I have multiple files sharing the same filename...

Is there an extension, I can install to add this feature or is it just a config, I did not find, yet?


回答1:


I see these interface changes in the Insiders Build 1.47:

The tree/list option has been removed from the outer Source Control header bar and is under the ellipsis (three dots) now - with additional options if you choose list: path, name, status. As well as the tree view you were looking for.


As @jabacchetta predicted, this functionality is being added to v1.39 - for scm providers that support it, like git. See https://github.com/microsoft/vscode-docs/blob/vnext/release-notes/v1_39.md#updated-source-control-view. And see the link in @jabacchetta's answer. Tree view in source control.

As usual, you can open/close folders by clikcking on them or left/right arrows. Demo from the Insider's Build:

From the Release Notes :

Updated Source Control view

The Source Control view has been updated to use the latest tree widget. You can now toggle between a list and a tree view with the Toggle View Mode button on the Source Control title bar.

You can change the default view using the scm.defaultViewMode setting, which takes the values list or tree.

You also now benefit from the automatic keyboard navigation and filtering of the updated tree widget by simply starting to type in the view.

When in tree view mode, which displays folders, the Git extension now contributes commands to folders, for example Stage Changes, which will be applied to all files within a folder.




回答2:


Install the GitLens extension. Then modify the gitlens.gitExplorer.files.layout setting to match your preference.

The default auto value will automatically change between a "list" and "tree" view, depending on the quantity and location of the files changed. Simply change the setting's value to tree if you'd prefer to always have it shown that way.

As for VS Code's built-in SCM functionality, there's a feature request pending for tree-formatting.



来源:https://stackoverflow.com/questions/51476096/visual-studio-code-group-pending-changes-by-folder

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!