When I use Add Folder to Workspace, codebase indexing is triggered repeatedly

Let’s assume my project structure is as follows:

root/
root/fold1/
root/fold1/■■■/fold1_1/
root/fold1/■■■/fold1_2/

Because fold1 contains useful memory.md files that guide the work within fold1_1, I need to keep fold1 accessible in my workspace, rather than just opening fold1_1 directly. Additionally, I need to primarily focus my work within fold1_1 (which represents a specific experiment folder).

To achieve this, I have set up a VS Code multi-root workspace where I’ve added both fold1 and fold1_1 as separate root folders.

The problem is that now, the codebase indexing feature indexes the contents of fold1_1 twice: once as a subdirectory scanned under the fold1 root, and again as its own separate fold1_1 root added to the workspace. This duplicate indexing is causing a severe performance loss.

Codebase indexing should first verify deduplication of file paths and then perform indexing.

If you index root first and then add fold1_1 to the working area, the indexing will be very fast and will not trigger duplicate indexing. After fold1_1 is added to the working area, if you delete the index and perform indexing again, the indexing will be very slow at this time.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.