fix: db schema autocomplete (#2809)

This commit is contained in:
HugoCasa
2023-12-08 00:13:34 +01:00
committed by GitHub
parent 0098c22074
commit 81abec453e
+3 -9
View File
@@ -241,19 +241,13 @@
let sqlSchemaCompletor: Disposable | undefined = undefined
let oldSchemaRes = ''
function updateSchema() {
const newSchemaRes = lang === 'graphql' ? args?.api : args?.database
if (typeof newSchemaRes === 'string') {
const newSchema = $dbSchemas[newSchemaRes.replace('$res:', '')]
if (newSchema && newSchemaRes !== oldSchemaRes) {
oldSchemaRes = newSchemaRes
dbSchema = newSchema
return
}
dbSchema = $dbSchemas[newSchemaRes.replace('$res:', '')]
} else {
dbSchema = undefined
}
dbSchema = undefined
oldSchemaRes = ''
}
$: lang && args && $dbSchemas && updateSchema()