mirror of
https://github.com/t8y2/dbx.git
synced 2026-11-01 16:28:46 +00:00
fix(editor): suppress completion after punctuation
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user