mirror of
https://github.com/prometheus/prometheus.git
synced 2026-07-16 12:33:18 -04:00
ui/codemirror-promql: pass DurationExpr node id to getChild
Signed-off-by: Julien Pivotto <291750+roidelapluie@users.noreply.github.com>
This commit is contained in:
parent
55556cbd06
commit
25eaa9f358
1 changed files with 2 additions and 2 deletions
|
|
@ -304,7 +304,7 @@ export function computeStartCompletePosition(state: EditorState, node: SyntaxNod
|
|||
(node.type.id === 0 &&
|
||||
(node.parent?.type.id === OffsetExpr ||
|
||||
node.parent?.type.id === MatrixSelector ||
|
||||
(node.parent?.type.id === SubqueryExpr && node.parent.getChild('DurationExpr') !== null)))
|
||||
(node.parent?.type.id === SubqueryExpr && node.parent.getChild(DurationExpr) !== null)))
|
||||
) {
|
||||
start = pos;
|
||||
}
|
||||
|
|
@ -333,7 +333,7 @@ export function analyzeCompletion(state: EditorState, node: SyntaxNode, pos: num
|
|||
if (
|
||||
node.parent?.type.id === OffsetExpr ||
|
||||
node.parent?.type.id === MatrixSelector ||
|
||||
(node.parent?.type.id === SubqueryExpr && node.parent.getChild('DurationExpr') !== null)
|
||||
(node.parent?.type.id === SubqueryExpr && node.parent.getChild(DurationExpr) !== null)
|
||||
) {
|
||||
// We are in a duration slot. Two situations land here with an error node:
|
||||
// 1. `go[]` -> the error node text is empty: nothing typed yet, so offer
|
||||
|
|
|
|||
Loading…
Reference in a new issue