File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed
extensions/cli/src/services Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ import { fdir } from "fdir";
22import { AsyncFzf , FzfResultItem } from "fzf" ;
33
44import { FILE_IGNORE_PATTERNS } from "../util/filePatterns.js" ;
5+ import { isGitRepo } from "../util/git.js" ;
56import { logger } from "../util/logger.js" ;
67
78import { BaseService } from "./BaseService.js" ;
@@ -131,10 +132,15 @@ export class FileIndexService extends BaseService<FileIndexServiceState> {
131132 const currentDir = process . cwd ( ) ;
132133 logger . debug ( `Starting file index in directory: ${ currentDir } ` ) ;
133134
135+ // Determine max depth based on git repository status
136+ const inGitRepo = isGitRepo ( ) ;
137+ const maxDepth = inGitRepo ? 10 : 3 ;
138+
134139 // Create file indexing promise
135140 const fileIndexPromise = new fdir ( )
136141 . withFullPaths ( )
137142 . withRelativePaths ( )
143+ . withMaxDepth ( maxDepth )
138144 . filter ( ( path ) => {
139145 // Use the helper function that implements original FILE_PATTERNS logic
140146 return this . shouldIncludeFile ( path ) ;
You can’t perform that action at this time.
0 commit comments