From de2442e0fc462066f393ba6089bac0b8adbced32 Mon Sep 17 00:00:00 2001 From: Nate Sesti Date: Sat, 16 Mar 2024 01:32:48 -0700 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20catch=20parsing=20errors=20for?= =?UTF-8?q?=20unsupported=20languages?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/autocomplete/ast.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/core/autocomplete/ast.ts b/core/autocomplete/ast.ts index 30ac77a99..b87539aa5 100644 --- a/core/autocomplete/ast.ts +++ b/core/autocomplete/ast.ts @@ -12,8 +12,12 @@ export async function getAst( return undefined; } - const ast = parser.parse(fileContents); - return ast; + try { + const ast = parser.parse(fileContents); + return ast; + } catch (e) { + return undefined; + } } export async function getTreePathAtCursor(