fix(completion): rank CREATE OR REPLACE keyword over REPLACE function

This commit is contained in:
zipg authored and GitHub committed 2026-10-02 00:43:08 +08:00
1 parent ff926cc61b
commit 4ed3662da2
5 files changed
+31

No files matched your search

@@ -3213,6 +3213,9 @@ function preferredKeywordsForCompletion(
databaseType: DatabaseType | undefined,
): string[] {
const keywords: string[] = [];
if (databaseType !== "sqlserver" && databaseType !== "sqlite" && /^create\s+or$/i.test(maskSqlLiteralsAndComments(beforeToken, databaseType).trim())) {
keywords.push("REPLACE");
}
if (selectListColumnContext && hasSelectListExpression(beforeCursor, databaseType)) keywords.push("FROM");
if (isAfterJoinModifierContext(beforeCursor, databaseType)) keywords.push("JOIN");
if (!exclusiveTableSuggestions && isAfterSelectBodyExpression(beforeToken, databaseType)) keywords.push("LIMIT");