summaryrefslogtreecommitdiff
path: root/packages/core/src/config/config.ts
diff options
context:
space:
mode:
authorPyush Sinha <[email protected]>2025-07-20 00:55:33 -0700
committerGitHub <[email protected]>2025-07-20 07:55:33 +0000
commita01b1219a3e814c370f6827b81c9118f2cbc7a64 (patch)
treeb4b406518a04f3cc4fc054b3b86612bf9b1ade51 /packages/core/src/config/config.ts
parent76b935d598b895240b9bc2b182eb9f1e1b24be0d (diff)
feat: full implementation for .geminiignore in settings and respective tool calls (#3727)
Diffstat (limited to 'packages/core/src/config/config.ts')
-rw-r--r--packages/core/src/config/config.ts29
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);