You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The .rooignore file was not properly excluding files in nested project folders. For example, when a user had:
6
+
7
+
```
8
+
Root Folder/
9
+
├── .rooignore (contains "example-nextjs/.next/")
10
+
└── example-nextjs/
11
+
└── .next/ (should be ignored but wasn't)
12
+
```
13
+
14
+
The .next folder was still being indexed despite being listed in the .rooignore file.
15
+
16
+
## Root Cause
17
+
18
+
The DirectoryScanner was creating a new RooIgnoreController with the directory being scanned as the working directory, instead of using the workspace root. This meant the .rooignore file was being looked for in the wrong location.
19
+
20
+
## Solution
21
+
22
+
- Modified DirectoryScanner to accept an optional workspaceRoot parameter
23
+
- Updated the scanner to use the workspace root (instead of scan directory) for the RooIgnoreController
24
+
- Updated CodeIndexServiceFactory to pass the workspace path to the scanner
25
+
- Added fallback behavior for backward compatibility
26
+
27
+
## Changes
28
+
29
+
- src/services/code-index/processors/scanner.ts: Added workspaceRoot parameter and updated RooIgnoreController initialization
30
+
- src/services/code-index/service-factory.ts: Pass workspacePath to DirectoryScanner constructor
31
+
- src/services/code-index/processors/**tests**/scanner.spec.ts: Updated test to include new parameter
32
+
33
+
## Testing
34
+
35
+
- Existing tests continue to pass
36
+
- The fix ensures .rooignore files in the workspace root properly filter files in nested directories
37
+
- Backward compatibility maintained with fallback to scan directory if no workspace root provided
0 commit comments