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
feat: implement unified .gitignore/.rooignore handling for code indexing
- Enhanced RooIgnoreController to support .gitignore fallback when .rooignore is missing/empty
- Added priority system: .rooignore → .gitignore → default patterns
- Removed dual filtering that caused conflicts between ignore systems
- Updated DirectoryScanner and FileWatcher to use unified ignore controller
- Fixed service factory to remove redundant ignore instance parameter
- Updated tests to reflect new constructor signatures
Fixes#5655
* Get formatted instructions about the ignore patterns for the LLM
273
+
* @returns Formatted instructions or undefined if no patterns are active
193
274
*/
194
275
getInstructions(): string|undefined{
195
-
if(!this.rooIgnoreContent){
196
-
returnundefined
197
-
}
276
+
switch(this.currentIgnoreSource){
277
+
case"rooignore":
278
+
return`# .rooignore\n\n(The following is provided by a root-level .rooignore file where the user has specified files and directories that should not be accessed. When using list_files, you'll notice a ${LOCK_TEXT_SYMBOL} next to files that are blocked. Attempting to access the file's contents e.g. through read_file will result in an error.)\n\n${this.rooIgnoreContent}\n.rooignore`
279
+
280
+
case"gitignore":
281
+
return`# .gitignore (fallback)\n\n(The following is provided by a root-level .gitignore file being used as fallback since no .rooignore file was found or it was empty. When using list_files, you'll notice a ${LOCK_TEXT_SYMBOL} next to files that are blocked. Attempting to access the file's contents e.g. through read_file will result in an error.)\n\n${this.gitIgnoreContent}\n.gitignore`
198
282
199
-
return`# .rooignore\n\n(The following is provided by a root-level .rooignore file where the user has specified files and directories that should not be accessed. When using list_files, you'll notice a ${LOCK_TEXT_SYMBOL} next to files that are blocked. Attempting to access the file's contents e.g. through read_file will result in an error.)\n\n${this.rooIgnoreContent}\n.rooignore`
283
+
case"default":
284
+
return`# Default ignore patterns\n\n(The following default ignore patterns are being used since neither .rooignore nor .gitignore files were found. These patterns exclude common directories that are typically not needed for code analysis. When using list_files, you'll notice a ${LOCK_TEXT_SYMBOL} next to files that are blocked.)\n\nnode_modules/\nvendor/\n.git/\n.svn/\n.hg/\ndist/\nbuild/\nout/\ntarget/\n*.log\n.DS_Store\nThumbs.db`
0 commit comments