🥅 catch parser failure when indexing codebase

This commit is contained in:
Nate Sesti 2024-03-09 20:30:10 -08:00
parent f6633fd157
commit 6391d243b0

View file

@ -70,6 +70,9 @@ export class CodeSnippetsCodebaseIndex implements CodebaseIndex {
return [];
}
const parser = await getParserForFile(filepath);
if (!parser) {
return [];
}
const ast = parser.parse(contents);
const query = lang?.query(this.getQuerySource(filepath));
const matches = query?.matches(ast.rootNode);