mirror of
https://github.com/prometheus/prometheus.git
synced 2024-12-25 05:34:05 -08:00
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;
|
||||
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)
|
||||
result.push(
|
||||
{ kind: ContextKind.MetricName, metricName: '' },
|
||||
|
|
Loading…
Reference in a new issue