From 3bc23ede3625670ab81860bba9790c567dce37bb Mon Sep 17 00:00:00 2001 From: Nate Date: Fri, 13 Dec 2024 08:17:13 -0800 Subject: [PATCH] don't autocomplete in empty, untitled files --- core/autocomplete/prefiltering/index.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/core/autocomplete/prefiltering/index.ts b/core/autocomplete/prefiltering/index.ts index 40ffa5384..a9c198a51 100644 --- a/core/autocomplete/prefiltering/index.ts +++ b/core/autocomplete/prefiltering/index.ts @@ -70,6 +70,14 @@ export async function shouldPrefilter( return true; } + // Don't offer completions when we have no information (untitled file and no file contents) + if ( + helper.filepath.includes("Untitled") && + helper.fileContents.trim() === "" + ) { + return true; + } + // if ( // helper.options.transform && // (await shouldLanguageSpecificPrefilter(helper))