fix(completion): preserve whitespace SQL contexts

This commit is contained in:
t8y2 2026-06-04 00:09:48 +08:00
parent b40c71f392
commit 4964bb697d
1 changed files with 1 additions and 0 deletions

View File

@ -1292,6 +1292,7 @@ export function getSqlCompletionContext(sql: string, cursor: number): SqlComplet
}
function parseTrailingIdentifierContext(input: string): { start: number; prefix: string; qualifier?: string } | null {
if (/\s$/.test(input)) return null;
let i = input.length - 1;
while (i >= 0 && /\s/.test(input[i] ?? "")) i--;
if (i < 0) return null;