fix: fix preprocessor not displaying immediately on addition

This commit is contained in:
Ruben Fiszel
2025-08-29 06:57:01 +00:00
parent 7e3a40a356
commit e09af3c2f1
2 changed files with 9 additions and 7 deletions

View File

@@ -544,9 +544,7 @@
let sqlSchemaCompletor: IDisposable | undefined = undefined
async function updateSchema() {
const newSchemaRes = lang === 'graphql' ? args?.api : args?.database
async function updateSchema(newSchemaRes: string | undefined) {
if (typeof newSchemaRes === 'string') {
const resourcePath = newSchemaRes.replace('$res:', '')
dbSchema = $dbSchemas[resourcePath]
@@ -1621,10 +1619,14 @@
? untrack(() => addSqlTypeCompletions())
: sqlTypeCompletor?.dispose()
})
let lastArg = undefined
$effect(() => {
console.log('updating schema', lang, $dbSchemas)
readFieldsRecursively(args)
lang && $dbSchemas && untrack(() => updateSchema())
let newArg = lang === 'graphql' ? args?.api : args?.database
if (newArg !== lastArg) {
lastArg = newArg
$dbSchemas && untrack(() => updateSchema(newArg))
}
})
$effect(() => {
console.log('updating db schema completions', dbSchema, lang)

View File

@@ -487,7 +487,7 @@
additionalAssetsMap: flowGraphAssetsCtx?.val.additionalAssetsMap
},
untrack(() => failureModule),
untrack(() => preprocessorModule),
preprocessorModule,
eventHandler,
success,
$useDataflow,