microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
162.48k stars 28.65k forks source link

Hirerarchical multi-root layout #76904

Open eine opened 5 years ago

eine commented 5 years ago

Currently, the 'folders' field of a .code-workspace configuration file is an array of items, each of them defining a folder. Then, all of these are shown as level-1 items in the default File Explorer. I suggest to support nesting 'folder' items with arrays, which will be layout as level-1, level-2, level-3, etc. For example:

{
  "folders": [
    {
      "name": "Project A",
      "folders": [
        {
          "path": "prjA/dirA",
          "name": "Dir A"
        },
        {
          "path": "prjA/dirB",
          "name": "Dir B"
        }
      ]
    },
    {
      "name": "Project B",
      "folders": [
        {
          "path": "prjB/frontend/src",
          "name": "Frontend"
        }
        {
          "name": "Backend",
          "folders": [
            {
              "path": "prjB/api",
              "name": "API"
            },
            {
              "path": "prjB/lib/src",
              "name": "Library"
            }
          ]
        }
      ]
    },
    {
      "path": "common",
      "name": "Common"
    }
  ]
}

which would translate to the following File Explorer structure:

- Project A
  - Dir A (prjA/dirA)
  - Dir B (prjA/dirB)
- Project B
  - Frontend (prjB/frontend/src)
  - Backend
    - API (prjB/api)
    - Library (prjB/lib/src)
- Common (common)

Related to #74229, I believe that the most straighforward integration with this feature would be an option in the settings to display each level-1 item in a separate File Explorer View.

Alternatively, a group field can be added to each item defined in the multi-root configuration file (be it a folder or an array). All the items with the same group identifier belong to a separate TreeView.

Ref #76902.


Related to #76399, the group concept above would translate to an Editor Group. Hence, the shown tabs in a given Editor Group will depend on the 'location' ('group') of the currently active document.


Ref #31308. Ref #43188. Ref #73312. Ref #76891.

vscodebot[bot] commented 4 years ago
This feature request is now a candidate for our backlog. The community has 60 days to upvote the issue. If it receives 20 upvotes we will move it to our backlog. If not, we will close it. To learn more about how we handle feature requests, please see our [documentation](https://aka.ms/vscode-issue-lifecycle). Happy Coding!
Paebbels commented 4 years ago

This would be a very useful feature for me too.

markm77 commented 4 years ago

I've upvoted as similar to https://github.com/microsoft/vscode/issues/87887 but really hope this could be complemented by repo auto-mapping where repo (folder) locations in a workspace are auto-detected on launch and no fixed mapping needs to be maintained. See https://github.com/microsoft/vscode/issues/87888 and please consider upvoting this.😀

vscodebot[bot] commented 4 years ago
:slightly_smiling_face: This feature request received a sufficient number of community upvotes and we moved it to our backlog. To learn more about how we handle feature requests, please see our [documentation](https://aka.ms/vscode-issue-lifecycle). Happy Coding!
LucaGabi commented 4 years ago

can you also please read this feature request: https://github.com/microsoft/vscode/issues/95182 and upvote ?

khobotin-elopage commented 2 years ago

Is there any updates? I really need this feature

pantsmann commented 1 year ago

Would love this feature. As an example, I have a workspace with workspacefolders for 30 repos that interact (microservices perhaps). I often need to search among them all or something else, but I don't often work in each workspacefolder. There are a few that I focus on. Unfortunately, 30 workspacefolders becomes cumbersome so I'd like to organize the workspacefolders in a hierarchy. That hierarchy may not even be related to any directory or repo structure. I could put some of the workspacefolders under a folder called 'common', others under 'rare', and others under 'shared-libraries'. Then I can focus on a few workspacefolders but quickly find more infrequently used ones as needed.

QuackBtz commented 1 year ago

Would love this feature. As an example, I have a workspace with workspacefolders for 30 repos that interact (microservices perhaps). I often need to search among them all or something else, but I don't often work in each workspacefolder. There are a few that I focus on. Unfortunately, 30 workspacefolders becomes cumbersome so I'd like to organize the workspacefolders in a hierarchy. That hierarchy may not even be related to any directory or repo structure. I could put some of the workspacefolders under a folder called 'common', others under 'rare', and others under 'shared-libraries'. Then I can focus on a few workspacefolders but quickly find more infrequently used ones as needed.

I would love this, cuz i use a backend and a frontend directory, both with multiple repos and is common to be working on 2 or 3 at the same time, so would be pretty handy to keep it organized.

MiniSuperDev commented 11 months ago

I would love this, especially because I am working on a monorepo with 200 packages and since they are not grouped it is not so easy to work with.

mysiki commented 10 months ago

+1

csabatuz-chess commented 9 months ago

+1

magicleon94 commented 2 weeks ago

+1

KayvanShah1 commented 4 days ago

Grouping folder is a good feature