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

[SUGGESTION] Support Multi-root workspaces #494

Open
Meligy opened this issue Sep 6, 2023 · 4 comments
Open

[SUGGESTION] Support Multi-root workspaces #494

Meligy opened this issue Sep 6, 2023 · 4 comments
Labels
area-solution Solution explorer enhancement New feature or request
Milestone

Comments

@Meligy
Copy link

Meligy commented Sep 6, 2023

Describe the feature you'd like

Yes, it's not a great thing to do, but sometimes one ends up with related solutions (.sln files) in the same repository, without one solution to rule them all.

in this case, a multi-root workspace looks like a good idea to see them in the same place.

This works well for other extensions BTW. For example, Azure Functions can only support one Azure Functions project at a time, but if you use multi-root workspace, you can have multiple Azure Functions project, each in one root folder of this workspace, and it works fine.

But if you try to do this for dotnet, for example, by adding a .vscode/settings.json file to every root folder, you get:
This setting cannot be applied in this workspace. It will be applied when you open the containing workspace folder directly.

So, the request is to make this work, and allow us to have one default solution per multi-root workspace folder.

Alternatives considered

Probably adding another solution that includes all the projects from all the folders in the multi-root workspace. But this is not great as it doesn't show which is which. Especially if there are no shared projects between the solutions (which is the more suitable scenario for multi-root workspaces).

Environment Information

No response

@lifengl
Copy link
Member

lifengl commented Sep 7, 2023

I am somewhat confused by this one default solution per workspace folder suggestion. Do you expect those solutions to be opened and shown in the solution explorer at the same time, or you want a fast way to switch between solutions (but only one is opened one time). I guess the second case doesn't provide much value. But in any case, it would be similar to support multi solution in one workspace, so this is mostly independent to the multiple root context.

@Meligy
Copy link
Author

Meligy commented Sep 8, 2023

I don't personally use the solution explorer that much.

I want to be able to browse different C# files from either solutions, and it'd open in the context of its parent project / solution in that root folder. I'd get proper intellisense, go to definition, etc.

That's kinda the point of multi-root workspaces in my mind. It'd be like it's its own VS Code window, but without having to switch between actual different windows.

Solution explorer can change based on what root folder is active now or something. Or it can be completely disabled even if there's no workspace-level solution defaulted. Not worried about that.

@DemonikGH
Copy link

DemonikGH commented Oct 8, 2023

Really need multi root workspace support. I'm using multiroot with omnisharp with unity and I tried to switch to devkit but it's impossible for me because intellisense stops working with multiple roots (no extension function works, it just all fails with errors) while it works with omnisharp, even if it's more limited and slower. And I need multiple roots because I have several projects opened each with its own git repo and solution. Even just having single solution loaded is fine, I just need to be able to use multiple roots at all.

@rocifier
Copy link

rocifier commented Mar 20, 2024

The extension doesn't work at all for me because of this. Here's the trail end of my log. It's probably because only one of my workspace folders contains a .NET solution (in its root).

Using preinstalled .NET runtime at "C:\Program Files\dotnet\dotnet.exe"
.NET server started and IPC established in 3293ms
Completed Spawn .NET server (7695ms)
Completed Clear environment (8419ms)
Failed at 'Open a solution with environment service' (11133ms) with error: Error: Object reference not set to an instance of an object.
Failed at 'Open a solution' (11138ms) with error: SolutionOpenError: Run into errors while opening the solution: Error: Object reference not set to an instance of an object.
Failed to open solution SolutionOpenError: Run into errors while opening the solution: Error: Object reference not set to an instance of an object.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-solution Solution explorer enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants