[Repo Assist] Fix: show relative paths in 'Add project to solution' picker#2141
Draft
github-actions[bot] wants to merge 2 commits into
Draft
[Repo Assist] Fix: show relative paths in 'Add project to solution' picker#2141github-actions[bot] wants to merge 2 commits into
github-actions[bot] wants to merge 2 commits into
Conversation
…1965) Replace raw full paths in the QuickPick for fsharp.explorer.solution.addProject with workspace-relative paths. The full path is preserved as the description so the dotnet sln add command still receives it correctly. - Strip workspace root prefix from each project path before display - Store full path in QuickPickItem.description for reliable dotnet sln add - Fall back to full path if project is outside the workspace root Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
46 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.
Summary
Closes #1965
When using Add project to solution from the F# Solution Explorer context menu, the quick-pick list shows full absolute paths for all discoverable projects. On large monorepos or deeply-nested solutions this makes it impossible to distinguish which project is which at a glance.
Root Cause
fsharp.explorer.solution.addProjectcallsProject.getAll()(which returns full absolute paths), converts them to a plainResizeArray(string), and passes that directly towindow.showQuickPick. VS Code displays these strings verbatim as the quick-pick labels.Fix
Replace the plain string list with
QuickPickItemobjects where:label= workspace-relative path (e.g.src/MyLib/MyLib.fsprojinstead of/home/user/repos/MyApp/src/MyLib/MyLib.fsproj)description= full absolute path (still shown as secondary text, and used as the argument todotnet sln add)The stripping logic normalises path separators and strips the workspace root prefix. If a project lives outside the workspace root (unusual but possible), the full path is shown unchanged.
Trade-offs
dotnet sln addstill receives the full absolute path viaproj.description.Test Status
yarn installis unavailable in this environment due to network restrictions, so a full Fable build cannot be run.The change is type-correct:
createEmpty(QuickPickItem)/.label/.descriptionfollow the same pattern used in the template-picker code (lines 857–860 ofSolutionExplorer.fs). TheU2.Case1wrapper forResizeArray(QuickPickItem)mirrors line 867.