From 83c62bbc638fa2b6097bf6f50821c5e629d73192 Mon Sep 17 00:00:00 2001 From: Snarling <84951833+Snarling@users.noreply.github.com> Date: Mon, 5 Sep 2022 10:25:28 -0400 Subject: [PATCH] silent fail for tabcompletion compile error --- .../determineAllPossibilitiesForTabCompletion.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/Terminal/determineAllPossibilitiesForTabCompletion.ts b/src/Terminal/determineAllPossibilitiesForTabCompletion.ts index df32766a3..54393f894 100644 --- a/src/Terminal/determineAllPossibilitiesForTabCompletion.ts +++ b/src/Terminal/determineAllPossibilitiesForTabCompletion.ts @@ -285,8 +285,14 @@ export async function determineAllPossibilitiesForTabCompletion( return processFilepath(script.filename) === fn || script.filename === "/" + fn; }); if (!script) return; // Doesn't exist. - //Will return the already compiled module if recompilation not needed. - const loadedModule = await compile(script, currServ.scripts); + let loadedModule; + try { + //Will return the already compiled module if recompilation not needed. + loadedModule = await compile(script, currServ.scripts); + } catch (e) { + //fail silently if the script fails to compile (e.g. syntax error) + return; + } if (!loadedModule || !loadedModule.autocomplete) return; // Doesn't have an autocomplete function. const runArgs = { "--tail": Boolean, "-t": Number };