Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support nested .vscode folders #108204

Closed
stewartadam opened this issue Oct 6, 2020 · 7 comments
Closed

Support nested .vscode folders #108204

stewartadam opened this issue Oct 6, 2020 · 7 comments
Labels
config VS Code configuration, set up issues *duplicate Issue identified as a duplicate of another issue(s) feature-request Request for new features or functionality
Milestone

Comments

@stewartadam
Copy link
Member

stewartadam commented Oct 6, 2020

The problem

I'd like for VS Code to be able to recognize that a folder in my working tree is its own "root workspace" without having to actually make it a top-level folder in a multi-root workspace. I'd suggest doing so by checking for the presence of a .vscode folders in the working tree, and if found, exposing the respective nested launch tasks up at the workspace level on the debug pane:
image

Background

Background: it's common for Git repos to contain several projects either of varying types/languages, or multiple of the same language:

ex1, multi-language:

myproject/
    aspnet-web-server/
       `.vscode/`
        ... dotnet core stuff

    go-api-microservice/
       `.vscode/`
        ... go stuff

    react-client/
       `.vscode/`
        nodejs stuff ...

README.md
...

ex2, multiple C# projects:

myproject/
    server/
        aspnet-api-server/
           `.vscode/`
            ... functions project

        azfunc1/
           `.vscode/`
            azfunc1.csproj
            ... azfunctions stuff

        azfunc2/
           `.vscode/`
            azfunc2.csproj
            ... azfunctions stuff

    clients/
        console-app/
           `.vscode/`
            console-app.csproj
            ... dotnet core stuff

myproject.sln
README.md
...

It makes logical sense to open the top-level myproject folder in VS Code as the workspace; I get access to all the docs, readme, and other files that aren't necessarily within one of the individual project folders like console-app. But if I do so, none of the launch settings or debug tasks are discovered correctly. VS Code will try to create myproject/.vscode and might auto-detect one of the projects, but I still have to go add the rest manually.

Alternatives

Multi-root worksapces

You might say but that's what mutli-root workspaces are for! But that's the problem - I don't want multiple root workspaces, which flattens the directory structure. A multi-root workspace would look like:

aspnet-api-server/
    ...
azfunc1/
    ...
azfunc2/
    ...
console-app/
    ...

I lose access to easily edit other files in the directory tree (and the presentation of projects themselves lose their position in the tree)... Unless I add back the whole repo as one of the multiple roots on top of each project, but that seems like a silly workaround, doesn't really solve the positioning issue and I'd then have multiple files in the workspace tree pointing to the same file on disk.

Manually configure launch.json

A user could open each project folder in VS Code as an independent workspace, have it generate the appropriate .vscode/* launch and task configurations, then merge them all into myproject/.vscode when opening the repo folder as the top-level workspace. This is long, tedious, and error prone and also requires path replacements.

In short

I'd be wonderful if VS code would treat any nested folders with a .vscode folder present as one of the root workspaces, similar to the multi-root workspaces model. This wouldn't impose restrictions on which folders are opened as top-level/root workspaces, and still permit launching different types of nested projects.

@stewartadam
Copy link
Member Author

stewartadam commented Oct 6, 2020

Related to vscode-docs #3547 as well - workspace vs multi-root workspace is murky and essentially what I'm asking for is to break apart the concept of "multi-root" and just support multiple workspaces, root or not.

Suggestion: workspace remains the terminology for VS Code's concept of the workspace configuration (folders/paths added to the file tree, enabled extensions, etc) and workspaces are composed of 1+ projects. Projects could be configured as top-level (today's multi-root workspaces) or detected from the source tree (if this issue gets addressed).

@connor4312 connor4312 added the feature-request Request for new features or functionality label Oct 6, 2020
@connor4312 connor4312 assigned bpasero and unassigned connor4312 Oct 8, 2020
@bpasero bpasero added config VS Code configuration, set up issues workbench-multiroot Multi-root (multiple folders) issues labels Oct 8, 2020
@bpasero bpasero removed their assignment Oct 8, 2020
@bpasero
Copy link
Member

bpasero commented Oct 8, 2020

//cc @sandy081

@bpasero bpasero removed the workbench-multiroot Multi-root (multiple folders) issues label Nov 7, 2020
@sandy081
Copy link
Member

/duplicate

@sandy081
Copy link
Member

#32693

@github-actions github-actions bot locked and limited conversation to collaborators Dec 31, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
config VS Code configuration, set up issues *duplicate Issue identified as a duplicate of another issue(s) feature-request Request for new features or functionality
Projects
None yet
Development

No branches or pull requests

5 participants
@stewartadam @bpasero @connor4312 @sandy081 and others