-
Notifications
You must be signed in to change notification settings - Fork 1
[TECH-16510] Remove symlink-based project sync in multi-root mode #5
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
[TECH-16510] Remove symlink-based project sync in multi-root mode #5
Conversation
runchen0919
commented
Feb 5, 2026
- Remove syncWorkspaceRoot() function and symlink creation in home directory
- Use workspaceRoot as the first workspace folder in multi-root mode, ensuring ${workspaceFolder} resolves to the real project path
- Fix getWorkspaceRoot() to handle workspace files in .vscode directory
- Add validation for workspace root name extraction
- Remove unused fs imports and file system watcher for symlinks
- Remove syncWorkspaceRoot() function and symlink creation in home directory
- Use workspaceRoot as the first workspace folder in multi-root mode,
ensuring ${workspaceFolder} resolves to the real project path
- Fix getWorkspaceRoot() to handle workspace files in .vscode directory
- Add validation for workspace root name extraction
- Remove unused fs imports and file system watcher for symlinks
|
Multi-Root Workspace Design Analysis URL: https://compass-tech.atlassian.net/browse/TECH-16510?focusedCommentId=1096763 |
| registerBuildifierFormatter(); | ||
|
|
||
| // if this is a multi-root project, create a listener to refresh the symlinked project root directory on file add/remove | ||
| if (ProjectViewManager.isMultiRoot()) { |
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.
Why remove this? As my understanding user will never use multi-root mode, case our workspace configuration is force configured to be single-root mode. right?
maybe I missed something, could you explain more?
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.
It's not mandatory to use single-root mode. When a user opens the plugin through code-workspace, it will load in multi-root mode. Previously, it was always in single-root mode because an incorrect logic for retrieving the project root directory caused multi-root mode loading to fail, after which it started loading in single-root mode.
The logic for synchronizing files in the project root directory was removed here. The original design synchronized files under ~/development/urbancompass to ~/urbancompass, which was what the ProjectViewManager.syncWorkspaceRoot method did. However, this design conflicted with our usage guidelines. Therefore, I removed this logic and instead directly added ~/development/urbancompass to the workspace as the project root directory. Thus, the file monitoring logic can be removed.
| if (workspace.workspaceFile) { | ||
| return dirname(workspace.workspaceFile.path); | ||
| const workspaceFilePath = dirname(workspace.workspaceFile.path); | ||
| if (workspaceFilePath.endsWith('.vscode')) { |
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.
What this means? could tell me an example? Thanks!
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.
zhirui1994
left a comment
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.
LGTM
