Describe the bug
FSharp.workspacePath currently treats only .sln files as solution files.
If FSharp.workspacePath is set to a .slnx path, Ionide does not load it as a solution workspace. It falls through to the directory path branch instead, so the configured workspace is ignored or misinterpreted.
There are also a couple of related .sln-only code paths:
- extension activation uses
workspaceContains:**/*.sln
- the MSBuild solution watcher listens only to
**/*.sln
Steps to reproduce
- Create a minimal repro workspace with two F# projects and two
.slnx solution files:
dotnet new classlib -lang F# -n p1
dotnet new classlib -lang F# -n p2
dotnet new sln -n p1
dotnet new sln -n p2
dotnet sln p1.slnx add p1
dotnet sln p2.slnx add p2
mkdir .vscode
echo '{ "FSharp.workspacePath": "p2.slnx" }' > .vscode/settings.json
- Open that folder in VS Code.
- Reload the VS Code window if needed.
- Observe that Ionide does not reliably honor the configured
p2.slnx path and falls back to general workspace discovery / solution selection behavior instead.
Expected behaviour
Ionide should treat .slnx the same way it treats .sln for:
FSharp.workspacePath parsing
- matching the configured workspace against discovered solution candidates
- solution file watching
Machine infos
- OS: Windows/Mac/Linux
- .NET SDK version: 10.0.301
- Ionide version: latest
Minimal patch
diff --git a/release/package.json b/release/package.json
index 6581bea..f2a90d9 100644
--- a/release/package.json
+++ b/release/package.json
@@ -12,7 +12,7 @@
"workspaceContains:**/*.fs",
"workspaceContains:**/*.fsproj",
"workspaceContains:**/*.fsx",
- "workspaceContains:**/*.sln"
+ "workspaceContains:**/*.{sln,slnx}"
],
"badges": [
{
diff --git a/src/Components/MSBuild.fs b/src/Components/MSBuild.fs
index 5c68504..471e915 100644
--- a/src/Components/MSBuild.fs
+++ b/src/Components/MSBuild.fs
@@ -471,7 +471,7 @@ module MSBuild =
let initWorkspace _n = Project.initWorkspace ()
- let solutionWatcher = workspace.createFileSystemWatcher (U2.Case1 "**/*.sln")
+ let solutionWatcher = workspace.createFileSystemWatcher (U2.Case1 "**/*.{sln,slnx}")
solutionWatcher.onDidCreate.Invoke(fun n -> unlessIgnored n.fsPath initWorkspace |> unbox)
|> ignore
diff --git a/src/Core/Project.fs b/src/Core/Project.fs
index c9c2e3a..b85be4c 100644
--- a/src/Core/Project.fs
+++ b/src/Core/Project.fs
@@ -319,8 +319,9 @@ module Project =
let private parse (value: string) =
let fullPath = node.path.resolve (workspace.rootPath.Value, value)
+ let lowerValue = value.ToLowerInvariant()
- if value.ToLowerInvariant().EndsWith(".sln") then
+ if lowerValue.EndsWith(".sln") || lowerValue.EndsWith(".slnx") then
ConfiguredWorkspace.Solution fullPath
else
ConfiguredWorkspace.Directory fullPath
Describe the bug
FSharp.workspacePathcurrently treats only.slnfiles as solution files.If
FSharp.workspacePathis set to a.slnxpath, Ionide does not load it as a solution workspace. It falls through to the directory path branch instead, so the configured workspace is ignored or misinterpreted.There are also a couple of related
.sln-only code paths:workspaceContains:**/*.sln**/*.slnSteps to reproduce
.slnxsolution files:p2.slnxpath and falls back to general workspace discovery / solution selection behavior instead.Expected behaviour
Ionide should treat
.slnxthe same way it treats.slnfor:FSharp.workspacePathparsingMachine infos
Minimal patch