@fc-components/monaco-editor 0.1.15 → 0.1.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/monaco-editor.cjs.development.js +15 -17
- package/dist/monaco-editor.cjs.development.js.map +1 -1
- package/dist/monaco-editor.cjs.production.min.js +1 -1
- package/dist/monaco-editor.cjs.production.min.js.map +1 -1
- package/dist/monaco-editor.esm.js +15 -17
- package/dist/monaco-editor.esm.js.map +1 -1
- package/dist/promql/completion/DataProvider.d.ts +1 -1
- package/package.json +1 -1
- package/src/promql/completion/DataProvider.ts +2 -1
- package/src/promql/completion/completions.ts +17 -17
|
@@ -6,7 +6,6 @@ import { promLanguageDefinition } from 'monaco-promql';
|
|
|
6
6
|
import { parser, LabelMatchers, VectorSelector, PromQL, FunctionCallBody, StringLiteral, UnquotedLabelMatcher, BinaryExpr, NumberDurationLiteralInDurationContext, MatrixSelector, GroupingLabels, AggregateModifier, AggregateExpr, Identifier, LabelName, MatchOp, EqlSingle, EqlRegex, Neq, NeqRegex } from '@fc-components/lezer-metricsql';
|
|
7
7
|
import { v4 } from 'uuid';
|
|
8
8
|
import { css } from '@emotion/css';
|
|
9
|
-
import UFuzzy from '@leeoniya/ufuzzy';
|
|
10
9
|
|
|
11
10
|
function _arrayLikeToArray(r, a) {
|
|
12
11
|
(null == a || a > r.length) && (a = r.length);
|
|
@@ -1487,24 +1486,23 @@ function notEmpty(value) {
|
|
|
1487
1486
|
return value !== null && value !== undefined;
|
|
1488
1487
|
}
|
|
1489
1488
|
|
|
1490
|
-
|
|
1491
|
-
intraMode: 1
|
|
1492
|
-
});
|
|
1489
|
+
// const metricNamesSearchClient = new UFuzzy({ intraMode: 1 });
|
|
1493
1490
|
// we order items like: history, functions, metrics
|
|
1494
1491
|
function getAllMetricNamesCompletions(dataProvider) {
|
|
1495
1492
|
var metricNames = dataProvider.getAllMetricNames();
|
|
1496
|
-
if (metricNames.length > dataProvider.metricNamesSuggestionLimit) {
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
}
|
|
1493
|
+
// if (metricNames.length > dataProvider.metricNamesSuggestionLimit) {
|
|
1494
|
+
// const { monacoSettings } = dataProvider;
|
|
1495
|
+
// monacoSettings.enableAutocompleteSuggestionsUpdate();
|
|
1496
|
+
// if (monacoSettings.inputInRange) {
|
|
1497
|
+
// metricNames =
|
|
1498
|
+
// metricNamesSearchClient
|
|
1499
|
+
// .filter(metricNames, monacoSettings.inputInRange)
|
|
1500
|
+
// ?.slice(0, dataProvider.metricNamesSuggestionLimit)
|
|
1501
|
+
// .map((idx) => metricNames[idx]) ?? [];
|
|
1502
|
+
// } else {
|
|
1503
|
+
// metricNames = metricNames.slice(0, dataProvider.metricNamesSuggestionLimit);
|
|
1504
|
+
// }
|
|
1505
|
+
// }
|
|
1508
1506
|
return dataProvider.metricNamesToMetrics(metricNames).map(function (metric) {
|
|
1509
1507
|
return {
|
|
1510
1508
|
type: 'METRIC_NAME',
|
|
@@ -1728,7 +1726,7 @@ function _getLabelValues() {
|
|
|
1728
1726
|
}
|
|
1729
1727
|
return _context6.a(3, 7);
|
|
1730
1728
|
case 6:
|
|
1731
|
-
if (key === labelName) {
|
|
1729
|
+
if (key === labelName && value) {
|
|
1732
1730
|
labelValues.add(value);
|
|
1733
1731
|
}
|
|
1734
1732
|
case 7:
|