Skip to content

Conversation

@roomote
Copy link
Contributor

@roomote roomote bot commented Jul 25, 2025

This PR fixes the issue where the codebase index feature only works for the first folder in a multi-folder workspace. The index now updates dynamically based on the currently active workspace folder.

Changes:

  • Updated CodeIndexManager.getInstance() to use the active workspace folder instead of always using the first folder
  • Added handleWorkspaceFolderChange() method to ClineProvider to re-initialize the code index when the workspace changes
  • Integrated workspace change detection in WorkspaceTracker to trigger code index updates
  • Updated tests to support the new dynamic workspace folder detection

Testing:

  • All existing tests pass
  • The code index now correctly updates when switching between folders in a multi-folder workspace
  • Type checking and linting pass without issues

Fixes #6197


Important

Fixes codebase indexing in multi-folder workspaces by updating the index based on the active folder.

  • Behavior:
    • CodeIndexManager.getInstance() now uses the active workspace folder instead of the first folder.
    • ClineProvider.handleWorkspaceFolderChange() added to re-initialize code index on workspace change.
    • WorkspaceTracker triggers code index updates on workspace changes.
  • Testing:
    • Updated tests in WorkspaceTracker.spec.ts and manager.spec.ts to support dynamic workspace folder detection.
    • Verified code index updates correctly when switching folders in a multi-folder workspace.
  • Misc:

This description was created by Ellipsis for 900af52. You can customize this summary. It will automatically update as commits are pushed.

- Update CodeIndexManager.getInstance() to use active workspace folder instead of always using first folder
- Add handleWorkspaceFolderChange() method to ClineProvider to re-initialize code index when workspace changes
- Integrate workspace change detection in WorkspaceTracker to trigger code index updates
- This ensures codebase index corresponds to the currently active workspace folder

Fixes #6197
@roomote roomote bot requested review from cte, jr and mrubens as code owners July 25, 2025 03:36
@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. bug Something isn't working labels Jul 25, 2025
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. and removed size:M This PR changes 30-99 lines, ignoring generated files. labels Jul 25, 2025
@hannesrudolph hannesrudolph added the Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. label Jul 25, 2025
@daniel-lxs
Copy link
Member

This will probably cause indexing to be stuck in an indexing state since workspaces might change frequently

@daniel-lxs daniel-lxs closed this Jul 28, 2025
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Jul 28, 2025
@github-project-automation github-project-automation bot moved this from Triage to Done in Roo Code Roadmap Jul 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. size:L This PR changes 100-499 lines, ignoring generated files.

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

codebase not support multiple-folder workspace

4 participants