Skip to content

Conversation

@teddyOOXX
Copy link
Contributor

@teddyOOXX teddyOOXX commented Mar 17, 2025

  • Add getWorkspacePath function to centralize workspace directory path retrieval
  • Use the new workspace directory retrieval logic in Cline, Mentions, ClineProvider, and WorkspaceTracker
  • Update WorkspaceFile on tab switch and prevent redundant updates by checking prevWorkSpacePath

Context

Implementation

When using multiple workspaces, I am currently working with files from the second workspace, but the @context plugin only shows me the directories from the first workspace.

Screenshots

image

before after
image
image
image

|

How to Test

Create a multi-workspace project, add files from several different projects into the tabs in VSCode, and observe the behavior of @add Folder and Add File.

Get in Touch


Important

Add support for multiple workspaces by centralizing workspace path retrieval and updating core components to use this logic.

  • Behavior:
    • Introduces getWorkspacePath function in path.ts to centralize workspace path retrieval.
    • Updates Cline, Mentions, ClineProvider, and WorkspaceTracker to use getWorkspacePath for workspace path management.
    • Prevents redundant updates in WorkspaceTracker by checking prevWorkSpacePath on tab switch.
  • Testing:
    • Adds tests for getWorkspacePath in path.test.ts to verify correct path retrieval.
    • Updates WorkspaceTracker.test.ts to ensure correct handling of file events and workspace updates.
  • Misc:
    • Minor logging changes in WorkspaceTracker.ts.

This description was created by Ellipsis for 4d66821160e66ecfa4d04fe0076baa3e3f81798a. It will automatically update as commits are pushed.

@changeset-bot
Copy link

changeset-bot bot commented Mar 17, 2025

🦋 Changeset detected

Latest commit: 9a36882

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
roo-cline Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. enhancement New feature or request labels Mar 17, 2025
@mrubens
Copy link
Collaborator

mrubens commented Mar 17, 2025

Nice, this seems like a good idea! Any idea about the failing test?

@hannesrudolph hannesrudolph moved this from New to PR [Pre Approval Review] in Roo Code Roadmap Mar 17, 2025
@teddyOOXX teddyOOXX force-pushed the fix/support-muilt-workspace branch from ee5972b to 05f0bf6 Compare March 18, 2025 02:59
@teddyOOXX
Copy link
Contributor Author

teddyOOXX commented Mar 18, 2025

@mrubens It seems that the new methods were not mocked. I have now completed the mock methods, and these failing tests have been addressed

- Add getWorkspacePath function to centralize workspace directory path retrieval
- Use the new workspace directory retrieval logic in Cline, Mentions, ClineProvider, and WorkspaceTracker
- Update WorkspaceFile on tab switch and prevent redundant updates by checking prevWorkSpacePath
- Fix the bug that loads the contents of the previous tab when quickly switching tabs
- Optimize getWorkspacePath return value for better reliability
@teddyOOXX teddyOOXX force-pushed the fix/support-muilt-workspace branch from 673d0bb to 9a36882 Compare March 18, 2025 05:16
Copy link
Collaborator

@mrubens mrubens left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Mar 18, 2025
@mrubens mrubens merged commit 23af4c2 into RooCodeInc:main Mar 18, 2025
12 checks passed
@github-project-automation github-project-automation bot moved this from PR [Pre Approval Review] to Done in Roo Code Roadmap Mar 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request lgtm This PR has been approved by a maintainer size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants