Add setting enableRecursiveFileSearch to control @-file completion (#1290)

This commit is contained in:
Billy Biggs
2025-06-21 18:23:35 -07:00
committed by GitHub
parent 63f6a497cb
commit 0779697da6
8 changed files with 77 additions and 13 deletions

View File

@@ -322,10 +322,16 @@ export function useCompletion(
let fetchedSuggestions: Suggestion[] = [];
const fileDiscoveryService = config ? config.getFileService() : null;
const enableRecursiveSearch =
config?.getEnableRecursiveFileSearch() ?? true;
try {
// If there's no slash, or it's the root, do a recursive search from cwd
if (partialPath.indexOf('/') === -1 && prefix) {
if (
partialPath.indexOf('/') === -1 &&
prefix &&
enableRecursiveSearch
) {
if (fileDiscoveryService) {
fetchedSuggestions = await findFilesWithGlob(
prefix,