fix the case when there is nothing in the expr
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
This commit is contained in:
parent
87463257a7
commit
1a2a9db425
|
@ -342,7 +342,7 @@ export function analyzeCompletion(state: EditorState, node: SyntaxNode): Context
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case PromQL:
|
case PromQL:
|
||||||
if (!node.firstChild) {
|
if (node.firstChild !== null && node.firstChild.type.id === 0) {
|
||||||
// this situation can happen when there is nothing in the text area and the user is explicitly triggering the autocompletion (with ctrl + space)
|
// this situation can happen when there is nothing in the text area and the user is explicitly triggering the autocompletion (with ctrl + space)
|
||||||
result.push(
|
result.push(
|
||||||
{ kind: ContextKind.MetricName, metricName: '' },
|
{ kind: ContextKind.MetricName, metricName: '' },
|
||||||
|
|
Loading…
Reference in New Issue