Skip to content

Commit

Permalink
πŸ› catch parsing errors for unsupported languages
Browse files Browse the repository at this point in the history
  • Loading branch information
sestinj committed Mar 16, 2024
1 parent 640195e commit de2442e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions core/autocomplete/ast.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit de2442e

Please sign in to comment.