fix(editor): suppress completion after punctuation

This commit is contained in:
t8y2
2026-05-15 14:56:26 +08:00
parent b06ab4f27f
commit 1563173173
3 changed files with 34 additions and 3 deletions
+6
View File
@@ -333,6 +333,12 @@ export function buildSqlCompletionItemsFromContext(
return dedupeAndSort(items);
}
export function shouldAutoOpenSqlCompletion(sql: string, cursor: number): boolean {
const previousChar = sql[cursor - 1];
if (!previousChar) return false;
return /[\w$.]/.test(previousChar);
}
/**
* Find the start position of the SQL statement containing the cursor.
* Respects semicolons and string literals.