feat(search): Add option to disable fuzzy search (#6510)

Co-authored-by: Jacob Richman <jacob314@gmail.com>
Co-authored-by: Arya Gummadi <aryagummadi@google.com>
This commit is contained in:
Bryant Chandler
2025-08-21 23:31:39 -07:00
committed by GitHub
parent ef46d64ae5
commit 4ced997d63
7 changed files with 114 additions and 2 deletions

View File

@@ -274,6 +274,15 @@ export const SETTINGS_SCHEMA = {
description: 'Enable recursive file search functionality',
showInDialog: true,
},
disableFuzzySearch: {
type: 'boolean',
label: 'Disable Fuzzy Search',
category: 'File Filtering',
requiresRestart: true,
default: false,
description: 'Disable fuzzy search when searching for files.',
showInDialog: true,
},
},
},

View File

@@ -51,6 +51,7 @@ describe('useAtCompletion', () => {
respectGeminiIgnore: true,
})),
getEnableRecursiveFileSearch: () => true,
getFileFilteringDisableFuzzySearch: () => false,
} as unknown as Config;
vi.clearAllMocks();
});
@@ -198,6 +199,7 @@ describe('useAtCompletion', () => {
cache: false,
cacheTtl: 0,
enableRecursiveFileSearch: true,
disableFuzzySearch: false,
});
await realFileSearch.initialize();
@@ -468,6 +470,7 @@ describe('useAtCompletion', () => {
respectGitIgnore: true,
respectGeminiIgnore: true,
})),
getFileFilteringDisableFuzzySearch: () => false,
} as unknown as Config;
const { result } = renderHook(() =>

View File

@@ -172,6 +172,8 @@ export function useAtCompletion(props: UseAtCompletionProps): void {
cacheTtl: 30, // 30 seconds
enableRecursiveFileSearch:
config?.getEnableRecursiveFileSearch() ?? true,
disableFuzzySearch:
config?.getFileFilteringDisableFuzzySearch() ?? false,
});
await searcher.initialize();
fileSearch.current = searcher;