-
Notifications
You must be signed in to change notification settings - Fork 6.9k
Setup Raw Structure for implementing multi-workspace support with WorkspaceRoot #5849
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Setup Raw Structure for implementing multi-workspace support with WorkspaceRoot #5849
Conversation
🦋 Changeset detectedLatest commit: c4b7a62 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
Coverage ReportExtension CoverageBase branch: 47% PR branch: 48% ✅ Coverage increased or remained the same Webview CoverageBase branch: 18% PR branch: 18% ✅ Coverage increased or remained the same Overall Assessment✅ Test coverage has been maintained or improved Last updated: 2025-09-02T23:07:04.589919 |
1b2156d
to
3ec4a86
Compare
4bf5a24
to
2495ade
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR establishes the foundational infrastructure for multi-workspace support in Cline by introducing WorkspaceRootManager
and WorkspaceResolver
classes. The implementation follows a phased migration strategy, with this Phase 0 focusing on infrastructure setup and backward compatibility while tracking single-root path operations for future migration planning.
Key changes include:
- WorkspaceRootManager: Central manager for multi-workspace operations with VCS detection and backward compatibility
- WorkspaceResolver: Path resolution tracer that wraps existing
path.resolve
andpath.basename
calls across 52+ files - Migration tracking: Telemetry system to identify single-root assumptions in the codebase
Reviewed Changes
Copilot reviewed 38 out of 38 changed files in this pull request and generated 3 comments.
Show a summary per file
File | Description |
---|---|
src/core/workspace/ | New core workspace module with WorkspaceRootManager, WorkspaceRoot types, and WorkspaceResolver tracer |
src/utils/*.ts | Updated path utilities to use WorkspaceResolver for migration tracking |
src/services/ | Updated ripgrep, glob, and browser services to use workspace path resolution |
src/integrations/ | Updated file processing, checkpoints, and editor integrations with workspace-aware path handling |
src/core/task/tools/handlers/ | Updated all tool handlers to use workspace path resolution instead of direct path.resolve calls |
src/core/controller/ | Updated controller methods to use workspace-aware path resolution for task and file operations |
Comments suppressed due to low confidence (1)
src/core/controller/file/toggleClineRule.ts:1
- Duplicate telemetry calls detected. The same telemetry event is being captured twice with identical parameters. Remove the first occurrence (lines 36-37) as it's redundant.
import { getWorkspaceBasename } from "@core/workspace"
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
300dda7
to
64b00a6
Compare
64b00a6
to
695995c
Compare
bdb08fe
to
f20ad9e
Compare
f20ad9e
to
b47d720
Compare
b47d720
to
b49a47b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello @arafatkatze! Thanks so much for this, great work 🎉 I left a few comments for you to take a look at. Please note that I might be missing some context on how things usually work here, so I’ve approached the review as I normally would. I’ll defer my formal approval to @abeatrix and @canvrno. Thanks again!
a420771
to
351ba29
Compare
943b7d0
to
d7f9420
Compare
@JicLotus Thanks a lot for such a detailed review, I have added tests and made the code much more modular than before. |
d7f9420
to
8b35940
Compare
Description
This PR lays the groundwork for Multi-Workspace Folder Support in Cline, addressing the need for enterprise users and modern development workflows to work across multiple repositories simultaneously.
Problem Solved
Currently, Cline is limited to a single root directory (
cwd
), which prevents users from:What This PR Introduces
Phase 0 Implementation - Infrastructure and Migration Preparation:
WorkspaceRootManager Class (
src/core/workspace/WorkspaceRootManager.ts
)fromLegacyCwd()
methodWorkspaceResolver Tracer Functions (
src/core/workspace/WorkspaceResolver.ts
)Technical Approach
The implementation follows a phased migration strategy:
cwd
→workspaceRoots[]
)This approach ensures backward compatibility while gradually introducing multi-workspace capabilities.
Test Procedure
Testing Approach
Backward Compatibility Testing
WorkspaceRootManager.fromLegacyCwd()
conversionWorkspaceRootManager Testing
Integration Points Verified
What Could Break & Verification
Confidence Level
This PR is ready for merge because:
Type of Change
Pre-flight Checklist
npm test
) and code is formatted and linted (npm run format && npm run lint
)npm run changeset
(required for user-facing changes)Screenshots
Migration Report Output Example
WorkspaceRootManager API
Additional Notes
Important Notes for Reviewers:
This is Phase 0 of a larger feature - This PR sets up the infrastructure without changing existing behavior. The actual multi-workspace functionality will come in subsequent PRs (Phases 1-5).
Performance Considerations - The tracer functions add minimal overhead (<1ms) and can be disabled via environment variable if needed.
Migration Strategy - The phased approach allows for gradual rollout with ability to pause/rollback at any phase if issues arise.
Enterprise Focus - This feature primarily benefits enterprise users with multi-repository workflows, but maintains full backward compatibility for single-root users.
Next Steps After Merge:
Questions for Maintainers:
Related Documentation:
Important
Introduces foundational structure for multi-workspace support in Cline, including
WorkspaceRootManager
,WorkspaceResolver
, and telemetry for migration planning.WorkspaceRootManager
inWorkspaceRootManager.ts
for managing multi-workspace operations, including root resolution and VCS detection.WorkspaceResolver
inWorkspaceResolver.ts
for path resolution with migration tracing, supporting both single and multi-root modes.WorkspaceResolver.ts
to track path usage across 52+ files for migration planning.MigrationReporter
inMigrationReporter.ts
for generating migration reports from usage statistics.getWorkspaceBasename()
andresolveWorkspacePath()
functions for path operations with context tracking.WorkspaceResolver.test.ts
to ensure correct path resolution and usage tracking behavior.path
module usage withworkspaceResolver
in multiple files for path operations, ensuring compatibility with the new multi-workspace structure.This description was created by
for c4b7a62. You can customize this summary. It will automatically update as commits are pushed.