fix(completion): stop appending space before statement terminators
This commit is contained in:
4 files changed
+11
-1
No files matched your search
@@ -1,6 +1,9 @@
|
||||
export type SqlCompletionItemType = "keyword" | "table" | "column" | "snippet" | "function" | "schema" | "variable" | "property" | "text";
|
||||
|
||||
const COMPLETION_SPACE_BLOCKING_CHARACTERS = new Set([",", ";", ":", ")", "]", "}", "'", '"']);
|
||||
// `;` is deliberately absent: a statement terminator is never glued to the token
|
||||
// in front of it, and accepting `BETWEEN` before an existing `;` used to insert
|
||||
// `BETWEEN;`, leaving the user no way to keep typing the operand.
|
||||
const COMPLETION_SPACE_BLOCKING_CHARACTERS = new Set([",", ":", ")", "]", "}", "'", '"']);
|
||||
|
||||
export function appendSqlCompletionSpace(insertText: string, options: { enabled: boolean; itemType: SqlCompletionItemType; nextCharacter?: string }): string {
|
||||
if (!options.enabled || options.itemType === "property" || options.itemType === "text" || options.itemType === "schema" || options.itemType === "variable" || options.itemType === "snippet" || options.itemType === "function") return insertText;
|
||||
|
||||
Reference in new issue
Block a user