Skip to content

Commit 800e51c

Browse files
committed
hotfix: suggest the wrong enum values
1 parent 56868a2 commit 800e51c

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

src/renderer/components/CodeEditor/handleCustomSqlAutoComplete.ts

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -66,22 +66,13 @@ function handleEnumAutoComplete(
6666

6767
// Let search for identifer
6868
const identifier = searchForIdentifier(context, currentNode.prevSibling);
69-
console.log(identifier);
70-
7169
if (!identifier) return null;
7270

7371
const [table, column] = identifier.replaceAll('`', '').split('.');
7472
if (!table) return null;
7573

7674
const enumValues = enumSchema.find((tempEnum) => {
77-
if (column) {
78-
// normally column will be enum
79-
return tempEnum.column === column;
80-
} else {
81-
// when column is a keyword, the node will be counted as 2
82-
// so there will be no column, the enum will be in table variable instead
83-
return tempEnum.column === table;
84-
}
75+
return tempEnum.column === column && table === tempEnum.table;
8576
})?.values;
8677

8778
if (!enumValues) return null;

0 commit comments

Comments
 (0)