fix(code-index): align .rooignore filtering roots

This commit is contained in:
Hannes Rudolph 2025-12-30 09:13:07 -07:00
parent 2eec91087f
commit 90f010f59b
2 changed files with 4 additions and 2 deletions

View file

@ -525,7 +525,7 @@ export class FileWatcher implements IFileWatcher {
// Check if file should be ignored
const relativeFilePath = generateRelativeFilePath(filePath, this.workspacePath)
if (
!this.ignoreController.validateAccess(filePath) ||
!this.ignoreController.validateAccess(relativeFilePath) ||
(this.ignoreInstance && this.ignoreInstance.ignores(relativeFilePath))
) {
return {

View file

@ -86,7 +86,9 @@ export class DirectoryScanner implements IDirectoryScanner {
// IMPORTANT: do not create a file watcher here (scan is short-lived).
let allowedPaths: string[]
{
const ignoreController = new RooIgnoreController(directoryPath, { watch: false })
// Root the controller at the effective workspace to ensure `.rooignore` checks
// are consistent with other workspace-relative filtering.
const ignoreController = new RooIgnoreController(scanWorkspace, { watch: false })
try {
await ignoreController.initialize()
// Filter paths using .rooignore