[Repo Assist] Fix FSharp.workspacePath resolution in multi-folder workspaces#2154
Draft
github-actions[bot] wants to merge 2 commits intomainfrom
Draft
Conversation
When a user configures FSharp.workspacePath with a relative path in a multi-folder workspace, Ionide was resolving it against workspace.rootPath (the first workspace folder). If the F# project lives in a different folder, the resolved path would not exist and the setting would be silently ignored. Fix: collect all workspace folder paths as candidates and try each one in order until we find an existing path. Falls back to rootPath-only behaviour for single-folder workspaces (no behaviour change). Closes #1976 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
39 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🤖 This PR was created by Repo Assist, an automated AI assistant.
Closes #1976
Root Cause
When a user sets
FSharp.workspacePathto a relative path (e.g."backend/App.sln") in a multi-folder VS Code workspace, Ionide resolved the path exclusively againstworkspace.rootPath— which is always the first workspace folder. If the F# project lives in a folder that isn't first in the list, the resolved path does not exist, Ionide silently ignores the setting, and no solution/directory is loaded.Additionally,
workspace.rootPath.Valuewould crash with a null-reference exception when no workspace folder is open at all.Minimal repro: workspace with folders
["client", "dotnet"]andFSharp.workspacePath = "dotnet/App.sln"→ resolved as(client-path)/dotnet/App.sln(wrong folder) → path does not exist → ignored.Fix
parse→parseWithBaseto accept an explicit base path rather than implicitly readingworkspace.rootPath.Value.candidateBasePaths()which returnsrootPath :: workspaceFolders(deduped) — all possible base paths in the workspace.parseAndValidate, try each candidate path in order, returning the first one that physically exists on disk. If none exist, warn and returnNone(same as before).Behaviour Changes
rootPath = None)Trade-offs
statsyscalls at startup/configuration-change time only)."src/App.sln", the one inrootPath/first folder wins (consistent with existing priority ordering).Test Status
Fable compilation: ✅ No errors (
dotnet fable src --noCache— 0error FSHARPlines, only pre-existing deprecation warnings unrelated to this change).No existing automated test suite covers this integration path (workspace configuration resolution uses VS Code's live API, not unit-testable in isolation).