mirror of
https://github.com/prometheus/prometheus.git
synced 2024-12-25 05:34:05 -08:00
Merge pull request #10053 from prometheus/bugfix/codemirror
Fix autocompletion when expr is empty in codemirror
This commit is contained in:
commit
257a9c161b
|
@ -41,7 +41,8 @@
|
|||
"@codemirror/lint": "^0.19.3",
|
||||
"@codemirror/state": "^0.19.6",
|
||||
"@codemirror/view": "^0.19.27",
|
||||
"@lezer/common": "^0.15.10",
|
||||
"@lezer/common": "^0.15.11",
|
||||
"@lezer/lr": "^0.15.5",
|
||||
"@lezer/generator": "^0.15.2",
|
||||
"@types/chai": "^4.2.22",
|
||||
"@types/lru-cache": "^5.1.1",
|
||||
|
@ -73,7 +74,7 @@
|
|||
"@codemirror/lint": "^0.19.3",
|
||||
"@codemirror/state": "^0.19.6",
|
||||
"@codemirror/view": "^0.19.27",
|
||||
"@lezer/common": "^0.15.10"
|
||||
"@lezer/common": "^0.15.11"
|
||||
},
|
||||
"prettier": {
|
||||
"singleQuote": true,
|
||||
|
|
|
@ -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: '' },
|
||||
|
|
29
web/ui/package-lock.json
generated
29
web/ui/package-lock.json
generated
|
@ -27,8 +27,9 @@
|
|||
"@codemirror/lint": "^0.19.3",
|
||||
"@codemirror/state": "^0.19.6",
|
||||
"@codemirror/view": "^0.19.27",
|
||||
"@lezer/common": "^0.15.10",
|
||||
"@lezer/common": "^0.15.11",
|
||||
"@lezer/generator": "^0.15.2",
|
||||
"@lezer/lr": "^0.15.5",
|
||||
"@types/chai": "^4.2.22",
|
||||
"@types/lru-cache": "^5.1.1",
|
||||
"@types/mocha": "^9.0.0",
|
||||
|
@ -62,7 +63,7 @@
|
|||
"@codemirror/lint": "^0.19.3",
|
||||
"@codemirror/state": "^0.19.6",
|
||||
"@codemirror/view": "^0.19.27",
|
||||
"@lezer/common": "^0.15.10"
|
||||
"@lezer/common": "^0.15.11"
|
||||
}
|
||||
},
|
||||
"module/codemirror-promql/node_modules/@eslint/eslintrc": {
|
||||
|
@ -1567,9 +1568,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/@lezer/common": {
|
||||
"version": "0.15.10",
|
||||
"resolved": "https://registry.npmjs.org/@lezer/common/-/common-0.15.10.tgz",
|
||||
"integrity": "sha512-vlr+be73zTDoQBIknBVOh/633tmbQcjxUu9PIeVeYESeBK3V6TuBW96RRFg93Y2cyK9lglz241gOgSn452HFvA=="
|
||||
"version": "0.15.11",
|
||||
"resolved": "https://registry.npmjs.org/@lezer/common/-/common-0.15.11.tgz",
|
||||
"integrity": "sha512-vv0nSdIaVCRcJ8rPuDdsrNVfBOYe/4Szr/LhF929XyDmBndLDuWiCCHooGlGlJfzELyO608AyDhVsuX/ZG36NA=="
|
||||
},
|
||||
"node_modules/@lezer/generator": {
|
||||
"version": "0.15.2",
|
||||
|
@ -1584,8 +1585,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/@lezer/lr": {
|
||||
"version": "0.15.2",
|
||||
"license": "MIT",
|
||||
"version": "0.15.5",
|
||||
"resolved": "https://registry.npmjs.org/@lezer/lr/-/lr-0.15.5.tgz",
|
||||
"integrity": "sha512-DEcLyhdmBxD1foQe7RegLrSlfS/XaTMGLkO5evkzHWAQKh/JnFWp7j7iNB7s2EpxzRrBCh0U+W7JDCeFhv2mng==",
|
||||
"dependencies": {
|
||||
"@lezer/common": "^0.15.0"
|
||||
}
|
||||
|
@ -27644,9 +27646,9 @@
|
|||
}
|
||||
},
|
||||
"@lezer/common": {
|
||||
"version": "0.15.10",
|
||||
"resolved": "https://registry.npmjs.org/@lezer/common/-/common-0.15.10.tgz",
|
||||
"integrity": "sha512-vlr+be73zTDoQBIknBVOh/633tmbQcjxUu9PIeVeYESeBK3V6TuBW96RRFg93Y2cyK9lglz241gOgSn452HFvA=="
|
||||
"version": "0.15.11",
|
||||
"resolved": "https://registry.npmjs.org/@lezer/common/-/common-0.15.11.tgz",
|
||||
"integrity": "sha512-vv0nSdIaVCRcJ8rPuDdsrNVfBOYe/4Szr/LhF929XyDmBndLDuWiCCHooGlGlJfzELyO608AyDhVsuX/ZG36NA=="
|
||||
},
|
||||
"@lezer/generator": {
|
||||
"version": "0.15.2",
|
||||
|
@ -27657,7 +27659,9 @@
|
|||
}
|
||||
},
|
||||
"@lezer/lr": {
|
||||
"version": "0.15.2",
|
||||
"version": "0.15.5",
|
||||
"resolved": "https://registry.npmjs.org/@lezer/lr/-/lr-0.15.5.tgz",
|
||||
"integrity": "sha512-DEcLyhdmBxD1foQe7RegLrSlfS/XaTMGLkO5evkzHWAQKh/JnFWp7j7iNB7s2EpxzRrBCh0U+W7JDCeFhv2mng==",
|
||||
"requires": {
|
||||
"@lezer/common": "^0.15.0"
|
||||
}
|
||||
|
@ -28431,8 +28435,9 @@
|
|||
"@codemirror/lint": "^0.19.3",
|
||||
"@codemirror/state": "^0.19.6",
|
||||
"@codemirror/view": "^0.19.27",
|
||||
"@lezer/common": "^0.15.10",
|
||||
"@lezer/common": "^0.15.11",
|
||||
"@lezer/generator": "^0.15.2",
|
||||
"@lezer/lr": "^0.15.5",
|
||||
"@types/chai": "^4.2.22",
|
||||
"@types/lru-cache": "^5.1.1",
|
||||
"@types/mocha": "^9.0.0",
|
||||
|
|
Loading…
Reference in a new issue