🐛 don't try to calculate AST in non-code files
This commit is contained in:
parent
c9f53d7c76
commit
8187e0d39a
2 changed files with 5 additions and 1 deletions
|
|
@ -80,7 +80,7 @@ async function shouldCompleteMultiline(
|
|||
try {
|
||||
const ast = await getAst(filepath, fullPrefix + fullSuffix);
|
||||
if (!ast) {
|
||||
throw new Error(`AST undefined for ${filepath}`);
|
||||
return true;
|
||||
}
|
||||
|
||||
treePath = await getTreePathAtCursor(ast, fullPrefix.length);
|
||||
|
|
|
|||
|
|
@ -243,4 +243,8 @@ export async function* stopAtRepeatingLines(lines: LineStream): LineStream {
|
|||
return;
|
||||
}
|
||||
}
|
||||
|
||||
while (repeatedLines.length > 0) {
|
||||
yield repeatedLines.shift()!;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue