Skip to content

Commit cd2e1c4

Browse files
committed
Add PR description file
1 parent ff5dcd9 commit cd2e1c4

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

pr_description.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
Fixes #4647
2+
3+
## Problem
4+
5+
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

Comments
 (0)