fix: filter out empty nodes on the ast (#17517)
parent
0e4289c595
commit
91d632ea5c
|
@ -200,9 +200,10 @@ export class LSPServer {
|
|||
|
||||
// NOTE: we use the AST intermediate format as a means of reducing
|
||||
// drift between the parser and the internal representation
|
||||
const variables = getAllVariables(state, contextID).map(v =>
|
||||
asAssignment(v)
|
||||
)
|
||||
const variables = getAllVariables(state, contextID)
|
||||
.map(v => asAssignment(v))
|
||||
.filter(v => !(v.init.type === 'StringLiteral' && !v.init.value))
|
||||
|
||||
const file = buildVarsOption(variables)
|
||||
|
||||
const parts = uri.split('/')
|
||||
|
|
|
@ -47,6 +47,14 @@ function shouldShowTooltip(variable: Variable): boolean {
|
|||
return false
|
||||
}
|
||||
|
||||
if (
|
||||
variable.arguments.type === 'query' &&
|
||||
(!(variable.arguments.values as any).results ||
|
||||
(variable.arguments.values as any).results.length <= 1)
|
||||
) {
|
||||
return false
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue