Skip to content

SLNX support in dotnet.openSolution #8483

@pascallapradepodform3d

Description

@pascallapradepodform3d

Is your feature request related to a problem? Please describe.

Yes: .slnx are now supported by the latest versions of Roslyn, but it is not possible at the moment to open them with the dotnet.openSolution workspace command, which is needed within a workspace with multiple solutions (such as a mono-repo).

Describe the solution you would like

The list of solutions presented by the openSolution command should include SLNX-style solutions. Currently, they are omitted.

Applicable Scenarios

Every project with more than one solution, where the solutions are using the newer SLNX format.

Describe alternatives you've considered

There is a semi-workaround, to at least have the solution be loaded, by changing the dotnet.defaultSolution setting; but it does not allow to open multiple SLNX at once, so it is still limited. It is also abnormal to have to change the default solution multiple times per day to be able to work on multiple solutions.

Alternatively, each solution can be opened in a separate VS Code window, but it's not ideal depending on the amount of solutions being worked on.

Additional context

It appears that the only thing missing is how the files are filtered for the presented options. I made the following change locally, created the vsix, and tested opening an .slnx. Everything seemed to work, so the rest of the extension seems to already support the feature.

Considering that, if the project welcomes PRs from external contributors, I'll be happy to open a PR with the following change:

diff --git a/src/lsptoolshost/workspace/workspaceCommands.ts b/src/lsptoolshost/workspace/workspaceCommands.ts
index c2aeea5a..0ccf2afd 100644
--- a/src/lsptoolshost/workspace/workspaceCommands.ts
+++ b/src/lsptoolshost/workspace/workspaceCommands.ts
@@ -24,7 +24,7 @@ async function openSolution(languageServer: RoslynLanguageServer): Promise<vscod
         return undefined;
     }
 
-    const solutionFiles = await vscode.workspace.findFiles('**/*.{sln,slnf}');
+    const solutionFiles = await vscode.workspace.findFiles('**/*.{sln,slnf,slnx}');
     const launchTargets = solutionFiles.map(createLaunchTargetForSolution);
     const launchTarget = await vscode.window.showQuickPick(launchTargets, {
         matchOnDescription: true,

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions