diff options
Diffstat (limited to 'packages/core/src/config/config.ts')
| -rw-r--r-- | packages/core/src/config/config.ts | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/packages/core/src/config/config.ts b/packages/core/src/config/config.ts index f81b3e32..9528f648 100644 --- a/packages/core/src/config/config.ts +++ b/packages/core/src/config/config.ts @@ -76,7 +76,20 @@ export interface GeminiCLIExtension { version: string; isActive: boolean; } - +export interface FileFilteringOptions { + respectGitIgnore: boolean; + respectGeminiIgnore: boolean; +} +// For memory files +export const DEFAULT_MEMORY_FILE_FILTERING_OPTIONS: FileFilteringOptions = { + respectGitIgnore: false, + respectGeminiIgnore: true, +}; +// For all other files +export const DEFAULT_FILE_FILTERING_OPTIONS: FileFilteringOptions = { + respectGitIgnore: true, + respectGeminiIgnore: true, +}; export class MCPServerConfig { constructor( // For stdio transport @@ -137,6 +150,7 @@ export interface ConfigParameters { usageStatisticsEnabled?: boolean; fileFiltering?: { respectGitIgnore?: boolean; + respectGeminiIgnore?: boolean; enableRecursiveFileSearch?: boolean; }; checkpointing?: boolean; @@ -182,6 +196,7 @@ export class Config { private geminiClient!: GeminiClient; private readonly fileFiltering: { respectGitIgnore: boolean; + respectGeminiIgnore: boolean; enableRecursiveFileSearch: boolean; }; private fileDiscoveryService: FileDiscoveryService | null = null; @@ -239,6 +254,7 @@ export class Config { this.fileFiltering = { respectGitIgnore: params.fileFiltering?.respectGitIgnore ?? true, + respectGeminiIgnore: params.fileFiltering?.respectGeminiIgnore ?? true, enableRecursiveFileSearch: params.fileFiltering?.enableRecursiveFileSearch ?? true, }; @@ -473,6 +489,16 @@ export class Config { getFileFilteringRespectGitIgnore(): boolean { return this.fileFiltering.respectGitIgnore; } + getFileFilteringRespectGeminiIgnore(): boolean { + return this.fileFiltering.respectGeminiIgnore; + } + + getFileFilteringOptions(): FileFilteringOptions { + return { + respectGitIgnore: this.fileFiltering.respectGitIgnore, + respectGeminiIgnore: this.fileFiltering.respectGeminiIgnore, + }; + } getCheckpointingEnabled(): boolean { return this.checkpointing; @@ -549,6 +575,7 @@ export class Config { this.getDebugMode(), this.getFileService(), this.getExtensionContextFilePaths(), + this.getFileFilteringOptions(), ); this.setUserMemory(memoryContent); |
