Skip to content

Conversation

@JoeRobich
Copy link
Member

@JoeRobich JoeRobich commented Feb 3, 2026

An experiment to see what it would be like if opening a loose solution file in VSCode would then open the containing folder and launch roslyn lsp against the solution.

  • If workspaceFolders are empty and the C# extension starts with the solution file as the active document, then we open the parent folder in the current window.
  • If workspacesFolders are not empty and the active document changes to a solution file outside the workspacesFolders, then we open the parent folder in a new window with the solution file open.
  • When RoslynLanguageServer is determining the initial solution to open, we check whether the active file is a solution file and use that instead of any settings.

Downsides:
We don't want to activate C# outside of C# scenarios, since solution file are used for languages other than C# (for example C++). One thought is that a Solution Launcher extension could be made that always activate on startup and contained the code in solutionFileWorkspaceHandler.ts. Users could then opt-in to the solution loading behavior by installing this extension.

From within VS Code:

Screen.Recording.2026-02-02.at.10.02.23.PM.mov

From the command line:

Screen.Recording.2026-02-02.at.10.05.04.PM.mov

@JoeRobich JoeRobich force-pushed the dev/jorobich/open-solution branch from 67be8ac to 1c57141 Compare February 3, 2026 06:01
"onCommand:o.showOutput",
"onCommand:omnisharp.registerLanguageMiddleware",
"workspaceContains:**/*.{csproj,csx,cake}"
"workspaceContains:**/*.{csproj,csx,cake,sln,slnx,slnf}"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't work as I expected and the C# extension doesn't load when only a loose solution file is opened in VS Code.

Suggested change
"workspaceContains:**/*.{csproj,csx,cake,sln,slnx,slnf}"
"workspaceContains:**/*.{csproj,csx,cake}"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants