🪲 BUG-#26: Honor the active editor's folder in multi-root workspaces - #27
Merged
Conversation
currentWorkspaceFolder() always returned workspaceFolders[0], so
pycodeloop serve spawned with the first root as its cwd regardless
of which project the user was actually working in. In a multi-root
workspace, every file in a root other than the first tripped the
workspace jail ("outside the workspace") and forced the agent to
fall back to bash for something as simple as reading a file in the
open project. Now resolves the workspace folder that contains the
active editor's document first, falling back to workspaceFolders[0]
only when there's no active editor (e.g. right after the panel
opens).
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.
Closes #26
currentWorkspaceFolder()always returnedworkspaceFolders[0], sopycodeloop servespawned with the first root as its cwd regardless of which project the user was actually in. In a multi-root workspace, everything outside that first root tripped the workspace jail and the agent fell back tobashfor what should've been a plain file read.Now resolves the workspace folder containing the active editor's document first, falling back to
workspaceFolders[0]when there's no active editor.(Supersedes #25, closed when its branch got renamed to match the git-flow
feature/Nconvention.)Test plan
npm test— 50 passednpm run lintcleanvscodeAPI (same pattern aschatSidebarProvider.ts)