@fc-components/monaco-editor 0.1.11 → 0.1.13
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/README.md +2 -2
- package/dist/monaco-editor.cjs.development.js +30 -4
- 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 +30 -4
- package/dist/monaco-editor.esm.js.map +1 -1
- package/dist/promql/index.d.ts +1 -1
- package/package.json +1 -1
- package/src/promql/index.tsx +38 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"monaco-editor.esm.js","sources":["../src/promql/promql.ts","../src/promql/util.ts","../src/promql/completion/DataProvider.ts","../src/promql/completion/situation.ts","../src/promql/completion/completions.ts","../src/promql/completion/getCompletionProvider.ts","../src/promql/validation.ts","../src/promql/index.tsx"],"sourcesContent":["export const languageConfiguration = {\n // the default separators except `@$`\n wordPattern: /(-?\\d*\\.\\d\\w*)|([^`~!#%^&*()\\-=+\\[{\\]}\\\\|;:'\",.<>\\/?\\s]+)/g,\n // Not possible to make comments in PromQL syntax\n comments: {\n lineComment: '#',\n },\n brackets: [\n ['{', '}'],\n ['[', ']'],\n ['(', ')'],\n ],\n autoClosingPairs: [\n { open: '{', close: '}' },\n { open: '[', close: ']' },\n { open: '(', close: ')' },\n { open: '\"', close: '\"' },\n { open: \"'\", close: \"'\" },\n ],\n surroundingPairs: [\n { open: '{', close: '}' },\n { open: '[', close: ']' },\n { open: '(', close: ')' },\n { open: '\"', close: '\"' },\n { open: \"'\", close: \"'\" },\n { open: '<', close: '>' },\n ],\n folding: {},\n};\n// PromQL Aggregation Operators\n// (https://prometheus.io/docs/prometheus/latest/querying/operators/#aggregation-operators)\nconst aggregations = [\n 'sum',\n 'min',\n 'max',\n 'avg',\n 'group',\n 'stddev',\n 'stdvar',\n 'count',\n 'count_values',\n 'bottomk',\n 'topk',\n 'quantile',\n 'quantiles',\n 'distinct',\n 'geomean',\n 'histogram',\n 'mad',\n 'mode',\n // metricsql aggregations\n 'any',\n 'bottomk_avg',\n 'bottomk_max',\n 'bottomk_median',\n 'bottomk_last',\n 'bottomk_min',\n 'topk_avg',\n 'topk_max',\n 'topk_median',\n 'topk_last',\n 'topk_min',\n 'outliers_mad',\n 'outliersk',\n 'share',\n 'sum2',\n 'zscore',\n];\n// PromQL functions\n// (https://prometheus.io/docs/prometheus/latest/querying/functions/)\nconst functions = [\n 'abs',\n 'absent',\n 'ceil',\n 'changes',\n 'clamp_max',\n 'clamp_min',\n 'day_of_month',\n 'day_of_week',\n 'days_in_month',\n 'delta',\n 'deriv',\n 'exp',\n 'floor',\n 'histogram_quantile',\n 'histogram_avg',\n 'histogram_count',\n 'histogram_sum',\n 'histogram_fraction',\n 'histogram_stddev',\n 'histogram_stdvar',\n 'holt_winters',\n 'hour',\n 'idelta',\n 'increase',\n 'irate',\n 'label_join',\n 'label_replace',\n 'ln',\n 'log2',\n 'log10',\n 'minute',\n 'month',\n 'predict_linear',\n 'rate',\n 'resets',\n 'round',\n 'scalar',\n 'sort',\n 'sort_desc',\n 'sqrt',\n 'time',\n 'timestamp',\n 'vector',\n 'year',\n // metricsql functions\n 'aggr_over_time',\n 'alias',\n 'ascent_over_time',\n 'bitmap_and',\n 'bitmap_or',\n 'bitmap_xor',\n 'buckets_limit',\n 'changes_prometheus',\n 'count_eq_over_time',\n 'count_gt_over_time',\n 'count_le_over_time',\n 'count_ne_over_time',\n 'decreases_over_time',\n 'default_rollup',\n 'delta_prometheus',\n 'deriv_fast',\n 'descent_over_time',\n 'distinct_over_time',\n 'drop_common_labels',\n 'duration_over_time',\n 'first_over_time',\n 'geomean_over_time',\n 'histogram_avg',\n 'histogram_over_time',\n 'histogram_quantiles',\n 'histogram_share',\n 'hoeffding_bound_lower',\n 'hoeffding_bound_upper',\n 'ideriv',\n 'increase_prometheus',\n 'increase_pure',\n 'increases_over_time',\n 'integrate',\n 'interpolate',\n 'keep_last_value',\n 'keep_next_value',\n 'label_copy',\n 'label_del',\n 'label_graphite_group',\n 'label_keep',\n 'label_lowercase',\n 'label_map',\n 'label_match',\n 'label_mismatch',\n 'label_move',\n 'label_set',\n 'label_transform',\n 'label_uppercase',\n 'label_value',\n 'lag',\n 'lifetime',\n 'limit_offset',\n 'mad_over_time',\n 'median_over_time',\n 'mode_over_time',\n 'now',\n 'prometheus_buckets',\n 'quantiles_over_time',\n 'rand',\n 'rand_exponential',\n 'rand_normal',\n 'range_avg',\n 'range_first',\n 'range_last',\n 'range_linear_regression',\n 'range_mad',\n 'range_max',\n 'range_min',\n 'range_normalize',\n 'range_over_time',\n 'range_quantile',\n 'range_stddev',\n 'range_stdvar',\n 'range_sum',\n 'range_trim_outliers',\n 'range_trim_spikes',\n 'range_trim_zscore',\n 'range_zscore',\n 'rate_over_sum',\n 'remove_resets',\n 'rollup',\n 'rollup_candlestick',\n 'rollup_delta',\n 'rollup_deriv',\n 'rollup_increase',\n 'rollup_rate',\n 'rollup_scrape_interval',\n 'running_avg',\n 'running_max',\n 'running_min',\n 'running_sum',\n 'scrape_interval',\n 'share_eq_over_time',\n 'share_gt_over_time',\n 'share_le_over_time',\n 'smooth_exponential',\n 'smooth_exponential',\n 'sort_by_label_desc',\n 'sort_by_label_numeric',\n 'sort_by_label_numeric_desc',\n 'stale_samples_over_time',\n 'step',\n 'sum2_over_time',\n 'tfirst_over_time',\n 'timestamp_with_name',\n 'timezone_offset',\n 'tlast_change_over_time',\n 'tlast_over_time',\n 'tmax_over_time',\n 'tmin_over_time',\n 'union',\n 'zscore_over_time',\n 'avg_daily',\n 'median_daily',\n 'avg_weekly',\n 'median_weekly',\n 'median_weekly_with_trends',\n];\n// PromQL specific functions: Aggregations over time\n// (https://prometheus.io/docs/prometheus/latest/querying/functions/#aggregation_over_time)\nconst aggregationsOverTime: string[] = [];\nfor (let _i = 0, aggregations_1 = aggregations; _i < aggregations_1.length; _i++) {\n let agg = aggregations_1[_i];\n aggregationsOverTime.push(agg + '_over_time');\n}\n\n// PromQL vector matching + the by and without clauses\n// (https://prometheus.io/docs/prometheus/latest/querying/operators/#vector-matching)\nconst vectorMatching = ['on', 'ignoring', 'group_right', 'group_left', 'by', 'without'];\n// Produce a regex matching elements : (elt1|elt2|...)\nconst vectorMatchingRegex =\n '(' +\n vectorMatching.reduce(function (prev, curr) {\n return prev + '|' + curr;\n }) +\n ')';\n// PromQL Operators\n// (https://prometheus.io/docs/prometheus/latest/querying/operators/)\nconst operators = ['+', '-', '*', '/', '%', '^', '==', '!=', '>', '<', '>=', '<=', 'and', 'or', 'unless'];\n// PromQL offset modifier\n// (https://prometheus.io/docs/prometheus/latest/querying/basics/#offset-modifier)\nconst offsetModifier = ['offset'];\n// Merging all the keywords in one list\nconst keywords = aggregations.concat(functions).concat(aggregationsOverTime).concat(vectorMatching).concat(offsetModifier);\n// noinspection JSUnusedGlobalSymbols\nexport const language = {\n ignoreCase: false,\n defaultToken: '',\n tokenPostfix: '.promql',\n keywords: keywords,\n operators: operators,\n vectorMatching: vectorMatchingRegex,\n // we include these common regular expressions\n symbols: /[=><!~?:&|+\\-*\\/^%]+/,\n escapes: /\\\\(?:[abfnrtv\\\\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,\n digits: /\\d+(_+\\d+)*/,\n octaldigits: /[0-7]+(_+[0-7]+)*/,\n binarydigits: /[0-1]+(_+[0-1]+)*/,\n hexdigits: /[[0-9a-fA-F]+(_+[0-9a-fA-F]+)*/,\n integersuffix: /(ll|LL|u|U|l|L)?(ll|LL|u|U|l|L)?/,\n floatsuffix: /[fFlL]?/,\n // The main tokenizer for our languages\n tokenizer: {\n root: [\n // 'by', 'without' and vector matching\n [/@vectorMatching\\s*(?=\\()/, 'type', '@clauses'],\n // labels\n [/[a-z_]\\w*(?=\\s*(=|!=|=~|!~))/, 'tag'],\n // comments\n [/(^#.*$)/, 'comment'],\n // all keywords have the same color\n [\n /[a-zA-Z_]\\w*/,\n {\n cases: {\n '@keywords': 'type',\n '@default': 'identifier',\n },\n },\n ],\n // strings\n [/\"([^\"\\\\]|\\\\.)*$/, 'string.invalid'],\n [/'([^'\\\\]|\\\\.)*$/, 'string.invalid'],\n [/\"/, 'string', '@string_double'],\n [/'/, 'string', '@string_single'],\n [/`/, 'string', '@string_backtick'],\n // whitespace\n { include: '@whitespace' },\n // delimiters and operators\n [/[{}()\\[\\]]/, '@brackets'],\n [/[<>](?!@symbols)/, '@brackets'],\n [\n /@symbols/,\n {\n cases: {\n '@operators': 'delimiter',\n '@default': '',\n },\n },\n ],\n // numbers\n [/\\d+[smhdwy]/, 'number'],\n [/\\d*\\d+[eE]([\\-+]?\\d+)?(@floatsuffix)/, 'number.float'],\n [/\\d*\\.\\d+([eE][\\-+]?\\d+)?(@floatsuffix)/, 'number.float'],\n [/0[xX][0-9a-fA-F']*[0-9a-fA-F](@integersuffix)/, 'number.hex'],\n [/0[0-7']*[0-7](@integersuffix)/, 'number.octal'],\n [/0[bB][0-1']*[0-1](@integersuffix)/, 'number.binary'],\n [/\\d[\\d']*\\d(@integersuffix)/, 'number'],\n [/\\d(@integersuffix)/, 'number'],\n ],\n string_double: [\n [/[^\\\\\"]+/, 'string'],\n [/@escapes/, 'string.escape'],\n [/\\\\./, 'string.escape.invalid'],\n [/\"/, 'string', '@pop'],\n ],\n string_single: [\n [/[^\\\\']+/, 'string'],\n [/@escapes/, 'string.escape'],\n [/\\\\./, 'string.escape.invalid'],\n [/'/, 'string', '@pop'],\n ],\n string_backtick: [\n [/[^\\\\`$]+/, 'string'],\n [/@escapes/, 'string.escape'],\n [/\\\\./, 'string.escape.invalid'],\n [/`/, 'string', '@pop'],\n ],\n clauses: [\n [/[^(,)]/, 'tag'],\n [/\\)/, 'identifier', '@pop'],\n ],\n whitespace: [[/[ \\t\\r\\n]+/, 'white']],\n },\n};\n// noinspection JSUnusedGlobalSymbols\n// export const completionItemProvider = {\n// provideCompletionItems: function () {\n// // To simplify, we made the choice to never create automatically the parenthesis behind keywords\n// // It is because in PromQL, some keywords need parenthesis behind, some don't, some can have but it's optional.\n// const suggestions = keywords.map(function (value) {\n// return {\n// label: value,\n// kind: languages.CompletionItemKind.Keyword,\n// insertText: value,\n// insertTextRules: languages.CompletionItemInsertTextRule.InsertAsSnippet\n// };\n// });\n// return { suggestions: suggestions };\n// }\n// };\n\ninterface CompletionItem {\n label: string;\n insertText: string;\n detail?: string;\n documentation?: string;\n}\n\nconst TRIGONOMETRIC_FUNCTIONS: CompletionItem[] = [\n {\n label: 'acos',\n insertText: 'acos',\n detail: 'acos(v instant-vector)',\n documentation: 'calculates the arccosine of all elements in v',\n },\n {\n label: 'acosh',\n insertText: 'acosh',\n detail: 'acosh(v instant-vector)',\n documentation: 'calculates the inverse hyperbolic cosine of all elements in v',\n },\n {\n label: 'asin',\n insertText: 'asin',\n detail: 'asin(v instant-vector)',\n documentation: 'calculates the arcsine of all elements in v',\n },\n {\n label: 'asinh',\n insertText: 'asinh',\n detail: 'asinh(v instant-vector)',\n documentation: 'calculates the inverse hyperbolic sine of all elements in v',\n },\n {\n label: 'atan',\n insertText: 'atan',\n detail: 'atan(v instant-vector)',\n documentation: 'calculates the arctangent of all elements in v',\n },\n {\n label: 'atanh',\n insertText: 'atanh',\n detail: 'atanh(v instant-vector)',\n documentation: 'calculates the inverse hyperbolic tangent of all elements in v',\n },\n {\n label: 'cos',\n insertText: 'cos',\n detail: 'cos(v instant-vector)',\n documentation: 'calculates the cosine of all elements in v',\n },\n {\n label: 'cosh',\n insertText: 'cosh',\n detail: 'cosh(v instant-vector)',\n documentation: 'calculates the hyperbolic cosine of all elements in v',\n },\n {\n label: 'sin',\n insertText: 'sin',\n detail: 'sin(v instant-vector)',\n documentation: 'calculates the sine of all elements in v',\n },\n {\n label: 'sinh',\n insertText: 'sinh',\n detail: 'sinh(v instant-vector)',\n documentation: 'calculates the hyperbolic sine of all elements in v',\n },\n {\n label: 'tan',\n insertText: 'tan',\n detail: 'tan(v instant-vector)',\n documentation: 'calculates the tangent of all elements in v',\n },\n {\n label: 'tanh',\n insertText: 'tanh',\n detail: 'tanh(v instant-vector)',\n documentation: 'calculates the hyperbolic tangent of all elements in v',\n },\n];\n\nconst AGGREGATION_OPERATORS: CompletionItem[] = [\n {\n label: 'sum',\n insertText: 'sum',\n documentation: 'Calculate sum over dimensions',\n },\n {\n label: 'min',\n insertText: 'min',\n documentation: 'Select minimum over dimensions',\n },\n {\n label: 'max',\n insertText: 'max',\n documentation: 'Select maximum over dimensions',\n },\n {\n label: 'avg',\n insertText: 'avg',\n documentation: 'Calculate the average over dimensions',\n },\n {\n label: 'group',\n insertText: 'group',\n documentation: 'All values in the resulting vector are 1',\n },\n {\n label: 'stddev',\n insertText: 'stddev',\n documentation: 'Calculate population standard deviation over dimensions',\n },\n {\n label: 'stdvar',\n insertText: 'stdvar',\n documentation: 'Calculate population standard variance over dimensions',\n },\n {\n label: 'count',\n insertText: 'count',\n documentation: 'Count number of elements in the vector',\n },\n {\n label: 'count_values',\n insertText: 'count_values',\n documentation: 'Count number of elements with the same value',\n },\n {\n label: 'bottomk',\n insertText: 'bottomk',\n documentation: 'Smallest k elements by sample value',\n },\n {\n label: 'topk',\n insertText: 'topk',\n documentation: 'Largest k elements by sample value',\n },\n {\n label: 'quantile',\n insertText: 'quantile',\n documentation: 'Calculate φ-quantile (0 ≤ φ ≤ 1) over dimensions',\n },\n];\n\nexport const FUNCTIONS = [\n ...AGGREGATION_OPERATORS,\n ...TRIGONOMETRIC_FUNCTIONS,\n {\n insertText: 'abs',\n label: 'abs',\n detail: 'abs(v instant-vector)',\n documentation: 'Returns the input vector with all sample values converted to their absolute value.',\n },\n {\n insertText: 'absent',\n label: 'absent',\n detail: 'absent(v instant-vector)',\n documentation:\n 'Returns an empty vector if the vector passed to it has any elements and a 1-element vector with the value 1 if the vector passed to it has no elements. This is useful for alerting on when no time series exist for a given metric name and label combination.',\n },\n {\n insertText: 'absent_over_time',\n label: 'absent_over_time',\n detail: 'absent(v range-vector)',\n documentation:\n 'Returns an empty vector if the range vector passed to it has any elements and a 1-element vector with the value 1 if the range vector passed to it has no elements.',\n },\n {\n insertText: 'ceil',\n label: 'ceil',\n detail: 'ceil(v instant-vector)',\n documentation: 'Rounds the sample values of all elements in `v` up to the nearest integer.',\n },\n {\n insertText: 'changes',\n label: 'changes',\n detail: 'changes(v range-vector)',\n documentation: 'For each input time series, `changes(v range-vector)` returns the number of times its value has changed within the provided time range as an instant vector.',\n },\n {\n insertText: 'clamp',\n label: 'clamp',\n detail: 'clamp(v instant-vector, min scalar, max scalar)',\n documentation: 'Clamps the sample values of all elements in `v` to have a lower limit of `min` and an upper limit of `max`.',\n },\n {\n insertText: 'clamp_max',\n label: 'clamp_max',\n detail: 'clamp_max(v instant-vector, max scalar)',\n documentation: 'Clamps the sample values of all elements in `v` to have an upper limit of `max`.',\n },\n {\n insertText: 'clamp_min',\n label: 'clamp_min',\n detail: 'clamp_min(v instant-vector, min scalar)',\n documentation: 'Clamps the sample values of all elements in `v` to have a lower limit of `min`.',\n },\n {\n insertText: 'count_scalar',\n label: 'count_scalar',\n detail: 'count_scalar(v instant-vector)',\n documentation:\n 'Returns the number of elements in a time series vector as a scalar. This is in contrast to the `count()` aggregation operator, which always returns a vector (an empty one if the input vector is empty) and allows grouping by labels via a `by` clause.',\n },\n {\n insertText: 'deg',\n label: 'deg',\n detail: 'deg(v instant-vector)',\n documentation: 'Converts radians to degrees for all elements in v',\n },\n {\n insertText: 'day_of_month',\n label: 'day_of_month',\n detail: 'day_of_month(v=vector(time()) instant-vector)',\n documentation: 'Returns the day of the month for each of the given times in UTC. Returned values are from 1 to 31.',\n },\n {\n insertText: 'day_of_week',\n label: 'day_of_week',\n detail: 'day_of_week(v=vector(time()) instant-vector)',\n documentation: 'Returns the day of the week for each of the given times in UTC. Returned values are from 0 to 6, where 0 means Sunday etc.',\n },\n {\n insertText: 'day_of_year',\n label: 'day_of_year',\n detail: 'day_of_year(v=vector(time()) instant-vector)',\n documentation: 'Returns the day of the year for each of the given times in UTC. Returned values are from 1 to 365 for non-leap years, and 1 to 366 in leap years.',\n },\n {\n insertText: 'days_in_month',\n label: 'days_in_month',\n detail: 'days_in_month(v=vector(time()) instant-vector)',\n documentation: 'Returns number of days in the month for each of the given times in UTC. Returned values are from 28 to 31.',\n },\n {\n insertText: 'delta',\n label: 'delta',\n detail: 'delta(v range-vector)',\n documentation:\n 'Calculates the difference between the first and last value of each time series element in a range vector `v`, returning an instant vector with the given deltas and equivalent labels. The delta is extrapolated to cover the full time range as specified in the range vector selector, so that it is possible to get a non-integer result even if the sample values are all integers.',\n },\n {\n insertText: 'deriv',\n label: 'deriv',\n detail: 'deriv(v range-vector)',\n documentation: 'Calculates the per-second derivative of the time series in a range vector `v`, using simple linear regression.',\n },\n {\n insertText: 'drop_common_labels',\n label: 'drop_common_labels',\n detail: 'drop_common_labels(instant-vector)',\n documentation: 'Drops all labels that have the same name and value across all series in the input vector.',\n },\n {\n insertText: 'exp',\n label: 'exp',\n detail: 'exp(v instant-vector)',\n documentation: 'Calculates the exponential function for all elements in `v`.\\nSpecial cases are:\\n* `Exp(+Inf) = +Inf` \\n* `Exp(NaN) = NaN`',\n },\n {\n insertText: 'floor',\n label: 'floor',\n detail: 'floor(v instant-vector)',\n documentation: 'Rounds the sample values of all elements in `v` down to the nearest integer.',\n },\n {\n insertText: 'histogram_quantile',\n label: 'histogram_quantile',\n detail: 'histogram_quantile(φ float, b instant-vector)',\n documentation:\n 'Calculates the φ-quantile (0 ≤ φ ≤ 1) from the buckets `b` of a histogram. The samples in `b` are the counts of observations in each bucket. Each sample must have a label `le` where the label value denotes the inclusive upper bound of the bucket. (Samples without such a label are silently ignored.) The histogram metric type automatically provides time series with the `_bucket` suffix and the appropriate labels.',\n },\n {\n insertText: 'holt_winters',\n label: 'holt_winters',\n detail: 'holt_winters(v range-vector, sf scalar, tf scalar)',\n documentation:\n 'Produces a smoothed value for time series based on the range in `v`. The lower the smoothing factor `sf`, the more importance is given to old data. The higher the trend factor `tf`, the more trends in the data is considered. Both `sf` and `tf` must be between 0 and 1.',\n },\n {\n insertText: 'hour',\n label: 'hour',\n detail: 'hour(v=vector(time()) instant-vector)',\n documentation: 'Returns the hour of the day for each of the given times in UTC. Returned values are from 0 to 23.',\n },\n {\n insertText: 'idelta',\n label: 'idelta',\n detail: 'idelta(v range-vector)',\n documentation: 'Calculates the difference between the last two samples in the range vector `v`, returning an instant vector with the given deltas and equivalent labels.',\n },\n {\n insertText: 'increase',\n label: 'increase',\n detail: 'increase(v range-vector)',\n documentation:\n 'Calculates the increase in the time series in the range vector. Breaks in monotonicity (such as counter resets due to target restarts) are automatically adjusted for. The increase is extrapolated to cover the full time range as specified in the range vector selector, so that it is possible to get a non-integer result even if a counter increases only by integer increments.',\n },\n {\n insertText: 'irate',\n label: 'irate',\n detail: 'irate(v range-vector)',\n documentation:\n 'Calculates the per-second instant rate of increase of the time series in the range vector. This is based on the last two data points. Breaks in monotonicity (such as counter resets due to target restarts) are automatically adjusted for.',\n },\n {\n insertText: 'label_join',\n label: 'label_join',\n detail: 'label_join(v instant-vector, dst_label string, separator string, src_label_1 string, src_label_2 string, ...)',\n documentation:\n 'For each timeseries in `v`, joins all the values of all the `src_labels` using `separator` and returns the timeseries with the label `dst_label` containing the joined value. There can be any number of `src_labels` in this function.',\n },\n {\n insertText: 'label_replace',\n label: 'label_replace',\n detail: 'label_replace(v instant-vector, dst_label string, replacement string, src_label string, regex string)',\n documentation:\n \"For each timeseries in `v`, `label_replace(v instant-vector, dst_label string, replacement string, src_label string, regex string)` matches the regular expression `regex` against the label `src_label`. If it matches, then the timeseries is returned with the label `dst_label` replaced by the expansion of `replacement`. `$1` is replaced with the first matching subgroup, `$2` with the second etc. If the regular expression doesn't match then the timeseries is returned unchanged.\",\n },\n {\n insertText: 'ln',\n label: 'ln',\n detail: 'ln(v instant-vector)',\n documentation:\n 'Calculates the natural logarithm for all elements in `v`.\\nSpecial cases are:\\n * `ln(+Inf) = +Inf`\\n * `ln(0) = -Inf`\\n * `ln(x < 0) = NaN`\\n * `ln(NaN) = NaN`',\n },\n {\n insertText: 'log2',\n label: 'log2',\n detail: 'log2(v instant-vector)',\n documentation: 'Calculates the binary logarithm for all elements in `v`. The special cases are equivalent to those in `ln`.',\n },\n {\n insertText: 'log10',\n label: 'log10',\n detail: 'log10(v instant-vector)',\n documentation: 'Calculates the decimal logarithm for all elements in `v`. The special cases are equivalent to those in `ln`.',\n },\n {\n insertText: 'minute',\n label: 'minute',\n detail: 'minute(v=vector(time()) instant-vector)',\n documentation: 'Returns the minute of the hour for each of the given times in UTC. Returned values are from 0 to 59.',\n },\n {\n insertText: 'month',\n label: 'month',\n detail: 'month(v=vector(time()) instant-vector)',\n documentation: 'Returns the month of the year for each of the given times in UTC. Returned values are from 1 to 12, where 1 means January etc.',\n },\n {\n insertText: 'pi',\n label: 'pi',\n detail: 'pi()',\n documentation: 'Returns pi',\n },\n {\n insertText: 'predict_linear',\n label: 'predict_linear',\n detail: 'predict_linear(v range-vector, t scalar)',\n documentation: 'Predicts the value of time series `t` seconds from now, based on the range vector `v`, using simple linear regression.',\n },\n {\n insertText: 'rad',\n label: 'rad',\n detail: 'rad(v instant-vector)',\n documentation: 'Converts degrees to radians for all elements in v',\n },\n {\n insertText: 'rate',\n label: 'rate',\n detail: 'rate(v range-vector)',\n documentation:\n \"Calculates the per-second average rate of increase of the time series in the range vector. Breaks in monotonicity (such as counter resets due to target restarts) are automatically adjusted for. Also, the calculation extrapolates to the ends of the time range, allowing for missed scrapes or imperfect alignment of scrape cycles with the range's time period.\",\n },\n {\n insertText: 'resets',\n label: 'resets',\n detail: 'resets(v range-vector)',\n documentation:\n 'For each input time series, `resets(v range-vector)` returns the number of counter resets within the provided time range as an instant vector. Any decrease in the value between two consecutive samples is interpreted as a counter reset.',\n },\n {\n insertText: 'round',\n label: 'round',\n detail: 'round(v instant-vector, to_nearest=1 scalar)',\n documentation:\n 'Rounds the sample values of all elements in `v` to the nearest integer. Ties are resolved by rounding up. The optional `to_nearest` argument allows specifying the nearest multiple to which the sample values should be rounded. This multiple may also be a fraction.',\n },\n {\n insertText: 'scalar',\n label: 'scalar',\n detail: 'scalar(v instant-vector)',\n documentation:\n 'Given a single-element input vector, `scalar(v instant-vector)` returns the sample value of that single element as a scalar. If the input vector does not have exactly one element, `scalar` will return `NaN`.',\n },\n {\n insertText: 'sgn',\n label: 'sgn',\n detail: 'sgn(v instant-vector)',\n documentation: 'Returns a vector with all sample values converted to their sign, defined as this: 1 if v is positive, -1 if v is negative and 0 if v is equal to zero.',\n },\n {\n insertText: 'sort',\n label: 'sort',\n detail: 'sort(v instant-vector)',\n documentation: 'Returns vector elements sorted by their sample values, in ascending order.',\n },\n {\n insertText: 'sort_desc',\n label: 'sort_desc',\n detail: 'sort_desc(v instant-vector)',\n documentation: 'Returns vector elements sorted by their sample values, in descending order.',\n },\n {\n insertText: 'sqrt',\n label: 'sqrt',\n detail: 'sqrt(v instant-vector)',\n documentation: 'Calculates the square root of all elements in `v`.',\n },\n {\n insertText: 'time',\n label: 'time',\n detail: 'time()',\n documentation:\n 'Returns the number of seconds since January 1, 1970 UTC. Note that this does not actually return the current time, but the time at which the expression is to be evaluated.',\n },\n {\n insertText: 'timestamp',\n label: 'timestamp',\n detail: 'timestamp(v instant-vector)',\n documentation: 'Returns the timestamp of each of the samples of the given vector as the number of seconds since January 1, 1970 UTC.',\n },\n {\n insertText: 'vector',\n label: 'vector',\n detail: 'vector(s scalar)',\n documentation: 'Returns the scalar `s` as a vector with no labels.',\n },\n {\n insertText: 'year',\n label: 'year',\n detail: 'year(v=vector(time()) instant-vector)',\n documentation: 'Returns the year for each of the given times in UTC.',\n },\n {\n insertText: 'avg_over_time',\n label: 'avg_over_time',\n detail: 'avg_over_time(range-vector)',\n documentation: 'The average value of all points in the specified interval.',\n },\n {\n insertText: 'min_over_time',\n label: 'min_over_time',\n detail: 'min_over_time(range-vector)',\n documentation: 'The minimum value of all points in the specified interval.',\n },\n {\n insertText: 'max_over_time',\n label: 'max_over_time',\n detail: 'max_over_time(range-vector)',\n documentation: 'The maximum value of all points in the specified interval.',\n },\n {\n insertText: 'sum_over_time',\n label: 'sum_over_time',\n detail: 'sum_over_time(range-vector)',\n documentation: 'The sum of all values in the specified interval.',\n },\n {\n insertText: 'count_over_time',\n label: 'count_over_time',\n detail: 'count_over_time(range-vector)',\n documentation: 'The count of all values in the specified interval.',\n },\n {\n insertText: 'quantile_over_time',\n label: 'quantile_over_time',\n detail: 'quantile_over_time(scalar, range-vector)',\n documentation: 'The φ-quantile (0 ≤ φ ≤ 1) of the values in the specified interval.',\n },\n {\n insertText: 'stddev_over_time',\n label: 'stddev_over_time',\n detail: 'stddev_over_time(range-vector)',\n documentation: 'The population standard deviation of the values in the specified interval.',\n },\n {\n insertText: 'stdvar_over_time',\n label: 'stdvar_over_time',\n detail: 'stdvar_over_time(range-vector)',\n documentation: 'The population standard variance of the values in the specified interval.',\n },\n {\n insertText: 'last_over_time',\n label: 'last_over_time',\n detail: 'last_over_time(range-vector)',\n documentation: 'The most recent point value in specified interval.',\n },\n {\n insertText: 'present_over_time',\n label: 'present_over_time',\n detail: 'present_over_time(range-vector)',\n documentation: 'The value 1 for any series in the specified interval.',\n },\n {\n insertText: 'histogram_avg',\n label: 'histogram_avg',\n detail: 'histogram_avg(v instant-vector)',\n documentation:\n 'Returns the arithmetic average of observed values stored in a native histogram. Samples that are not native histograms are ignored and do not show up in the returned vector.',\n },\n {\n insertText: 'histogram_count',\n label: 'histogram_count',\n detail: 'histogram_count(v instant-vector)',\n documentation: 'Returns the count of observations stored in a native histogram.',\n },\n {\n insertText: 'histogram_sum',\n label: 'histogram_sum',\n detail: 'histogram_sum(v instant-vector)',\n documentation: 'Returns the sum of observations stored in a native histogram.',\n },\n {\n insertText: 'histogram_fraction',\n label: 'histogram_fraction',\n detail: 'histogram_fraction(lower scalar, upper scalar, v instant-vector)',\n documentation: 'Returns the estimated fraction of observations between the provided lower and upper values.',\n },\n {\n insertText: 'histogram_stddev',\n label: 'histogram_stddev',\n detail: 'histogram_stddev(v instant-vector)',\n documentation: 'Returns the estimated standard deviation of observations in a native histogram, based on the geometric mean of the buckets where the observations lie.',\n },\n {\n insertText: 'histogram_stdvar',\n label: 'histogram_stdvar',\n detail: 'histogram_stdvar(v instant-vector)',\n documentation: 'Returns the estimated standard variance of observations in a native histogram.',\n },\n];\n","import { Label } from './types';\n\nexport class NeverCaseError extends Error {\n constructor(_value: never) {\n super('should never happen');\n }\n}\n\n// based on the openmetrics-documentation, the 3 symbols we have to handle are:\n// - \\n ... the newline character\n// - \\ ... the backslash character\n// - \" ... the double-quote character\nexport function escapeLabelValueInExactSelector(labelValue: string): string {\n return labelValue.replace(/\\\\/g, '\\\\\\\\').replace(/\\n/g, '\\\\n').replace(/\"/g, '\\\\\"');\n}\n\nexport function makeSelector(metricName: string, labels?: Label[], labelName?: string): string {\n if (!labels || labels.length === 0) {\n return metricName;\n }\n\n const allLabels = [...labels].filter((label) => label.name !== labelName && label.value !== '');\n\n const allLabelTexts = allLabels.map((label) => {\n return `${label.name}${label.op}\"${escapeLabelValueInExactSelector(label.value)}\"`;\n });\n\n return `${metricName}{${allLabelTexts.join(',')}}`;\n}\n","import { makeSelector } from '../util';\nimport type { Metric, PromMetricsMetadata, DataProviderParams } from '../types';\n\ntype CustomRequest = (input: RequestInfo, init?: RequestInit) => Promise<Response>;\n\ninterface APIResponse<T> {\n status: 'success' | 'error';\n data?: T;\n error?: string;\n warnings?: string[];\n}\n\nconst DEFAULT_SERIES_LIMIT = '40000';\nconst badRequest = 400;\nconst unprocessableEntity = 422;\nconst serviceUnavailable = 503;\nconst CODE_MODE_SUGGESTIONS_INCOMPLETE_EVENT = 'codeModeSuggestionsIncomplete';\n\nexport class DataProvider {\n readonly metricNamesSuggestionLimit: number;\n private inputInRange: string;\n private suggestionsIncomplete: boolean;\n private readonly lookbackInterval = 60 * 60 * 1000 * 12; // 12 hours\n private variablesNames: string[] = [];\n private readonly url: string;\n private readonly errorHandler?: (error: any) => void;\n private readonly httpMethod: 'POST' | 'GET' = 'GET';\n private readonly apiPrefix: string = '/api/v1';\n private readonly customRequest: CustomRequest = (input: RequestInfo, init?: RequestInit): Promise<Response> => fetch(input, init);\n metrics: string[];\n labelKeys: string[];\n metricsMetadata?: PromMetricsMetadata;\n durationVariablesCompletion: boolean;\n\n constructor(params: DataProviderParams) {\n this.inputInRange = '';\n this.metricNamesSuggestionLimit = 1000;\n this.suggestionsIncomplete = false;\n\n this.url = params.url ? params.url : '';\n this.errorHandler = params.httpErrorHandler;\n if (params.lookbackInterval) {\n this.lookbackInterval = params.lookbackInterval;\n }\n if (params.variablesNames) {\n this.variablesNames = [...params.variablesNames];\n }\n this.durationVariablesCompletion = params.durationVariablesCompletion ?? true;\n if (params.request) {\n this.customRequest = params.request;\n }\n if (params.httpMethod) {\n this.httpMethod = params.httpMethod;\n }\n if (params.apiPrefix) {\n this.apiPrefix = params.apiPrefix;\n }\n\n this.metrics = [];\n this.labelKeys = [];\n }\n\n getVariablesNames(): string[] {\n return this.variablesNames;\n }\n\n setVariablesNames(variablesNames: string[]) {\n this.variablesNames = [...variablesNames];\n }\n\n private buildRequest(endpoint: string, params: URLSearchParams) {\n let uri = endpoint;\n let body: URLSearchParams | null = params;\n if (this.httpMethod === 'GET') {\n uri = `${uri}?${params}`;\n body = null;\n }\n return { uri, body };\n }\n\n private request<T>(resource: string, init?: RequestInit): Promise<T> {\n return this.customRequest(this.url + resource, init)\n .then((res) => {\n if (!res.ok && ![badRequest, unprocessableEntity, serviceUnavailable].includes(res.status)) {\n throw new Error(res.statusText);\n }\n return res;\n })\n .then((res) => res.json())\n .then((apiRes: APIResponse<T>) => {\n if (apiRes.status === 'error') {\n const error = new Error(apiRes.error !== undefined ? apiRes.error : 'missing \"error\" field in response JSON');\n if (this.errorHandler) {\n this.errorHandler(error);\n }\n throw error;\n }\n if (apiRes.data === undefined) {\n const error = new Error(apiRes.error !== undefined ? apiRes.error : 'missing \"data\" field in response JSON');\n if (this.errorHandler) {\n this.errorHandler(error);\n }\n throw error;\n }\n return apiRes.data;\n })\n .catch((error) => {\n if (this.errorHandler) {\n this.errorHandler(error);\n }\n throw error;\n });\n }\n\n fetchSeries = async (selector: string, withLimit?: string): Promise<Record<string, string>[]> => {\n const end = new Date();\n const start = new Date(end.getTime() - this.lookbackInterval);\n const url = `${this.apiPrefix}/series`;\n let urlParams: any = {\n start: start.toISOString() as string,\n end: end.toISOString() as string,\n };\n if (selector) {\n urlParams['match[]'] = selector;\n }\n\n if (withLimit !== 'none') {\n urlParams = { ...urlParams, limit: withLimit ?? DEFAULT_SERIES_LIMIT };\n }\n const request = this.buildRequest(url, new URLSearchParams(urlParams));\n\n return await this.request<Record<string, string>[]>(request.uri, {\n method: this.httpMethod,\n body: request.body,\n }).catch(() => {\n return [] as Record<string, string>[];\n });\n };\n\n fetchLabels = async (selector: string): Promise<string[]> => {\n const end = new Date();\n const start = new Date(end.getTime() - this.lookbackInterval);\n const url = `${this.apiPrefix}/labels`;\n const urlParams: any = {\n start: start.toISOString(),\n end: end.toISOString(),\n };\n if (selector) {\n urlParams['match[]'] = selector;\n }\n const request = this.buildRequest(url, new URLSearchParams(urlParams));\n\n return await this.request<string[]>(request.uri, {\n method: this.httpMethod,\n body: request.body,\n })\n .then((res) => {\n this.labelKeys = res;\n return res;\n })\n .catch(() => {\n return [] as string[];\n });\n };\n\n fetchLabelValues = async (labelName: string, selector: string): Promise<string[]> => {\n const end = new Date();\n const start = new Date(end.getTime() - this.lookbackInterval);\n const url = `${this.apiPrefix}/label/${labelName}/values`;\n const urlParams: any = {\n start: start.toISOString(),\n end: end.toISOString(),\n };\n if (selector) {\n urlParams['match[]'] = selector;\n }\n const request = this.buildRequest(url, new URLSearchParams(urlParams));\n\n return await this.request<string[]>(request.uri, {\n method: this.httpMethod,\n body: request.body,\n }).catch(() => {\n return [] as string[];\n });\n };\n\n getAllMetricNames(): string[] {\n return this.metrics;\n }\n\n start = async () => {\n this.metrics = (await this.fetchLabelValues('__name__', makeSelector('', [], '__name__'))) || [];\n\n return Promise.all([\n this.loadMetricsMetadata(),\n // this.fetchLabels()\n ]);\n };\n\n async loadMetricsMetadata() {\n const request = this.buildRequest(`${this.apiPrefix}/metadata`, new URLSearchParams({}));\n this.metricsMetadata = await this.request<PromMetricsMetadata>(request.uri, {\n method: this.httpMethod,\n body: request.body,\n }).catch(() => {\n return {} as PromMetricsMetadata;\n });\n }\n\n metricNamesToMetrics(metricNames: string[]): Metric[] {\n const result: Metric[] = metricNames.map((m) => {\n const metaItem = this.metricsMetadata?.[m];\n return {\n name: m,\n help: metaItem?.help ?? '',\n type: metaItem?.type ?? '',\n };\n });\n\n return result;\n }\n\n private setInputInRange(textInput: string): void {\n this.inputInRange = textInput;\n }\n\n private enableAutocompleteSuggestionsUpdate(): void {\n this.suggestionsIncomplete = true;\n dispatchEvent(\n new CustomEvent(CODE_MODE_SUGGESTIONS_INCOMPLETE_EVENT, {\n detail: {\n limit: this.metricNamesSuggestionLimit,\n },\n }),\n );\n }\n\n get monacoSettings() {\n return {\n /**\n * Enable autocomplete suggestions update on every input change.\n *\n * @remarks\n * If fuzzy search is used in `getCompletions` to trim down results to improve performance,\n * we need to instruct Monaco to update the completions on every input change, so that the\n * completions reflect the current input.\n */\n enableAutocompleteSuggestionsUpdate: this.enableAutocompleteSuggestionsUpdate.bind(this),\n inputInRange: this.inputInRange,\n setInputInRange: this.setInputInRange.bind(this),\n suggestionsIncomplete: this.suggestionsIncomplete,\n };\n }\n}\n","import type { SyntaxNode, Tree } from '@lezer/common';\nimport {\n AggregateExpr,\n AggregateModifier,\n BinaryExpr,\n EqlRegex,\n EqlSingle,\n FunctionCallBody,\n GroupingLabels,\n Identifier,\n LabelMatchers,\n LabelName,\n MatchOp,\n MatrixSelector,\n Neq,\n NeqRegex,\n NumberDurationLiteralInDurationContext,\n parser,\n PromQL,\n StringLiteral,\n UnquotedLabelMatcher,\n VectorSelector,\n} from '@fc-components/lezer-metricsql';\n\nimport { NeverCaseError } from '../util';\nimport { LabelOperator, Label } from '../types';\n\ntype Direction = 'parent' | 'firstChild' | 'lastChild' | 'nextSibling';\n\ntype NodeTypeId =\n | 0 // this is used as error-id\n | typeof AggregateExpr\n | typeof AggregateModifier\n | typeof FunctionCallBody\n | typeof GroupingLabels\n | typeof Identifier\n | typeof UnquotedLabelMatcher\n | typeof LabelMatchers\n | typeof LabelName\n | typeof PromQL\n | typeof StringLiteral\n | typeof VectorSelector\n | typeof MatrixSelector\n | typeof MatchOp\n | typeof EqlSingle\n | typeof Neq\n | typeof EqlRegex\n | typeof NeqRegex;\n\ntype Path = Array<[Direction, NodeTypeId]>;\n\nfunction move(node: SyntaxNode, direction: Direction): SyntaxNode | null {\n switch (direction) {\n case 'parent':\n return node.parent;\n case 'firstChild':\n return node.firstChild;\n case 'lastChild':\n return node.lastChild;\n case 'nextSibling':\n return node.nextSibling;\n default:\n throw new NeverCaseError(direction);\n }\n}\n\nfunction walk(node: SyntaxNode, path: Path): SyntaxNode | null {\n let current: SyntaxNode | null = node;\n for (const [direction, expectedType] of path) {\n current = move(current, direction);\n if (current === null) {\n // we could not move in the direction, we stop\n return null;\n }\n if (current.type.id !== expectedType) {\n // the reached node has wrong type, we stop\n return null;\n }\n }\n return current;\n}\n\nfunction getNodeText(node: SyntaxNode, text: string): string {\n return text.slice(node.from, node.to);\n}\n\nfunction parsePromQLStringLiteral(text: string): string {\n // if it is a string-literal, it is inside quotes of some kind\n const inside = text.slice(1, text.length - 1);\n\n // FIXME: support https://prometheus.io/docs/prometheus/latest/querying/basics/#string-literals\n // FIXME: maybe check other promql code, if all is supported or not\n\n // for now we do only some very simple un-escaping\n\n // we start with double-quotes\n if (text.startsWith('\"') && text.endsWith('\"')) {\n // NOTE: this is not 100% perfect, we only unescape the double-quote,\n // there might be other characters too\n return inside.replace(/\\\\\"/, '\"');\n }\n\n // then single-quote\n if (text.startsWith(\"'\") && text.endsWith(\"'\")) {\n // NOTE: this is not 100% perfect, we only unescape the single-quote,\n // there might be other characters too\n return inside.replace(/\\\\'/, \"'\");\n }\n\n // then backticks\n if (text.startsWith('`') && text.endsWith('`')) {\n return inside;\n }\n\n throw new Error('FIXME: invalid string literal');\n}\n\nexport type Situation =\n | {\n type: 'IN_FUNCTION';\n }\n | {\n type: 'AT_ROOT';\n }\n | {\n type: 'EMPTY';\n }\n | {\n type: 'IN_DURATION';\n }\n | {\n type: 'IN_LABEL_SELECTOR_NO_LABEL_NAME';\n metricName?: string;\n otherLabels: Label[];\n }\n | {\n type: 'IN_GROUPING';\n metricName: string;\n otherLabels: Label[];\n }\n | {\n type: 'IN_LABEL_SELECTOR_WITH_LABEL_NAME';\n metricName?: string;\n labelName: string;\n betweenQuotes: boolean;\n otherLabels: Label[];\n };\n\ntype Resolver = {\n path: NodeTypeId[];\n fun: (node: SyntaxNode, text: string, pos: number) => Situation | null;\n};\n\nfunction isPathMatch(resolverPath: NodeTypeId[], cursorPath: number[]): boolean {\n return resolverPath.every((item, index) => item === cursorPath[index]);\n}\n\nconst ERROR_NODE_NAME: NodeTypeId = 0; // this is used as error-id\n\nconst RESOLVERS: Resolver[] = [\n {\n path: [LabelMatchers, VectorSelector],\n fun: resolveLabelKeysWithEquals,\n },\n {\n path: [PromQL],\n fun: resolveTopLevel,\n },\n {\n path: [FunctionCallBody],\n fun: resolveInFunction,\n },\n {\n path: [StringLiteral, UnquotedLabelMatcher],\n fun: resolveLabelMatcher,\n },\n {\n path: [ERROR_NODE_NAME, BinaryExpr, PromQL],\n fun: resolveTopLevel,\n },\n {\n path: [ERROR_NODE_NAME, UnquotedLabelMatcher],\n fun: resolveLabelMatcher,\n },\n {\n path: [ERROR_NODE_NAME, NumberDurationLiteralInDurationContext, MatrixSelector],\n fun: resolveDurations,\n },\n {\n path: [GroupingLabels],\n fun: resolveLabelsForGrouping,\n },\n];\n\nconst LABEL_OP_MAP = new Map<number, LabelOperator>([\n [EqlSingle, '='],\n [EqlRegex, '=~'],\n [Neq, '!='],\n [NeqRegex, '!~'],\n]);\n\nfunction getLabelOp(opNode: SyntaxNode): LabelOperator | null {\n const opChild = opNode.firstChild;\n if (opChild === null) {\n return null;\n }\n\n return LABEL_OP_MAP.get(opChild.type.id) ?? null;\n}\n\nfunction getLabel(labelMatcherNode: SyntaxNode, text: string): Label | null {\n if (labelMatcherNode.type.id !== UnquotedLabelMatcher) {\n return null;\n }\n\n const nameNode = walk(labelMatcherNode, [['firstChild', LabelName]]);\n\n if (nameNode === null) {\n return null;\n }\n\n const opNode = walk(nameNode, [['nextSibling', MatchOp]]);\n if (opNode === null) {\n return null;\n }\n\n const op = getLabelOp(opNode);\n if (op === null) {\n return null;\n }\n\n const valueNode = walk(labelMatcherNode, [['lastChild', StringLiteral]]);\n\n if (valueNode === null) {\n return null;\n }\n\n const name = getNodeText(nameNode, text);\n const value = parsePromQLStringLiteral(getNodeText(valueNode, text));\n\n return { name, value, op };\n}\n\nfunction getLabels(labelMatchersNode: SyntaxNode, text: string): Label[] {\n if (labelMatchersNode.type.id !== LabelMatchers) {\n return [];\n }\n\n const labelNodes = labelMatchersNode.getChildren(UnquotedLabelMatcher);\n return labelNodes.map((ln) => getLabel(ln, text)).filter(notEmpty);\n}\n\nfunction getNodeChildren(node: SyntaxNode): SyntaxNode[] {\n let child: SyntaxNode | null = node.firstChild;\n const children: SyntaxNode[] = [];\n while (child !== null) {\n children.push(child);\n child = child.nextSibling;\n }\n return children;\n}\n\nfunction getNodeInSubtree(node: SyntaxNode, typeId: NodeTypeId): SyntaxNode | null {\n // first we try the current node\n if (node.type.id === typeId) {\n return node;\n }\n\n // then we try the children\n const children = getNodeChildren(node);\n for (const child of children) {\n const n = getNodeInSubtree(child, typeId);\n if (n !== null) {\n return n;\n }\n }\n\n return null;\n}\n\nfunction resolveLabelsForGrouping(node: SyntaxNode, text: string, _pos: number): Situation | null {\n const aggrExpNode = walk(node, [\n ['parent', AggregateModifier],\n ['parent', AggregateExpr],\n ]);\n if (aggrExpNode === null) {\n return null;\n }\n const bodyNode = aggrExpNode.getChild(FunctionCallBody);\n if (bodyNode === null) {\n return null;\n }\n\n const metricIdNode = getNodeInSubtree(bodyNode, Identifier);\n if (metricIdNode === null) {\n return null;\n }\n\n const metricName = getNodeText(metricIdNode, text);\n return {\n type: 'IN_GROUPING',\n metricName,\n otherLabels: [],\n };\n}\n\nfunction resolveLabelMatcher(node: SyntaxNode, text: string, _pos: number): Situation | null {\n // we can arrive here in two situation. `node` is either:\n // - a StringNode (like in `{job=\"^\"}`)\n // - or an error node (like in `{job=^}`)\n const inStringNode = !node.type.isError;\n\n const parent = walk(node, [['parent', UnquotedLabelMatcher]]);\n if (parent === null) {\n return null;\n }\n\n const labelNameNode = walk(parent, [['firstChild', LabelName]]);\n if (labelNameNode === null) {\n return null;\n }\n\n const labelName = getNodeText(labelNameNode, text);\n\n const labelMatchersNode = walk(parent, [['parent', LabelMatchers]]);\n if (labelMatchersNode === null) {\n return null;\n }\n\n // now we need to find the other names\n const allLabels = getLabels(labelMatchersNode, text);\n\n // we need to remove \"our\" label from all-labels, if it is in there\n const otherLabels = allLabels.filter((label) => label.name !== labelName);\n\n const metricNameNode = walk(labelMatchersNode, [\n ['parent', VectorSelector],\n ['firstChild', Identifier],\n ]);\n\n if (metricNameNode === null) {\n // we are probably in a situation without a metric name\n return {\n type: 'IN_LABEL_SELECTOR_WITH_LABEL_NAME',\n labelName,\n betweenQuotes: inStringNode,\n otherLabels,\n };\n }\n\n const metricName = getNodeText(metricNameNode, text);\n\n return {\n type: 'IN_LABEL_SELECTOR_WITH_LABEL_NAME',\n metricName,\n labelName,\n betweenQuotes: inStringNode,\n otherLabels,\n };\n}\n\nfunction resolveTopLevel(): Situation {\n return {\n type: 'AT_ROOT',\n };\n}\n\nfunction resolveInFunction(): Situation {\n return {\n type: 'IN_FUNCTION',\n };\n}\n\nfunction resolveDurations(): Situation {\n return {\n type: 'IN_DURATION',\n };\n}\n\nfunction resolveLabelKeysWithEquals(node: SyntaxNode, text: string, pos: number): Situation | null {\n // next false positive:\n // `something{a=\"1\"^}`\n const child = walk(node, [['firstChild', UnquotedLabelMatcher]]);\n if (child !== null) {\n // means the label-matching part contains at least one label already.\n //\n // in this case, we will need to have a `,` character at the end,\n // to be able to suggest adding the next label.\n // the area between the end-of-the-child-node and the cursor-pos\n // must contain a `,` in this case.\n const textToCheck = text.slice(child.to, pos);\n\n if (!textToCheck.includes(',')) {\n return null;\n }\n }\n\n const metricNameNode = walk(node, [\n ['parent', VectorSelector],\n ['firstChild', Identifier],\n ]);\n\n const otherLabels = getLabels(node, text);\n\n if (metricNameNode === null) {\n // we are probably in a situation without a metric name.\n return {\n type: 'IN_LABEL_SELECTOR_NO_LABEL_NAME',\n otherLabels,\n };\n }\n\n const metricName = getNodeText(metricNameNode, text);\n\n return {\n type: 'IN_LABEL_SELECTOR_NO_LABEL_NAME',\n metricName,\n otherLabels,\n };\n}\n\n// we find the first error-node in the tree that is at the cursor-position.\n// NOTE: this might be too slow, might need to optimize it\n// (ideas: we do not need to go into every subtree, based on from/to)\n// also, only go to places that are in the sub-tree of the node found\n// by default by lezer. problem is, `next()` will go upward too,\n// and we do not want to go higher than our node\nfunction getErrorNode(tree: Tree, pos: number): SyntaxNode | null {\n const cur = tree.cursorAt(pos);\n while (true) {\n if (cur.from === pos && cur.to === pos) {\n const { node } = cur;\n if (node.type.isError) {\n return node;\n }\n }\n\n if (!cur.next()) {\n break;\n }\n }\n return null;\n}\n\nexport function getSituation(text: string, pos: number): Situation | null {\n // there is a special-case when we are at the start of writing text,\n // so we handle that case first\n\n if (text === '') {\n return {\n type: 'EMPTY',\n };\n }\n\n /**\n PromQL\n Expr\n VectorSelector\n LabelMatchers\n */\n const tree = parser.parse(text);\n\n // if the tree contains error, it is very probable that\n // our node is one of those error-nodes.\n // also, if there are errors, the node lezer finds us,\n // might not be the best node.\n // so first we check if there is an error-node at the cursor-position\n const maybeErrorNode = getErrorNode(tree, pos);\n\n const cur = maybeErrorNode != null ? maybeErrorNode.cursor() : tree.cursorAt(pos);\n const currentNode = cur.node;\n\n const ids = [cur.type.id];\n while (cur.parent()) {\n ids.push(cur.type.id);\n }\n\n for (let resolver of RESOLVERS) {\n // i do not use a foreach because i want to stop as soon\n // as i find something\n if (isPathMatch(resolver.path, ids)) {\n return resolver.fun(currentNode, text, pos);\n }\n }\n\n return null;\n}\n\nfunction notEmpty<TValue>(value: TValue | null | undefined): value is TValue {\n return value !== null && value !== undefined;\n}\n","import UFuzzy from '@leeoniya/ufuzzy';\n\nimport { FUNCTIONS } from '../promql';\nimport { makeSelector, NeverCaseError } from '../util';\nimport type { DataProvider } from './DataProvider';\nimport type { Situation } from './situation';\nimport type { Label } from '../types';\n\nexport type CompletionType = 'HISTORY' | 'FUNCTION' | 'METRIC_NAME' | 'DURATION' | 'LABEL_NAME' | 'LABEL_VALUE';\n\ntype Completion = {\n type: CompletionType;\n label: string;\n insertText: string;\n detail?: string;\n documentation?: string;\n triggerOnInsert?: boolean;\n};\n\nconst metricNamesSearchClient = new UFuzzy({ intraMode: 1 });\n\n// we order items like: history, functions, metrics\nfunction getAllMetricNamesCompletions(dataProvider: DataProvider): Completion[] {\n let metricNames = dataProvider.getAllMetricNames();\n\n if (metricNames.length > dataProvider.metricNamesSuggestionLimit) {\n const { monacoSettings } = dataProvider;\n monacoSettings.enableAutocompleteSuggestionsUpdate();\n\n if (monacoSettings.inputInRange) {\n metricNames =\n metricNamesSearchClient\n .filter(metricNames, monacoSettings.inputInRange)\n ?.slice(0, dataProvider.metricNamesSuggestionLimit)\n .map((idx) => metricNames[idx]) ?? [];\n } else {\n metricNames = metricNames.slice(0, dataProvider.metricNamesSuggestionLimit);\n }\n }\n\n return dataProvider.metricNamesToMetrics(metricNames).map((metric) => ({\n type: 'METRIC_NAME',\n label: metric.name,\n insertText: metric.name,\n detail: `${metric.name} : ${metric.type}`,\n documentation: metric.help,\n }));\n}\n\nconst FUNCTION_COMPLETIONS: Completion[] = FUNCTIONS.map((f) => ({\n type: 'FUNCTION',\n label: f.label,\n insertText: f.insertText ?? '', // i don't know what to do when this is nullish. it should not be.\n detail: f.detail,\n documentation: f.documentation,\n}));\n\nasync function getAllFunctionsAndMetricNamesCompletions(dataProvider: DataProvider): Promise<Completion[]> {\n const metricNames = getAllMetricNamesCompletions(dataProvider);\n\n return [...FUNCTION_COMPLETIONS, ...metricNames];\n}\n\nconst DURATION_COMPLETIONS: Completion[] = ['1m', '5m', '10m', '30m', '1h', '1d'].map((text) => ({\n type: 'DURATION',\n label: text,\n insertText: text,\n}));\n\nconst DURATION_VARIABLES_COMPLETIONS: Completion[] = ['$__interval', '$__range', '$__rate_interval'].map((text) => ({\n type: 'DURATION',\n label: text,\n insertText: text,\n}));\n\nfunction getAllHistoryCompletions(_dataProvider: DataProvider): Completion[] {\n return [];\n // function getAllHistoryCompletions(queryHistory: PromHistoryItem[]): Completion[] {\n // NOTE: the typescript types are wrong. historyItem.query.expr can be undefined\n // const allHistory = dataProvider.getHistory();\n // FIXME: find a better history-limit\n // return allHistory.slice(0, 10).map((expr) => ({\n // type: 'HISTORY',\n // label: expr,\n // insertText: expr,\n // }));\n}\n\nasync function getLabelNames(metric: string | undefined, otherLabels: Label[], dataProvider: DataProvider): Promise<string[]> {\n if (metric === undefined || metric === '') {\n const selector = makeSelector('', otherLabels);\n return await dataProvider.fetchLabels(selector);\n } else {\n const selector = makeSelector(metric, otherLabels);\n const series = await dataProvider.fetchSeries(selector);\n const labelNames = new Set<string>();\n for (const labelSet of series) {\n for (const [key] of Object.entries(labelSet)) {\n if (key === '__name__') {\n continue;\n }\n labelNames.add(key);\n }\n }\n return Array.from(labelNames);\n }\n}\n\nasync function getLabelNamesForCompletions(\n metric: string | undefined,\n suffix: string,\n triggerOnInsert: boolean,\n otherLabels: Label[],\n dataProvider: DataProvider,\n): Promise<Completion[]> {\n const labelNames = await getLabelNames(metric, otherLabels, dataProvider);\n return labelNames.map((text) => ({\n type: 'LABEL_NAME',\n label: text,\n insertText: `${text}${suffix}`,\n triggerOnInsert,\n }));\n}\n\nasync function getLabelNamesForSelectorCompletions(metric: string | undefined, otherLabels: Label[], dataProvider: DataProvider): Promise<Completion[]> {\n return getLabelNamesForCompletions(metric, '=', true, otherLabels, dataProvider);\n}\n\nasync function getLabelNamesForByCompletions(metric: string | undefined, otherLabels: Label[], dataProvider: DataProvider): Promise<Completion[]> {\n return getLabelNamesForCompletions(metric, '', false, otherLabels, dataProvider);\n}\n\nasync function getLabelValues(metric: string | undefined, labelName: string, otherLabels: Label[], dataProvider: DataProvider): Promise<string[]> {\n if (metric === undefined || metric === '') {\n const selector = makeSelector('', otherLabels);\n return await dataProvider.fetchLabelValues(labelName, selector);\n } else {\n const selector = makeSelector(metric, otherLabels, labelName);\n const series = await dataProvider.fetchSeries(selector);\n const labelValues = new Set<string>();\n for (const labelSet of series) {\n for (const [key, value] of Object.entries(labelSet)) {\n if (key === '__name__') {\n continue;\n }\n if (key === labelName) {\n labelValues.add(value);\n }\n }\n }\n const variablesNames = dataProvider.getVariablesNames();\n return variablesNames.concat(Array.from(labelValues));\n }\n}\n\nasync function getLabelValuesForMetricCompletions(\n metric: string | undefined,\n labelName: string,\n betweenQuotes: boolean,\n otherLabels: Label[],\n dataProvider: DataProvider,\n): Promise<Completion[]> {\n const values = await getLabelValues(metric, labelName, otherLabels, dataProvider);\n return values.map((text) => ({\n type: 'LABEL_VALUE',\n label: text,\n insertText: betweenQuotes ? text : `\"${text}\"`, // FIXME: escaping strange characters?\n }));\n}\n\nexport function getCompletions(situation: Situation, dataProvider: DataProvider): Promise<Completion[]> {\n switch (situation.type) {\n case 'IN_DURATION':\n if (dataProvider.durationVariablesCompletion) {\n return Promise.resolve(DURATION_VARIABLES_COMPLETIONS.concat(DURATION_COMPLETIONS));\n }\n return Promise.resolve(DURATION_COMPLETIONS);\n case 'IN_FUNCTION':\n return getAllFunctionsAndMetricNamesCompletions(dataProvider);\n case 'AT_ROOT': {\n return getAllFunctionsAndMetricNamesCompletions(dataProvider);\n }\n case 'EMPTY': {\n const metricNames = getAllMetricNamesCompletions(dataProvider);\n const historyCompletions = getAllHistoryCompletions(dataProvider);\n return Promise.resolve([...historyCompletions, ...FUNCTION_COMPLETIONS, ...metricNames]);\n }\n case 'IN_LABEL_SELECTOR_NO_LABEL_NAME':\n return getLabelNamesForSelectorCompletions(situation.metricName, situation.otherLabels, dataProvider);\n case 'IN_GROUPING':\n return getLabelNamesForByCompletions(situation.metricName, situation.otherLabels, dataProvider);\n case 'IN_LABEL_SELECTOR_WITH_LABEL_NAME':\n return getLabelValuesForMetricCompletions(situation.metricName, situation.labelName, situation.betweenQuotes, situation.otherLabels, dataProvider);\n default:\n throw new NeverCaseError(situation);\n }\n}\n","import type * as monacoTypes from 'monaco-editor/esm/vs/editor/editor.api';\n\nimport { NeverCaseError } from '../util';\nimport { DataProvider } from './DataProvider';\nimport { getSituation } from './situation';\nimport { getCompletions } from './completions';\n\nexport type { monacoTypes };\nexport type Monaco = typeof monacoTypes;\nexport type CompletionType = 'HISTORY' | 'FUNCTION' | 'METRIC_NAME' | 'DURATION' | 'LABEL_NAME' | 'LABEL_VALUE';\n\nfunction getMonacoCompletionItemKind(type: CompletionType, monaco: Monaco): monacoTypes.languages.CompletionItemKind {\n switch (type) {\n case 'DURATION':\n return monaco.languages.CompletionItemKind.Unit;\n case 'FUNCTION':\n return monaco.languages.CompletionItemKind.Variable;\n case 'HISTORY':\n return monaco.languages.CompletionItemKind.Snippet;\n case 'LABEL_NAME':\n return monaco.languages.CompletionItemKind.Enum;\n case 'LABEL_VALUE':\n return monaco.languages.CompletionItemKind.EnumMember;\n case 'METRIC_NAME':\n return monaco.languages.CompletionItemKind.Constructor;\n default:\n throw new NeverCaseError(type);\n }\n}\n\nexport function getCompletionProvider(monaco: Monaco, dataProvider: DataProvider): monacoTypes.languages.CompletionItemProvider {\n const provideCompletionItems = (\n model: monacoTypes.editor.ITextModel,\n position: monacoTypes.Position,\n ): monacoTypes.languages.ProviderResult<monacoTypes.languages.CompletionList> => {\n const word = model.getWordAtPosition(position);\n const range =\n word != null\n ? monaco.Range.lift({\n startLineNumber: position.lineNumber,\n endLineNumber: position.lineNumber,\n startColumn: word.startColumn,\n endColumn: word.endColumn,\n })\n : monaco.Range.fromPositions(position);\n // documentation says `position` will be \"adjusted\" in `getOffsetAt`\n // i don't know what that means, to be sure i clone it\n\n const positionClone = {\n column: position.column,\n lineNumber: position.lineNumber,\n };\n dataProvider.monacoSettings.setInputInRange(model.getValueInRange(range));\n\n // Check to see if the browser supports window.getSelection()\n if (window.getSelection) {\n const selectedText = window.getSelection()?.toString();\n // If the user has selected text, adjust the cursor position to be at the start of the selection, instead of the end\n if (selectedText && selectedText.length > 0) {\n positionClone.column = positionClone.column - selectedText.length;\n }\n }\n\n const offset = model.getOffsetAt(positionClone);\n const situation = getSituation(model.getValue(), offset);\n const completionsPromise = situation != null ? getCompletions(situation, dataProvider) : Promise.resolve([]);\n\n return completionsPromise.then((items) => {\n // monaco by-default alphabetically orders the items.\n // to stop it, we use a number-as-string sortkey,\n // so that monaco keeps the order we use\n const maxIndexDigits = items.length.toString().length;\n const suggestions: monacoTypes.languages.CompletionItem[] = items.map((item, index) => ({\n kind: getMonacoCompletionItemKind(item.type, monaco),\n label: item.label,\n insertText: item.insertText,\n detail: item.detail,\n documentation: item.documentation,\n sortText: index.toString().padStart(maxIndexDigits, '0'), // to force the order we have\n range,\n command: item.triggerOnInsert\n ? {\n id: 'editor.action.triggerSuggest',\n title: '',\n }\n : undefined,\n }));\n return { suggestions, incomplete: dataProvider.monacoSettings.suggestionsIncomplete };\n });\n };\n\n return {\n triggerCharacters: ['{', ',', '[', '(', '=', '~', ' ', '\"'],\n provideCompletionItems,\n };\n}\n","import { SyntaxNode } from '@lezer/common';\nimport { LRParser } from '@lezer/lr';\n\nexport const ErrorId = 0;\n\ninterface ParserErrorBoundary {\n startLineNumber: number;\n startColumn: number;\n endLineNumber: number;\n endColumn: number;\n error: string;\n}\n\ninterface ParseError {\n text: string;\n node: SyntaxNode;\n}\n\nexport function validateQuery(query: string, interpolatedQuery: string, queryLines: string[], parser: LRParser): ParserErrorBoundary[] | false {\n if (!query) {\n return false;\n }\n\n const interpolatedErrors: ParseError[] = parseQuery(interpolatedQuery, parser);\n if (!interpolatedErrors.length) {\n return false;\n }\n\n let parseErrors: ParseError[] = interpolatedErrors;\n if (query !== interpolatedQuery) {\n const queryErrors: ParseError[] = parseQuery(query, parser);\n parseErrors = interpolatedErrors.flatMap((interpolatedError) => queryErrors.filter((queryError) => interpolatedError.text === queryError.text) || interpolatedError);\n }\n\n return parseErrors.map((parseError) => findErrorBoundary(query, queryLines, parseError)).filter(isErrorBoundary);\n}\n\nfunction parseQuery(query: string, parser: LRParser) {\n const parseErrors: ParseError[] = [];\n const tree = parser.parse(query);\n tree.iterate({\n enter: (nodeRef): false | void => {\n if (nodeRef.type.id === ErrorId) {\n const node = nodeRef.node;\n parseErrors.push({\n node: node,\n text: query.substring(node.from, node.to),\n });\n }\n },\n });\n return parseErrors;\n}\n\nfunction findErrorBoundary(query: string, queryLines: string[], parseError: ParseError): ParserErrorBoundary | null {\n if (queryLines.length === 1) {\n const isEmptyString = parseError.node.from === parseError.node.to;\n const errorNode = isEmptyString && parseError.node.parent ? parseError.node.parent : parseError.node;\n const error = isEmptyString ? query.substring(errorNode.from, errorNode.to) : parseError.text;\n return {\n startLineNumber: 1,\n startColumn: errorNode.from + 1,\n endLineNumber: 1,\n endColumn: errorNode.to + 1,\n error,\n };\n }\n\n let startPos = 0,\n endPos = 0;\n for (let line = 0; line < queryLines.length; line++) {\n endPos = startPos + queryLines[line].length;\n\n if (parseError.node.from > endPos) {\n startPos += queryLines[line].length + 1;\n continue;\n }\n\n return {\n startLineNumber: line + 1,\n startColumn: parseError.node.from - startPos + 1,\n endLineNumber: line + 1,\n endColumn: parseError.node.to - startPos + 1,\n error: parseError.text,\n };\n }\n\n return null;\n}\n\nfunction isErrorBoundary(boundary: ParserErrorBoundary | null): boundary is ParserErrorBoundary {\n return boundary !== null;\n}\n","import React, { useEffect, useRef } from 'react';\nimport MonacoEditor from 'react-monaco-editor';\nimport * as monaco from 'monaco-editor';\nimport { promLanguageDefinition } from 'monaco-promql';\nimport type * as monacoTypes from 'monaco-editor/esm/vs/editor/editor.api';\nimport { parser } from '@fc-components/lezer-metricsql';\nimport { v4 as uuidv4 } from 'uuid';\nimport { css } from '@emotion/css';\n\nimport { language, languageConfiguration } from './promql';\nimport { DataProvider } from './completion/DataProvider';\nimport { getCompletionProvider } from './completion/getCompletionProvider';\nimport type { DataProviderParams } from './types';\nimport { validateQuery } from './validation';\n\ninterface PromQLEditorProps {\n size?: 'small' | 'middle' | 'large';\n theme?: 'light' | 'dark';\n value?: string;\n placeholder?: string;\n enableAutocomplete?: boolean;\n durationVariablesCompletion?: boolean;\n readOnly?: boolean;\n disabled?: boolean;\n interpolateString?: (query: string) => string;\n onChange?: (value: string) => void;\n onShiftEnter?: (value: string) => void;\n onBlur?: (value: string) => void;\n editorDidMount?: (editor: monacoTypes.editor.IStandaloneCodeEditor) => void;\n}\n\nconst PROMQL_LANG_ID = promLanguageDefinition.id;\nconst SIZE_MAP: Record<\n string,\n {\n className: string;\n top: number;\n bottom: number;\n }\n> = {\n small: {\n className: 'ant-input-sm',\n top: 1,\n bottom: 1,\n },\n middle: {\n className: 'ant-input-md',\n top: 1,\n bottom: 1,\n },\n large: {\n className: 'ant-input-lg',\n top: 3,\n bottom: 2,\n },\n};\nconst themeMap: Record<string, string> = {\n light: 'n9e-light',\n dark: 'n9e-dark',\n};\n\nconst containerDisabledClassName = css`\n .monaco-editor {\n user-select: none;\n pointer-events: none;\n }\n`;\n\nconst containerReadOnlyClassName = css`\n .monaco-editor .cursors-layer > .cursor {\n opacity: 0 !important; /* 完全透明 */\n }\n`;\n\nconst getStyles = (placeholder?: string) => {\n return {\n placeholder: css({\n '::after': {\n content: `'${placeholder}'`,\n opacity: 0.6,\n },\n }),\n };\n};\n\nexport default function PromQLEditor(props: PromQLEditorProps & DataProviderParams) {\n const id = uuidv4();\n const {\n size = 'middle',\n theme = 'light',\n value,\n placeholder,\n interpolateString,\n enableAutocomplete = true,\n readOnly = false,\n disabled = false,\n onChange,\n onShiftEnter,\n onBlur,\n editorDidMount,\n } = props;\n const autocompleteDisposeFun = useRef<(() => void) | null>(null);\n const containerRef = useRef<HTMLDivElement>(null);\n const dataProviderRef = useRef<DataProvider | null>(null);\n const editorRef = useRef<monacoTypes.editor.IStandaloneCodeEditor | null>(null);\n const styles = getStyles(placeholder);\n const handleEditorDidMount = (editor: monacoTypes.editor.IStandaloneCodeEditor) => {\n editorRef.current = editor;\n\n monaco.editor.defineTheme('n9e-light', {\n base: 'vs',\n inherit: true,\n rules: [],\n colors: {\n 'editor.background': '#00000000',\n focusBorder: '#00000000',\n },\n });\n\n monaco.editor.defineTheme('n9e-dark', {\n base: 'vs-dark',\n inherit: true,\n rules: [],\n colors: {\n 'editor.background': '#00000000',\n focusBorder: '#00000000',\n },\n });\n\n const isEditorFocused = editor.createContextKey<boolean>('isEditorFocused' + id, false);\n // we setup on-blur\n editor.onDidBlurEditorWidget(() => {\n isEditorFocused.set(false);\n onBlur?.(editor.getValue());\n // reset the selection to the current position\n const position = editor.getPosition();\n if (position) {\n const newSelection = new monaco.Selection(position.lineNumber, position.column, position.lineNumber, position.column);\n editor.setSelection(newSelection);\n }\n });\n\n editor.onDidFocusEditorText(() => {\n isEditorFocused.set(true);\n });\n\n // set the height of the editor container\n const updateElementHeight = () => {\n const containerDiv = containerRef.current;\n if (containerDiv !== null) {\n const pixelHeight = editor.getContentHeight();\n containerDiv.style.height = `${pixelHeight}px`;\n containerDiv.style.width = '100%';\n const pixelWidth = containerDiv.clientWidth;\n editor.layout({ width: pixelWidth, height: pixelHeight });\n }\n };\n\n editor.onDidContentSizeChange(updateElementHeight);\n updateElementHeight();\n\n // Fixes Monaco capturing the search key binding and displaying a useless search box within the Editor.\n monaco.editor.addKeybindingRule({\n keybinding: monaco.KeyMod.CtrlCmd | monaco.KeyCode.KeyF,\n command: null,\n });\n\n // handle: shift + enter\n editor.addCommand(\n monaco.KeyMod.Shift | monaco.KeyCode.Enter,\n () => {\n onShiftEnter?.(editor.getValue());\n },\n 'isEditorFocused' + id,\n );\n\n editor.onDidChangeModelContent(() => {\n const model = editor.getModel();\n if (model) {\n const query = model.getValue();\n const errors = validateQuery(query, interpolateString ? interpolateString(query) : query, model.getLinesContent(), parser) || [];\n const markers = errors.map(({ error, ...boundary }) => ({\n message: `${error ? `Error parsing \"${error}\"` : 'Parse error'}. The query appears to be incorrect and could fail to be executed.`,\n severity: monaco.MarkerSeverity.Error,\n ...boundary,\n }));\n\n monaco.editor.setModelMarkers(model, 'owner', markers);\n }\n });\n\n editorDidMount?.(editor);\n };\n\n useEffect(() => {\n // 注册 PromQL 语言\n const { aliases, extensions, mimetypes } = promLanguageDefinition;\n monaco.languages.register({\n id: PROMQL_LANG_ID,\n aliases,\n extensions,\n mimetypes,\n });\n\n // 设置语法高亮\n monaco.languages.setMonarchTokensProvider(PROMQL_LANG_ID, language as any);\n\n // 设置语言配置\n monaco.languages.setLanguageConfiguration(PROMQL_LANG_ID, languageConfiguration as any);\n\n return () => {\n autocompleteDisposeFun.current?.();\n dataProviderRef.current = null;\n };\n }, []);\n\n useEffect(() => {\n const editor = editorRef.current;\n if (!editor) return;\n\n // clean up previous autocomplete provider\n if (autocompleteDisposeFun.current) {\n autocompleteDisposeFun.current();\n autocompleteDisposeFun.current = null;\n }\n dataProviderRef.current = null;\n\n // If autocomplete is enabled, set up a new autocomplete provider\n if (enableAutocomplete) {\n const dataProvider = new DataProvider({\n url: props.url,\n lookbackInterval: props.lookbackInterval,\n variablesNames: props.variablesNames,\n durationVariablesCompletion: props.durationVariablesCompletion,\n request: props.request,\n httpMethod: props.httpMethod,\n apiPrefix: props.apiPrefix,\n httpErrorHandler: props.httpErrorHandler,\n });\n dataProviderRef.current = dataProvider;\n dataProvider.start();\n\n const completionProvider = getCompletionProvider(monaco, dataProvider);\n\n const filteringCompletionProvider: monacoTypes.languages.CompletionItemProvider = {\n ...completionProvider,\n provideCompletionItems: (model, position, context, token) => {\n if (editor.getModel()?.id !== model.id) {\n return { suggestions: [] };\n }\n return completionProvider.provideCompletionItems(model, position, context, token);\n },\n };\n\n const { dispose } = monaco.languages.registerCompletionItemProvider(PROMQL_LANG_ID, filteringCompletionProvider);\n autocompleteDisposeFun.current = dispose;\n }\n\n // clean up previous placeholder decorations\n const model = editor.getModel();\n if (model) {\n model.deltaDecorations(\n model.getAllDecorations().map((d) => d.id),\n [],\n );\n }\n\n if (placeholder) {\n const placeholderDecorators = [\n {\n range: new monaco.Range(1, 1, 1, 1),\n options: {\n className: styles.placeholder,\n isWholeLine: true,\n },\n },\n ];\n\n let decorators: string[] = [];\n\n const checkDecorators: () => void = () => {\n const model = editor.getModel();\n\n if (!model) {\n return;\n }\n\n const newDecorators = model.getValueLength() === 0 ? placeholderDecorators : [];\n decorators = model.deltaDecorations(decorators, newDecorators);\n };\n\n checkDecorators();\n editor.onDidChangeModelContent(checkDecorators);\n }\n }, [\n enableAutocomplete,\n props.url,\n props.lookbackInterval,\n JSON.stringify(props.variablesNames),\n props.durationVariablesCompletion,\n props.httpMethod,\n props.apiPrefix,\n placeholder,\n ]);\n\n return (\n <div\n className={\n 'ant-input' +\n (size ? ` ${SIZE_MAP[size].className}` : '') +\n (disabled ? ` ant-input-disabled ${containerDisabledClassName}` : '') +\n (readOnly ? ` ${containerReadOnlyClassName}` : '')\n }\n >\n <div ref={containerRef}>\n <MonacoEditor\n width='100%'\n height='100%'\n language='promql'\n theme={themeMap[theme]}\n value={value}\n onChange={onChange}\n editorDidMount={handleEditorDidMount}\n options={{\n readOnly,\n codeLens: false,\n contextmenu: false,\n fixedOverflowWidgets: true,\n folding: false,\n fontSize: 12,\n lineDecorationsWidth: 0,\n lineNumbers: 'off',\n minimap: { enabled: false },\n overviewRulerBorder: false,\n overviewRulerLanes: 0,\n padding: {\n top: SIZE_MAP[size].top,\n bottom: SIZE_MAP[size].bottom,\n },\n renderLineHighlight: 'none',\n scrollbar: {\n vertical: 'hidden',\n verticalScrollbarSize: 8,\n horizontal: 'hidden',\n horizontalScrollbarSize: 0,\n alwaysConsumeMouseWheel: false,\n },\n scrollBeyondLastLine: false,\n suggest: {\n showWords: false,\n },\n suggestFontSize: 12,\n wordWrap: 'on',\n automaticLayout: true,\n occurrencesHighlight: 'off', // Disable word highlighting\n }}\n />\n </div>\n </div>\n );\n}\n"],"names":["languageConfiguration","wordPattern","comments","lineComment","brackets","autoClosingPairs","open","close","surroundingPairs","folding","aggregations","functions","aggregationsOverTime","_i","aggregations_1","length","agg","push","vectorMatching","vectorMatchingRegex","reduce","prev","curr","operators","offsetModifier","keywords","concat","language","ignoreCase","defaultToken","tokenPostfix","symbols","escapes","digits","octaldigits","binarydigits","hexdigits","integersuffix","floatsuffix","tokenizer","root","cases","include","string_double","string_single","string_backtick","clauses","whitespace","TRIGONOMETRIC_FUNCTIONS","label","insertText","detail","documentation","AGGREGATION_OPERATORS","FUNCTIONS","NeverCaseError","_Error","_value","call","_inheritsLoose","_wrapNativeSuper","Error","escapeLabelValueInExactSelector","labelValue","replace","makeSelector","metricName","labels","labelName","allLabels","filter","name","value","allLabelTexts","map","op","join","DEFAULT_SERIES_LIMIT","badRequest","unprocessableEntity","serviceUnavailable","CODE_MODE_SUGGESTIONS_INCOMPLETE_EVENT","DataProvider","params","input","init","fetch","_ref","_asyncToGenerator","_regenerator","m","_callee","selector","withLimit","end","start","url","urlParams","request","w","_context","n","Date","getTime","_this","lookbackInterval","apiPrefix","toISOString","_extends","limit","buildRequest","URLSearchParams","uri","method","httpMethod","body","a","v","_x","_x2","apply","arguments","_ref2","_callee2","_context2","then","res","labelKeys","_x3","_ref3","_callee3","_context3","_x4","_x5","_callee4","_t","_context4","fetchLabelValues","metrics","Promise","all","loadMetricsMetadata","inputInRange","metricNamesSuggestionLimit","suggestionsIncomplete","errorHandler","httpErrorHandler","variablesNames","durationVariablesCompletion","_params$durationVaria","customRequest","_proto","prototype","getVariablesNames","setVariablesNames","endpoint","resource","ok","includes","status","statusText","json","apiRes","error","undefined","_this2","data","getAllMetricNames","_loadMetricsMetadata","_callee5","_context5","metricsMetadata","metricNamesToMetrics","metricNames","result","metaItem","_this3$metricsMetadat","_this3","help","_metaItem$help","type","_metaItem$type","setInputInRange","textInput","enableAutocompleteSuggestionsUpdate","dispatchEvent","CustomEvent","_createClass","key","get","bind","move","node","direction","parent","firstChild","lastChild","nextSibling","walk","path","current","_iterator","_createForOfIteratorHelperLoose","_step","done","_step$value","expectedType","id","getNodeText","text","slice","from","to","parsePromQLStringLiteral","inside","startsWith","endsWith","isPathMatch","resolverPath","cursorPath","every","item","index","ERROR_NODE_NAME","RESOLVERS","LabelMatchers","VectorSelector","fun","resolveLabelKeysWithEquals","PromQL","resolveTopLevel","FunctionCallBody","resolveInFunction","StringLiteral","UnquotedLabelMatcher","resolveLabelMatcher","BinaryExpr","NumberDurationLiteralInDurationContext","MatrixSelector","resolveDurations","GroupingLabels","resolveLabelsForGrouping","LABEL_OP_MAP","Map","EqlSingle","EqlRegex","Neq","NeqRegex","getLabelOp","opNode","opChild","_LABEL_OP_MAP$get","getLabel","labelMatcherNode","nameNode","LabelName","MatchOp","valueNode","getLabels","labelMatchersNode","labelNodes","getChildren","ln","notEmpty","getNodeChildren","child","children","getNodeInSubtree","typeId","_iterator2","_step2","_pos","aggrExpNode","AggregateModifier","AggregateExpr","bodyNode","getChild","metricIdNode","Identifier","otherLabels","inStringNode","isError","labelNameNode","metricNameNode","betweenQuotes","pos","textToCheck","getErrorNode","tree","cur","cursorAt","next","getSituation","parser","parse","maybeErrorNode","cursor","currentNode","ids","_iterator3","_step3","resolver","metricNamesSearchClient","UFuzzy","intraMode","getAllMetricNamesCompletions","dataProvider","monacoSettings","_metricNamesSearchCli","_metricNamesSearchCli2","idx","metric","FUNCTION_COMPLETIONS","f","_f$insertText","getAllFunctionsAndMetricNamesCompletions","_getAllFunctionsAndMetricNamesCompletions","DURATION_COMPLETIONS","DURATION_VARIABLES_COMPLETIONS","getAllHistoryCompletions","_dataProvider","getLabelNames","_getLabelNames","_selector","series","labelNames","labelSet","_Object$entries","_Object$entries$_i","fetchLabels","fetchSeries","Set","Object","entries","add","Array","getLabelNamesForCompletions","_x6","_x7","_x8","_x9","_getLabelNamesForCompletions","suffix","triggerOnInsert","getLabelNamesForSelectorCompletions","_x0","_x1","_x10","_getLabelNamesForSelectorCompletions","getLabelNamesForByCompletions","_x11","_x12","_x13","_getLabelNamesForByCompletions","getLabelValues","_x14","_x15","_x16","_x17","_getLabelValues","_callee6","_selector2","labelValues","_i2","_Object$entries2","_Object$entries2$_i","_context6","getLabelValuesForMetricCompletions","_x18","_x19","_x20","_x21","_x22","_getLabelValuesForMetricCompletions","_callee7","values","_context7","getCompletions","situation","resolve","historyCompletions","getMonacoCompletionItemKind","monaco","languages","CompletionItemKind","Unit","Variable","Snippet","Enum","EnumMember","Constructor","getCompletionProvider","provideCompletionItems","model","position","word","getWordAtPosition","range","Range","lift","startLineNumber","lineNumber","endLineNumber","startColumn","endColumn","fromPositions","positionClone","column","getValueInRange","window","getSelection","_window$getSelection","selectedText","toString","offset","getOffsetAt","getValue","completionsPromise","items","maxIndexDigits","suggestions","kind","sortText","padStart","command","title","incomplete","triggerCharacters","ErrorId","validateQuery","query","interpolatedQuery","queryLines","interpolatedErrors","parseQuery","parseErrors","queryErrors","flatMap","interpolatedError","queryError","parseError","findErrorBoundary","isErrorBoundary","iterate","enter","nodeRef","substring","isEmptyString","errorNode","startPos","endPos","line","boundary","PROMQL_LANG_ID","promLanguageDefinition","SIZE_MAP","small","className","top","bottom","middle","large","themeMap","light","dark","containerDisabledClassName","css","_templateObject","_taggedTemplateLiteralLoose","containerReadOnlyClassName","_templateObject2","getStyles","placeholder","content","opacity","PromQLEditor","props","uuidv4","_props$size","size","_props$theme","theme","interpolateString","_props$enableAutocomp","enableAutocomplete","_props$readOnly","readOnly","_props$disabled","disabled","onChange","onShiftEnter","onBlur","editorDidMount","autocompleteDisposeFun","useRef","containerRef","dataProviderRef","editorRef","styles","handleEditorDidMount","editor","defineTheme","base","inherit","rules","colors","focusBorder","isEditorFocused","createContextKey","onDidBlurEditorWidget","set","getPosition","newSelection","setSelection","onDidFocusEditorText","updateElementHeight","containerDiv","pixelHeight","getContentHeight","style","height","width","pixelWidth","clientWidth","layout","onDidContentSizeChange","addKeybindingRule","keybinding","CtrlCmd","KeyF","addCommand","Shift","Enter","onDidChangeModelContent","getModel","errors","getLinesContent","markers","_objectWithoutPropertiesLoose","_excluded","message","severity","setModelMarkers","useEffect","aliases","extensions","mimetypes","register","setMonarchTokensProvider","setLanguageConfiguration","completionProvider","filteringCompletionProvider","context","token","_editor$getModel","_monaco$languages$reg","registerCompletionItemProvider","dispose","deltaDecorations","getAllDecorations","d","placeholderDecorators","options","isWholeLine","decorators","checkDecorators","newDecorators","getValueLength","JSON","stringify","React","ref","MonacoEditor","codeLens","contextmenu","fixedOverflowWidgets","fontSize","lineDecorationsWidth","lineNumbers","minimap","enabled","overviewRulerBorder","overviewRulerLanes","padding","renderLineHighlight","scrollbar","vertical","verticalScrollbarSize","horizontal","horizontalScrollbarSize","alwaysConsumeMouseWheel","scrollBeyondLastLine","suggest","showWords","suggestFontSize","wordWrap","automaticLayout","occurrencesHighlight"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAO,IAAMA,qBAAqB,GAAG;;EAEnCC,WAAW,EAAE,4DAA4D;;EAEzEC,QAAQ,EAAE;IACRC,WA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Q;QAClBC,qBAAqB,EAAE,CAAC;QACxBC,UAAU,EAAE,QAAQ;QACpBC,uBAAuB,EAAE,CAAC;QAC1BC,uBAAuB,EAAE;OAC1B;MACDC,oBAAoB,EAAE,KAAK;MAC3BC,OAAO,EAAE;QACPC,SAAS,EAAE;OACZ;MACDC,eAAe,EAAE,EAAE;MACnBC,QAAQ,EAAE,IAAI;MACdC,eAAe,EAAE,IAAI;MACrBC,oBAAoB,EAAE;;IAExB,CACE,CACF;AAEV;;;;"}
|
|
1
|
+
{"version":3,"file":"monaco-editor.esm.js","sources":["../src/promql/promql.ts","../src/promql/util.ts","../src/promql/completion/DataProvider.ts","../src/promql/completion/situation.ts","../src/promql/completion/completions.ts","../src/promql/completion/getCompletionProvider.ts","../src/promql/validation.ts","../src/promql/index.tsx"],"sourcesContent":["export const languageConfiguration = {\n // the default separators except `@$`\n wordPattern: /(-?\\d*\\.\\d\\w*)|([^`~!#%^&*()\\-=+\\[{\\]}\\\\|;:'\",.<>\\/?\\s]+)/g,\n // Not possible to make comments in PromQL syntax\n comments: {\n lineComment: '#',\n },\n brackets: [\n ['{', '}'],\n ['[', ']'],\n ['(', ')'],\n ],\n autoClosingPairs: [\n { open: '{', close: '}' },\n { open: '[', close: ']' },\n { open: '(', close: ')' },\n { open: '\"', close: '\"' },\n { open: \"'\", close: \"'\" },\n ],\n surroundingPairs: [\n { open: '{', close: '}' },\n { open: '[', close: ']' },\n { open: '(', close: ')' },\n { open: '\"', close: '\"' },\n { open: \"'\", close: \"'\" },\n { open: '<', close: '>' },\n ],\n folding: {},\n};\n// PromQL Aggregation Operators\n// (https://prometheus.io/docs/prometheus/latest/querying/operators/#aggregation-operators)\nconst aggregations = [\n 'sum',\n 'min',\n 'max',\n 'avg',\n 'group',\n 'stddev',\n 'stdvar',\n 'count',\n 'count_values',\n 'bottomk',\n 'topk',\n 'quantile',\n 'quantiles',\n 'distinct',\n 'geomean',\n 'histogram',\n 'mad',\n 'mode',\n // metricsql aggregations\n 'any',\n 'bottomk_avg',\n 'bottomk_max',\n 'bottomk_median',\n 'bottomk_last',\n 'bottomk_min',\n 'topk_avg',\n 'topk_max',\n 'topk_median',\n 'topk_last',\n 'topk_min',\n 'outliers_mad',\n 'outliersk',\n 'share',\n 'sum2',\n 'zscore',\n];\n// PromQL functions\n// (https://prometheus.io/docs/prometheus/latest/querying/functions/)\nconst functions = [\n 'abs',\n 'absent',\n 'ceil',\n 'changes',\n 'clamp_max',\n 'clamp_min',\n 'day_of_month',\n 'day_of_week',\n 'days_in_month',\n 'delta',\n 'deriv',\n 'exp',\n 'floor',\n 'histogram_quantile',\n 'histogram_avg',\n 'histogram_count',\n 'histogram_sum',\n 'histogram_fraction',\n 'histogram_stddev',\n 'histogram_stdvar',\n 'holt_winters',\n 'hour',\n 'idelta',\n 'increase',\n 'irate',\n 'label_join',\n 'label_replace',\n 'ln',\n 'log2',\n 'log10',\n 'minute',\n 'month',\n 'predict_linear',\n 'rate',\n 'resets',\n 'round',\n 'scalar',\n 'sort',\n 'sort_desc',\n 'sqrt',\n 'time',\n 'timestamp',\n 'vector',\n 'year',\n // metricsql functions\n 'aggr_over_time',\n 'alias',\n 'ascent_over_time',\n 'bitmap_and',\n 'bitmap_or',\n 'bitmap_xor',\n 'buckets_limit',\n 'changes_prometheus',\n 'count_eq_over_time',\n 'count_gt_over_time',\n 'count_le_over_time',\n 'count_ne_over_time',\n 'decreases_over_time',\n 'default_rollup',\n 'delta_prometheus',\n 'deriv_fast',\n 'descent_over_time',\n 'distinct_over_time',\n 'drop_common_labels',\n 'duration_over_time',\n 'first_over_time',\n 'geomean_over_time',\n 'histogram_avg',\n 'histogram_over_time',\n 'histogram_quantiles',\n 'histogram_share',\n 'hoeffding_bound_lower',\n 'hoeffding_bound_upper',\n 'ideriv',\n 'increase_prometheus',\n 'increase_pure',\n 'increases_over_time',\n 'integrate',\n 'interpolate',\n 'keep_last_value',\n 'keep_next_value',\n 'label_copy',\n 'label_del',\n 'label_graphite_group',\n 'label_keep',\n 'label_lowercase',\n 'label_map',\n 'label_match',\n 'label_mismatch',\n 'label_move',\n 'label_set',\n 'label_transform',\n 'label_uppercase',\n 'label_value',\n 'lag',\n 'lifetime',\n 'limit_offset',\n 'mad_over_time',\n 'median_over_time',\n 'mode_over_time',\n 'now',\n 'prometheus_buckets',\n 'quantiles_over_time',\n 'rand',\n 'rand_exponential',\n 'rand_normal',\n 'range_avg',\n 'range_first',\n 'range_last',\n 'range_linear_regression',\n 'range_mad',\n 'range_max',\n 'range_min',\n 'range_normalize',\n 'range_over_time',\n 'range_quantile',\n 'range_stddev',\n 'range_stdvar',\n 'range_sum',\n 'range_trim_outliers',\n 'range_trim_spikes',\n 'range_trim_zscore',\n 'range_zscore',\n 'rate_over_sum',\n 'remove_resets',\n 'rollup',\n 'rollup_candlestick',\n 'rollup_delta',\n 'rollup_deriv',\n 'rollup_increase',\n 'rollup_rate',\n 'rollup_scrape_interval',\n 'running_avg',\n 'running_max',\n 'running_min',\n 'running_sum',\n 'scrape_interval',\n 'share_eq_over_time',\n 'share_gt_over_time',\n 'share_le_over_time',\n 'smooth_exponential',\n 'smooth_exponential',\n 'sort_by_label_desc',\n 'sort_by_label_numeric',\n 'sort_by_label_numeric_desc',\n 'stale_samples_over_time',\n 'step',\n 'sum2_over_time',\n 'tfirst_over_time',\n 'timestamp_with_name',\n 'timezone_offset',\n 'tlast_change_over_time',\n 'tlast_over_time',\n 'tmax_over_time',\n 'tmin_over_time',\n 'union',\n 'zscore_over_time',\n 'avg_daily',\n 'median_daily',\n 'avg_weekly',\n 'median_weekly',\n 'median_weekly_with_trends',\n];\n// PromQL specific functions: Aggregations over time\n// (https://prometheus.io/docs/prometheus/latest/querying/functions/#aggregation_over_time)\nconst aggregationsOverTime: string[] = [];\nfor (let _i = 0, aggregations_1 = aggregations; _i < aggregations_1.length; _i++) {\n let agg = aggregations_1[_i];\n aggregationsOverTime.push(agg + '_over_time');\n}\n\n// PromQL vector matching + the by and without clauses\n// (https://prometheus.io/docs/prometheus/latest/querying/operators/#vector-matching)\nconst vectorMatching = ['on', 'ignoring', 'group_right', 'group_left', 'by', 'without'];\n// Produce a regex matching elements : (elt1|elt2|...)\nconst vectorMatchingRegex =\n '(' +\n vectorMatching.reduce(function (prev, curr) {\n return prev + '|' + curr;\n }) +\n ')';\n// PromQL Operators\n// (https://prometheus.io/docs/prometheus/latest/querying/operators/)\nconst operators = ['+', '-', '*', '/', '%', '^', '==', '!=', '>', '<', '>=', '<=', 'and', 'or', 'unless'];\n// PromQL offset modifier\n// (https://prometheus.io/docs/prometheus/latest/querying/basics/#offset-modifier)\nconst offsetModifier = ['offset'];\n// Merging all the keywords in one list\nconst keywords = aggregations.concat(functions).concat(aggregationsOverTime).concat(vectorMatching).concat(offsetModifier);\n// noinspection JSUnusedGlobalSymbols\nexport const language = {\n ignoreCase: false,\n defaultToken: '',\n tokenPostfix: '.promql',\n keywords: keywords,\n operators: operators,\n vectorMatching: vectorMatchingRegex,\n // we include these common regular expressions\n symbols: /[=><!~?:&|+\\-*\\/^%]+/,\n escapes: /\\\\(?:[abfnrtv\\\\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,\n digits: /\\d+(_+\\d+)*/,\n octaldigits: /[0-7]+(_+[0-7]+)*/,\n binarydigits: /[0-1]+(_+[0-1]+)*/,\n hexdigits: /[[0-9a-fA-F]+(_+[0-9a-fA-F]+)*/,\n integersuffix: /(ll|LL|u|U|l|L)?(ll|LL|u|U|l|L)?/,\n floatsuffix: /[fFlL]?/,\n // The main tokenizer for our languages\n tokenizer: {\n root: [\n // 'by', 'without' and vector matching\n [/@vectorMatching\\s*(?=\\()/, 'type', '@clauses'],\n // labels\n [/[a-z_]\\w*(?=\\s*(=|!=|=~|!~))/, 'tag'],\n // comments\n [/(^#.*$)/, 'comment'],\n // all keywords have the same color\n [\n /[a-zA-Z_]\\w*/,\n {\n cases: {\n '@keywords': 'type',\n '@default': 'identifier',\n },\n },\n ],\n // strings\n [/\"([^\"\\\\]|\\\\.)*$/, 'string.invalid'],\n [/'([^'\\\\]|\\\\.)*$/, 'string.invalid'],\n [/\"/, 'string', '@string_double'],\n [/'/, 'string', '@string_single'],\n [/`/, 'string', '@string_backtick'],\n // whitespace\n { include: '@whitespace' },\n // delimiters and operators\n [/[{}()\\[\\]]/, '@brackets'],\n [/[<>](?!@symbols)/, '@brackets'],\n [\n /@symbols/,\n {\n cases: {\n '@operators': 'delimiter',\n '@default': '',\n },\n },\n ],\n // numbers\n [/\\d+[smhdwy]/, 'number'],\n [/\\d*\\d+[eE]([\\-+]?\\d+)?(@floatsuffix)/, 'number.float'],\n [/\\d*\\.\\d+([eE][\\-+]?\\d+)?(@floatsuffix)/, 'number.float'],\n [/0[xX][0-9a-fA-F']*[0-9a-fA-F](@integersuffix)/, 'number.hex'],\n [/0[0-7']*[0-7](@integersuffix)/, 'number.octal'],\n [/0[bB][0-1']*[0-1](@integersuffix)/, 'number.binary'],\n [/\\d[\\d']*\\d(@integersuffix)/, 'number'],\n [/\\d(@integersuffix)/, 'number'],\n ],\n string_double: [\n [/[^\\\\\"]+/, 'string'],\n [/@escapes/, 'string.escape'],\n [/\\\\./, 'string.escape.invalid'],\n [/\"/, 'string', '@pop'],\n ],\n string_single: [\n [/[^\\\\']+/, 'string'],\n [/@escapes/, 'string.escape'],\n [/\\\\./, 'string.escape.invalid'],\n [/'/, 'string', '@pop'],\n ],\n string_backtick: [\n [/[^\\\\`$]+/, 'string'],\n [/@escapes/, 'string.escape'],\n [/\\\\./, 'string.escape.invalid'],\n [/`/, 'string', '@pop'],\n ],\n clauses: [\n [/[^(,)]/, 'tag'],\n [/\\)/, 'identifier', '@pop'],\n ],\n whitespace: [[/[ \\t\\r\\n]+/, 'white']],\n },\n};\n// noinspection JSUnusedGlobalSymbols\n// export const completionItemProvider = {\n// provideCompletionItems: function () {\n// // To simplify, we made the choice to never create automatically the parenthesis behind keywords\n// // It is because in PromQL, some keywords need parenthesis behind, some don't, some can have but it's optional.\n// const suggestions = keywords.map(function (value) {\n// return {\n// label: value,\n// kind: languages.CompletionItemKind.Keyword,\n// insertText: value,\n// insertTextRules: languages.CompletionItemInsertTextRule.InsertAsSnippet\n// };\n// });\n// return { suggestions: suggestions };\n// }\n// };\n\ninterface CompletionItem {\n label: string;\n insertText: string;\n detail?: string;\n documentation?: string;\n}\n\nconst TRIGONOMETRIC_FUNCTIONS: CompletionItem[] = [\n {\n label: 'acos',\n insertText: 'acos',\n detail: 'acos(v instant-vector)',\n documentation: 'calculates the arccosine of all elements in v',\n },\n {\n label: 'acosh',\n insertText: 'acosh',\n detail: 'acosh(v instant-vector)',\n documentation: 'calculates the inverse hyperbolic cosine of all elements in v',\n },\n {\n label: 'asin',\n insertText: 'asin',\n detail: 'asin(v instant-vector)',\n documentation: 'calculates the arcsine of all elements in v',\n },\n {\n label: 'asinh',\n insertText: 'asinh',\n detail: 'asinh(v instant-vector)',\n documentation: 'calculates the inverse hyperbolic sine of all elements in v',\n },\n {\n label: 'atan',\n insertText: 'atan',\n detail: 'atan(v instant-vector)',\n documentation: 'calculates the arctangent of all elements in v',\n },\n {\n label: 'atanh',\n insertText: 'atanh',\n detail: 'atanh(v instant-vector)',\n documentation: 'calculates the inverse hyperbolic tangent of all elements in v',\n },\n {\n label: 'cos',\n insertText: 'cos',\n detail: 'cos(v instant-vector)',\n documentation: 'calculates the cosine of all elements in v',\n },\n {\n label: 'cosh',\n insertText: 'cosh',\n detail: 'cosh(v instant-vector)',\n documentation: 'calculates the hyperbolic cosine of all elements in v',\n },\n {\n label: 'sin',\n insertText: 'sin',\n detail: 'sin(v instant-vector)',\n documentation: 'calculates the sine of all elements in v',\n },\n {\n label: 'sinh',\n insertText: 'sinh',\n detail: 'sinh(v instant-vector)',\n documentation: 'calculates the hyperbolic sine of all elements in v',\n },\n {\n label: 'tan',\n insertText: 'tan',\n detail: 'tan(v instant-vector)',\n documentation: 'calculates the tangent of all elements in v',\n },\n {\n label: 'tanh',\n insertText: 'tanh',\n detail: 'tanh(v instant-vector)',\n documentation: 'calculates the hyperbolic tangent of all elements in v',\n },\n];\n\nconst AGGREGATION_OPERATORS: CompletionItem[] = [\n {\n label: 'sum',\n insertText: 'sum',\n documentation: 'Calculate sum over dimensions',\n },\n {\n label: 'min',\n insertText: 'min',\n documentation: 'Select minimum over dimensions',\n },\n {\n label: 'max',\n insertText: 'max',\n documentation: 'Select maximum over dimensions',\n },\n {\n label: 'avg',\n insertText: 'avg',\n documentation: 'Calculate the average over dimensions',\n },\n {\n label: 'group',\n insertText: 'group',\n documentation: 'All values in the resulting vector are 1',\n },\n {\n label: 'stddev',\n insertText: 'stddev',\n documentation: 'Calculate population standard deviation over dimensions',\n },\n {\n label: 'stdvar',\n insertText: 'stdvar',\n documentation: 'Calculate population standard variance over dimensions',\n },\n {\n label: 'count',\n insertText: 'count',\n documentation: 'Count number of elements in the vector',\n },\n {\n label: 'count_values',\n insertText: 'count_values',\n documentation: 'Count number of elements with the same value',\n },\n {\n label: 'bottomk',\n insertText: 'bottomk',\n documentation: 'Smallest k elements by sample value',\n },\n {\n label: 'topk',\n insertText: 'topk',\n documentation: 'Largest k elements by sample value',\n },\n {\n label: 'quantile',\n insertText: 'quantile',\n documentation: 'Calculate φ-quantile (0 ≤ φ ≤ 1) over dimensions',\n },\n];\n\nexport const FUNCTIONS = [\n ...AGGREGATION_OPERATORS,\n ...TRIGONOMETRIC_FUNCTIONS,\n {\n insertText: 'abs',\n label: 'abs',\n detail: 'abs(v instant-vector)',\n documentation: 'Returns the input vector with all sample values converted to their absolute value.',\n },\n {\n insertText: 'absent',\n label: 'absent',\n detail: 'absent(v instant-vector)',\n documentation:\n 'Returns an empty vector if the vector passed to it has any elements and a 1-element vector with the value 1 if the vector passed to it has no elements. This is useful for alerting on when no time series exist for a given metric name and label combination.',\n },\n {\n insertText: 'absent_over_time',\n label: 'absent_over_time',\n detail: 'absent(v range-vector)',\n documentation:\n 'Returns an empty vector if the range vector passed to it has any elements and a 1-element vector with the value 1 if the range vector passed to it has no elements.',\n },\n {\n insertText: 'ceil',\n label: 'ceil',\n detail: 'ceil(v instant-vector)',\n documentation: 'Rounds the sample values of all elements in `v` up to the nearest integer.',\n },\n {\n insertText: 'changes',\n label: 'changes',\n detail: 'changes(v range-vector)',\n documentation: 'For each input time series, `changes(v range-vector)` returns the number of times its value has changed within the provided time range as an instant vector.',\n },\n {\n insertText: 'clamp',\n label: 'clamp',\n detail: 'clamp(v instant-vector, min scalar, max scalar)',\n documentation: 'Clamps the sample values of all elements in `v` to have a lower limit of `min` and an upper limit of `max`.',\n },\n {\n insertText: 'clamp_max',\n label: 'clamp_max',\n detail: 'clamp_max(v instant-vector, max scalar)',\n documentation: 'Clamps the sample values of all elements in `v` to have an upper limit of `max`.',\n },\n {\n insertText: 'clamp_min',\n label: 'clamp_min',\n detail: 'clamp_min(v instant-vector, min scalar)',\n documentation: 'Clamps the sample values of all elements in `v` to have a lower limit of `min`.',\n },\n {\n insertText: 'count_scalar',\n label: 'count_scalar',\n detail: 'count_scalar(v instant-vector)',\n documentation:\n 'Returns the number of elements in a time series vector as a scalar. This is in contrast to the `count()` aggregation operator, which always returns a vector (an empty one if the input vector is empty) and allows grouping by labels via a `by` clause.',\n },\n {\n insertText: 'deg',\n label: 'deg',\n detail: 'deg(v instant-vector)',\n documentation: 'Converts radians to degrees for all elements in v',\n },\n {\n insertText: 'day_of_month',\n label: 'day_of_month',\n detail: 'day_of_month(v=vector(time()) instant-vector)',\n documentation: 'Returns the day of the month for each of the given times in UTC. Returned values are from 1 to 31.',\n },\n {\n insertText: 'day_of_week',\n label: 'day_of_week',\n detail: 'day_of_week(v=vector(time()) instant-vector)',\n documentation: 'Returns the day of the week for each of the given times in UTC. Returned values are from 0 to 6, where 0 means Sunday etc.',\n },\n {\n insertText: 'day_of_year',\n label: 'day_of_year',\n detail: 'day_of_year(v=vector(time()) instant-vector)',\n documentation: 'Returns the day of the year for each of the given times in UTC. Returned values are from 1 to 365 for non-leap years, and 1 to 366 in leap years.',\n },\n {\n insertText: 'days_in_month',\n label: 'days_in_month',\n detail: 'days_in_month(v=vector(time()) instant-vector)',\n documentation: 'Returns number of days in the month for each of the given times in UTC. Returned values are from 28 to 31.',\n },\n {\n insertText: 'delta',\n label: 'delta',\n detail: 'delta(v range-vector)',\n documentation:\n 'Calculates the difference between the first and last value of each time series element in a range vector `v`, returning an instant vector with the given deltas and equivalent labels. The delta is extrapolated to cover the full time range as specified in the range vector selector, so that it is possible to get a non-integer result even if the sample values are all integers.',\n },\n {\n insertText: 'deriv',\n label: 'deriv',\n detail: 'deriv(v range-vector)',\n documentation: 'Calculates the per-second derivative of the time series in a range vector `v`, using simple linear regression.',\n },\n {\n insertText: 'drop_common_labels',\n label: 'drop_common_labels',\n detail: 'drop_common_labels(instant-vector)',\n documentation: 'Drops all labels that have the same name and value across all series in the input vector.',\n },\n {\n insertText: 'exp',\n label: 'exp',\n detail: 'exp(v instant-vector)',\n documentation: 'Calculates the exponential function for all elements in `v`.\\nSpecial cases are:\\n* `Exp(+Inf) = +Inf` \\n* `Exp(NaN) = NaN`',\n },\n {\n insertText: 'floor',\n label: 'floor',\n detail: 'floor(v instant-vector)',\n documentation: 'Rounds the sample values of all elements in `v` down to the nearest integer.',\n },\n {\n insertText: 'histogram_quantile',\n label: 'histogram_quantile',\n detail: 'histogram_quantile(φ float, b instant-vector)',\n documentation:\n 'Calculates the φ-quantile (0 ≤ φ ≤ 1) from the buckets `b` of a histogram. The samples in `b` are the counts of observations in each bucket. Each sample must have a label `le` where the label value denotes the inclusive upper bound of the bucket. (Samples without such a label are silently ignored.) The histogram metric type automatically provides time series with the `_bucket` suffix and the appropriate labels.',\n },\n {\n insertText: 'holt_winters',\n label: 'holt_winters',\n detail: 'holt_winters(v range-vector, sf scalar, tf scalar)',\n documentation:\n 'Produces a smoothed value for time series based on the range in `v`. The lower the smoothing factor `sf`, the more importance is given to old data. The higher the trend factor `tf`, the more trends in the data is considered. Both `sf` and `tf` must be between 0 and 1.',\n },\n {\n insertText: 'hour',\n label: 'hour',\n detail: 'hour(v=vector(time()) instant-vector)',\n documentation: 'Returns the hour of the day for each of the given times in UTC. Returned values are from 0 to 23.',\n },\n {\n insertText: 'idelta',\n label: 'idelta',\n detail: 'idelta(v range-vector)',\n documentation: 'Calculates the difference between the last two samples in the range vector `v`, returning an instant vector with the given deltas and equivalent labels.',\n },\n {\n insertText: 'increase',\n label: 'increase',\n detail: 'increase(v range-vector)',\n documentation:\n 'Calculates the increase in the time series in the range vector. Breaks in monotonicity (such as counter resets due to target restarts) are automatically adjusted for. The increase is extrapolated to cover the full time range as specified in the range vector selector, so that it is possible to get a non-integer result even if a counter increases only by integer increments.',\n },\n {\n insertText: 'irate',\n label: 'irate',\n detail: 'irate(v range-vector)',\n documentation:\n 'Calculates the per-second instant rate of increase of the time series in the range vector. This is based on the last two data points. Breaks in monotonicity (such as counter resets due to target restarts) are automatically adjusted for.',\n },\n {\n insertText: 'label_join',\n label: 'label_join',\n detail: 'label_join(v instant-vector, dst_label string, separator string, src_label_1 string, src_label_2 string, ...)',\n documentation:\n 'For each timeseries in `v`, joins all the values of all the `src_labels` using `separator` and returns the timeseries with the label `dst_label` containing the joined value. There can be any number of `src_labels` in this function.',\n },\n {\n insertText: 'label_replace',\n label: 'label_replace',\n detail: 'label_replace(v instant-vector, dst_label string, replacement string, src_label string, regex string)',\n documentation:\n \"For each timeseries in `v`, `label_replace(v instant-vector, dst_label string, replacement string, src_label string, regex string)` matches the regular expression `regex` against the label `src_label`. If it matches, then the timeseries is returned with the label `dst_label` replaced by the expansion of `replacement`. `$1` is replaced with the first matching subgroup, `$2` with the second etc. If the regular expression doesn't match then the timeseries is returned unchanged.\",\n },\n {\n insertText: 'ln',\n label: 'ln',\n detail: 'ln(v instant-vector)',\n documentation:\n 'Calculates the natural logarithm for all elements in `v`.\\nSpecial cases are:\\n * `ln(+Inf) = +Inf`\\n * `ln(0) = -Inf`\\n * `ln(x < 0) = NaN`\\n * `ln(NaN) = NaN`',\n },\n {\n insertText: 'log2',\n label: 'log2',\n detail: 'log2(v instant-vector)',\n documentation: 'Calculates the binary logarithm for all elements in `v`. The special cases are equivalent to those in `ln`.',\n },\n {\n insertText: 'log10',\n label: 'log10',\n detail: 'log10(v instant-vector)',\n documentation: 'Calculates the decimal logarithm for all elements in `v`. The special cases are equivalent to those in `ln`.',\n },\n {\n insertText: 'minute',\n label: 'minute',\n detail: 'minute(v=vector(time()) instant-vector)',\n documentation: 'Returns the minute of the hour for each of the given times in UTC. Returned values are from 0 to 59.',\n },\n {\n insertText: 'month',\n label: 'month',\n detail: 'month(v=vector(time()) instant-vector)',\n documentation: 'Returns the month of the year for each of the given times in UTC. Returned values are from 1 to 12, where 1 means January etc.',\n },\n {\n insertText: 'pi',\n label: 'pi',\n detail: 'pi()',\n documentation: 'Returns pi',\n },\n {\n insertText: 'predict_linear',\n label: 'predict_linear',\n detail: 'predict_linear(v range-vector, t scalar)',\n documentation: 'Predicts the value of time series `t` seconds from now, based on the range vector `v`, using simple linear regression.',\n },\n {\n insertText: 'rad',\n label: 'rad',\n detail: 'rad(v instant-vector)',\n documentation: 'Converts degrees to radians for all elements in v',\n },\n {\n insertText: 'rate',\n label: 'rate',\n detail: 'rate(v range-vector)',\n documentation:\n \"Calculates the per-second average rate of increase of the time series in the range vector. Breaks in monotonicity (such as counter resets due to target restarts) are automatically adjusted for. Also, the calculation extrapolates to the ends of the time range, allowing for missed scrapes or imperfect alignment of scrape cycles with the range's time period.\",\n },\n {\n insertText: 'resets',\n label: 'resets',\n detail: 'resets(v range-vector)',\n documentation:\n 'For each input time series, `resets(v range-vector)` returns the number of counter resets within the provided time range as an instant vector. Any decrease in the value between two consecutive samples is interpreted as a counter reset.',\n },\n {\n insertText: 'round',\n label: 'round',\n detail: 'round(v instant-vector, to_nearest=1 scalar)',\n documentation:\n 'Rounds the sample values of all elements in `v` to the nearest integer. Ties are resolved by rounding up. The optional `to_nearest` argument allows specifying the nearest multiple to which the sample values should be rounded. This multiple may also be a fraction.',\n },\n {\n insertText: 'scalar',\n label: 'scalar',\n detail: 'scalar(v instant-vector)',\n documentation:\n 'Given a single-element input vector, `scalar(v instant-vector)` returns the sample value of that single element as a scalar. If the input vector does not have exactly one element, `scalar` will return `NaN`.',\n },\n {\n insertText: 'sgn',\n label: 'sgn',\n detail: 'sgn(v instant-vector)',\n documentation: 'Returns a vector with all sample values converted to their sign, defined as this: 1 if v is positive, -1 if v is negative and 0 if v is equal to zero.',\n },\n {\n insertText: 'sort',\n label: 'sort',\n detail: 'sort(v instant-vector)',\n documentation: 'Returns vector elements sorted by their sample values, in ascending order.',\n },\n {\n insertText: 'sort_desc',\n label: 'sort_desc',\n detail: 'sort_desc(v instant-vector)',\n documentation: 'Returns vector elements sorted by their sample values, in descending order.',\n },\n {\n insertText: 'sqrt',\n label: 'sqrt',\n detail: 'sqrt(v instant-vector)',\n documentation: 'Calculates the square root of all elements in `v`.',\n },\n {\n insertText: 'time',\n label: 'time',\n detail: 'time()',\n documentation:\n 'Returns the number of seconds since January 1, 1970 UTC. Note that this does not actually return the current time, but the time at which the expression is to be evaluated.',\n },\n {\n insertText: 'timestamp',\n label: 'timestamp',\n detail: 'timestamp(v instant-vector)',\n documentation: 'Returns the timestamp of each of the samples of the given vector as the number of seconds since January 1, 1970 UTC.',\n },\n {\n insertText: 'vector',\n label: 'vector',\n detail: 'vector(s scalar)',\n documentation: 'Returns the scalar `s` as a vector with no labels.',\n },\n {\n insertText: 'year',\n label: 'year',\n detail: 'year(v=vector(time()) instant-vector)',\n documentation: 'Returns the year for each of the given times in UTC.',\n },\n {\n insertText: 'avg_over_time',\n label: 'avg_over_time',\n detail: 'avg_over_time(range-vector)',\n documentation: 'The average value of all points in the specified interval.',\n },\n {\n insertText: 'min_over_time',\n label: 'min_over_time',\n detail: 'min_over_time(range-vector)',\n documentation: 'The minimum value of all points in the specified interval.',\n },\n {\n insertText: 'max_over_time',\n label: 'max_over_time',\n detail: 'max_over_time(range-vector)',\n documentation: 'The maximum value of all points in the specified interval.',\n },\n {\n insertText: 'sum_over_time',\n label: 'sum_over_time',\n detail: 'sum_over_time(range-vector)',\n documentation: 'The sum of all values in the specified interval.',\n },\n {\n insertText: 'count_over_time',\n label: 'count_over_time',\n detail: 'count_over_time(range-vector)',\n documentation: 'The count of all values in the specified interval.',\n },\n {\n insertText: 'quantile_over_time',\n label: 'quantile_over_time',\n detail: 'quantile_over_time(scalar, range-vector)',\n documentation: 'The φ-quantile (0 ≤ φ ≤ 1) of the values in the specified interval.',\n },\n {\n insertText: 'stddev_over_time',\n label: 'stddev_over_time',\n detail: 'stddev_over_time(range-vector)',\n documentation: 'The population standard deviation of the values in the specified interval.',\n },\n {\n insertText: 'stdvar_over_time',\n label: 'stdvar_over_time',\n detail: 'stdvar_over_time(range-vector)',\n documentation: 'The population standard variance of the values in the specified interval.',\n },\n {\n insertText: 'last_over_time',\n label: 'last_over_time',\n detail: 'last_over_time(range-vector)',\n documentation: 'The most recent point value in specified interval.',\n },\n {\n insertText: 'present_over_time',\n label: 'present_over_time',\n detail: 'present_over_time(range-vector)',\n documentation: 'The value 1 for any series in the specified interval.',\n },\n {\n insertText: 'histogram_avg',\n label: 'histogram_avg',\n detail: 'histogram_avg(v instant-vector)',\n documentation:\n 'Returns the arithmetic average of observed values stored in a native histogram. Samples that are not native histograms are ignored and do not show up in the returned vector.',\n },\n {\n insertText: 'histogram_count',\n label: 'histogram_count',\n detail: 'histogram_count(v instant-vector)',\n documentation: 'Returns the count of observations stored in a native histogram.',\n },\n {\n insertText: 'histogram_sum',\n label: 'histogram_sum',\n detail: 'histogram_sum(v instant-vector)',\n documentation: 'Returns the sum of observations stored in a native histogram.',\n },\n {\n insertText: 'histogram_fraction',\n label: 'histogram_fraction',\n detail: 'histogram_fraction(lower scalar, upper scalar, v instant-vector)',\n documentation: 'Returns the estimated fraction of observations between the provided lower and upper values.',\n },\n {\n insertText: 'histogram_stddev',\n label: 'histogram_stddev',\n detail: 'histogram_stddev(v instant-vector)',\n documentation: 'Returns the estimated standard deviation of observations in a native histogram, based on the geometric mean of the buckets where the observations lie.',\n },\n {\n insertText: 'histogram_stdvar',\n label: 'histogram_stdvar',\n detail: 'histogram_stdvar(v instant-vector)',\n documentation: 'Returns the estimated standard variance of observations in a native histogram.',\n },\n];\n","import { Label } from './types';\n\nexport class NeverCaseError extends Error {\n constructor(_value: never) {\n super('should never happen');\n }\n}\n\n// based on the openmetrics-documentation, the 3 symbols we have to handle are:\n// - \\n ... the newline character\n// - \\ ... the backslash character\n// - \" ... the double-quote character\nexport function escapeLabelValueInExactSelector(labelValue: string): string {\n return labelValue.replace(/\\\\/g, '\\\\\\\\').replace(/\\n/g, '\\\\n').replace(/\"/g, '\\\\\"');\n}\n\nexport function makeSelector(metricName: string, labels?: Label[], labelName?: string): string {\n if (!labels || labels.length === 0) {\n return metricName;\n }\n\n const allLabels = [...labels].filter((label) => label.name !== labelName && label.value !== '');\n\n const allLabelTexts = allLabels.map((label) => {\n return `${label.name}${label.op}\"${escapeLabelValueInExactSelector(label.value)}\"`;\n });\n\n return `${metricName}{${allLabelTexts.join(',')}}`;\n}\n","import { makeSelector } from '../util';\nimport type { Metric, PromMetricsMetadata, DataProviderParams } from '../types';\n\ntype CustomRequest = (input: RequestInfo, init?: RequestInit) => Promise<Response>;\n\ninterface APIResponse<T> {\n status: 'success' | 'error';\n data?: T;\n error?: string;\n warnings?: string[];\n}\n\nconst DEFAULT_SERIES_LIMIT = '40000';\nconst badRequest = 400;\nconst unprocessableEntity = 422;\nconst serviceUnavailable = 503;\nconst CODE_MODE_SUGGESTIONS_INCOMPLETE_EVENT = 'codeModeSuggestionsIncomplete';\n\nexport class DataProvider {\n readonly metricNamesSuggestionLimit: number;\n private inputInRange: string;\n private suggestionsIncomplete: boolean;\n private readonly lookbackInterval = 60 * 60 * 1000 * 12; // 12 hours\n private variablesNames: string[] = [];\n private readonly url: string;\n private readonly errorHandler?: (error: any) => void;\n private readonly httpMethod: 'POST' | 'GET' = 'GET';\n private readonly apiPrefix: string = '/api/v1';\n private readonly customRequest: CustomRequest = (input: RequestInfo, init?: RequestInit): Promise<Response> => fetch(input, init);\n metrics: string[];\n labelKeys: string[];\n metricsMetadata?: PromMetricsMetadata;\n durationVariablesCompletion: boolean;\n\n constructor(params: DataProviderParams) {\n this.inputInRange = '';\n this.metricNamesSuggestionLimit = 1000;\n this.suggestionsIncomplete = false;\n\n this.url = params.url ? params.url : '';\n this.errorHandler = params.httpErrorHandler;\n if (params.lookbackInterval) {\n this.lookbackInterval = params.lookbackInterval;\n }\n if (params.variablesNames) {\n this.variablesNames = [...params.variablesNames];\n }\n this.durationVariablesCompletion = params.durationVariablesCompletion ?? true;\n if (params.request) {\n this.customRequest = params.request;\n }\n if (params.httpMethod) {\n this.httpMethod = params.httpMethod;\n }\n if (params.apiPrefix) {\n this.apiPrefix = params.apiPrefix;\n }\n\n this.metrics = [];\n this.labelKeys = [];\n }\n\n getVariablesNames(): string[] {\n return this.variablesNames;\n }\n\n setVariablesNames(variablesNames: string[]) {\n this.variablesNames = [...variablesNames];\n }\n\n private buildRequest(endpoint: string, params: URLSearchParams) {\n let uri = endpoint;\n let body: URLSearchParams | null = params;\n if (this.httpMethod === 'GET') {\n uri = `${uri}?${params}`;\n body = null;\n }\n return { uri, body };\n }\n\n private request<T>(resource: string, init?: RequestInit): Promise<T> {\n return this.customRequest(this.url + resource, init)\n .then((res) => {\n if (!res.ok && ![badRequest, unprocessableEntity, serviceUnavailable].includes(res.status)) {\n throw new Error(res.statusText);\n }\n return res;\n })\n .then((res) => res.json())\n .then((apiRes: APIResponse<T>) => {\n if (apiRes.status === 'error') {\n const error = new Error(apiRes.error !== undefined ? apiRes.error : 'missing \"error\" field in response JSON');\n if (this.errorHandler) {\n this.errorHandler(error);\n }\n throw error;\n }\n if (apiRes.data === undefined) {\n const error = new Error(apiRes.error !== undefined ? apiRes.error : 'missing \"data\" field in response JSON');\n if (this.errorHandler) {\n this.errorHandler(error);\n }\n throw error;\n }\n return apiRes.data;\n })\n .catch((error) => {\n if (this.errorHandler) {\n this.errorHandler(error);\n }\n throw error;\n });\n }\n\n fetchSeries = async (selector: string, withLimit?: string): Promise<Record<string, string>[]> => {\n const end = new Date();\n const start = new Date(end.getTime() - this.lookbackInterval);\n const url = `${this.apiPrefix}/series`;\n let urlParams: any = {\n start: start.toISOString() as string,\n end: end.toISOString() as string,\n };\n if (selector) {\n urlParams['match[]'] = selector;\n }\n\n if (withLimit !== 'none') {\n urlParams = { ...urlParams, limit: withLimit ?? DEFAULT_SERIES_LIMIT };\n }\n const request = this.buildRequest(url, new URLSearchParams(urlParams));\n\n return await this.request<Record<string, string>[]>(request.uri, {\n method: this.httpMethod,\n body: request.body,\n }).catch(() => {\n return [] as Record<string, string>[];\n });\n };\n\n fetchLabels = async (selector: string): Promise<string[]> => {\n const end = new Date();\n const start = new Date(end.getTime() - this.lookbackInterval);\n const url = `${this.apiPrefix}/labels`;\n const urlParams: any = {\n start: start.toISOString(),\n end: end.toISOString(),\n };\n if (selector) {\n urlParams['match[]'] = selector;\n }\n const request = this.buildRequest(url, new URLSearchParams(urlParams));\n\n return await this.request<string[]>(request.uri, {\n method: this.httpMethod,\n body: request.body,\n })\n .then((res) => {\n this.labelKeys = res;\n return res;\n })\n .catch(() => {\n return [] as string[];\n });\n };\n\n fetchLabelValues = async (labelName: string, selector: string): Promise<string[]> => {\n const end = new Date();\n const start = new Date(end.getTime() - this.lookbackInterval);\n const url = `${this.apiPrefix}/label/${labelName}/values`;\n const urlParams: any = {\n start: start.toISOString(),\n end: end.toISOString(),\n };\n if (selector) {\n urlParams['match[]'] = selector;\n }\n const request = this.buildRequest(url, new URLSearchParams(urlParams));\n\n return await this.request<string[]>(request.uri, {\n method: this.httpMethod,\n body: request.body,\n }).catch(() => {\n return [] as string[];\n });\n };\n\n getAllMetricNames(): string[] {\n return this.metrics;\n }\n\n start = async () => {\n this.metrics = (await this.fetchLabelValues('__name__', makeSelector('', [], '__name__'))) || [];\n\n return Promise.all([\n this.loadMetricsMetadata(),\n // this.fetchLabels()\n ]);\n };\n\n async loadMetricsMetadata() {\n const request = this.buildRequest(`${this.apiPrefix}/metadata`, new URLSearchParams({}));\n this.metricsMetadata = await this.request<PromMetricsMetadata>(request.uri, {\n method: this.httpMethod,\n body: request.body,\n }).catch(() => {\n return {} as PromMetricsMetadata;\n });\n }\n\n metricNamesToMetrics(metricNames: string[]): Metric[] {\n const result: Metric[] = metricNames.map((m) => {\n const metaItem = this.metricsMetadata?.[m];\n return {\n name: m,\n help: metaItem?.help ?? '',\n type: metaItem?.type ?? '',\n };\n });\n\n return result;\n }\n\n private setInputInRange(textInput: string): void {\n this.inputInRange = textInput;\n }\n\n private enableAutocompleteSuggestionsUpdate(): void {\n this.suggestionsIncomplete = true;\n dispatchEvent(\n new CustomEvent(CODE_MODE_SUGGESTIONS_INCOMPLETE_EVENT, {\n detail: {\n limit: this.metricNamesSuggestionLimit,\n },\n }),\n );\n }\n\n get monacoSettings() {\n return {\n /**\n * Enable autocomplete suggestions update on every input change.\n *\n * @remarks\n * If fuzzy search is used in `getCompletions` to trim down results to improve performance,\n * we need to instruct Monaco to update the completions on every input change, so that the\n * completions reflect the current input.\n */\n enableAutocompleteSuggestionsUpdate: this.enableAutocompleteSuggestionsUpdate.bind(this),\n inputInRange: this.inputInRange,\n setInputInRange: this.setInputInRange.bind(this),\n suggestionsIncomplete: this.suggestionsIncomplete,\n };\n }\n}\n","import type { SyntaxNode, Tree } from '@lezer/common';\nimport {\n AggregateExpr,\n AggregateModifier,\n BinaryExpr,\n EqlRegex,\n EqlSingle,\n FunctionCallBody,\n GroupingLabels,\n Identifier,\n LabelMatchers,\n LabelName,\n MatchOp,\n MatrixSelector,\n Neq,\n NeqRegex,\n NumberDurationLiteralInDurationContext,\n parser,\n PromQL,\n StringLiteral,\n UnquotedLabelMatcher,\n VectorSelector,\n} from '@fc-components/lezer-metricsql';\n\nimport { NeverCaseError } from '../util';\nimport { LabelOperator, Label } from '../types';\n\ntype Direction = 'parent' | 'firstChild' | 'lastChild' | 'nextSibling';\n\ntype NodeTypeId =\n | 0 // this is used as error-id\n | typeof AggregateExpr\n | typeof AggregateModifier\n | typeof FunctionCallBody\n | typeof GroupingLabels\n | typeof Identifier\n | typeof UnquotedLabelMatcher\n | typeof LabelMatchers\n | typeof LabelName\n | typeof PromQL\n | typeof StringLiteral\n | typeof VectorSelector\n | typeof MatrixSelector\n | typeof MatchOp\n | typeof EqlSingle\n | typeof Neq\n | typeof EqlRegex\n | typeof NeqRegex;\n\ntype Path = Array<[Direction, NodeTypeId]>;\n\nfunction move(node: SyntaxNode, direction: Direction): SyntaxNode | null {\n switch (direction) {\n case 'parent':\n return node.parent;\n case 'firstChild':\n return node.firstChild;\n case 'lastChild':\n return node.lastChild;\n case 'nextSibling':\n return node.nextSibling;\n default:\n throw new NeverCaseError(direction);\n }\n}\n\nfunction walk(node: SyntaxNode, path: Path): SyntaxNode | null {\n let current: SyntaxNode | null = node;\n for (const [direction, expectedType] of path) {\n current = move(current, direction);\n if (current === null) {\n // we could not move in the direction, we stop\n return null;\n }\n if (current.type.id !== expectedType) {\n // the reached node has wrong type, we stop\n return null;\n }\n }\n return current;\n}\n\nfunction getNodeText(node: SyntaxNode, text: string): string {\n return text.slice(node.from, node.to);\n}\n\nfunction parsePromQLStringLiteral(text: string): string {\n // if it is a string-literal, it is inside quotes of some kind\n const inside = text.slice(1, text.length - 1);\n\n // FIXME: support https://prometheus.io/docs/prometheus/latest/querying/basics/#string-literals\n // FIXME: maybe check other promql code, if all is supported or not\n\n // for now we do only some very simple un-escaping\n\n // we start with double-quotes\n if (text.startsWith('\"') && text.endsWith('\"')) {\n // NOTE: this is not 100% perfect, we only unescape the double-quote,\n // there might be other characters too\n return inside.replace(/\\\\\"/, '\"');\n }\n\n // then single-quote\n if (text.startsWith(\"'\") && text.endsWith(\"'\")) {\n // NOTE: this is not 100% perfect, we only unescape the single-quote,\n // there might be other characters too\n return inside.replace(/\\\\'/, \"'\");\n }\n\n // then backticks\n if (text.startsWith('`') && text.endsWith('`')) {\n return inside;\n }\n\n throw new Error('FIXME: invalid string literal');\n}\n\nexport type Situation =\n | {\n type: 'IN_FUNCTION';\n }\n | {\n type: 'AT_ROOT';\n }\n | {\n type: 'EMPTY';\n }\n | {\n type: 'IN_DURATION';\n }\n | {\n type: 'IN_LABEL_SELECTOR_NO_LABEL_NAME';\n metricName?: string;\n otherLabels: Label[];\n }\n | {\n type: 'IN_GROUPING';\n metricName: string;\n otherLabels: Label[];\n }\n | {\n type: 'IN_LABEL_SELECTOR_WITH_LABEL_NAME';\n metricName?: string;\n labelName: string;\n betweenQuotes: boolean;\n otherLabels: Label[];\n };\n\ntype Resolver = {\n path: NodeTypeId[];\n fun: (node: SyntaxNode, text: string, pos: number) => Situation | null;\n};\n\nfunction isPathMatch(resolverPath: NodeTypeId[], cursorPath: number[]): boolean {\n return resolverPath.every((item, index) => item === cursorPath[index]);\n}\n\nconst ERROR_NODE_NAME: NodeTypeId = 0; // this is used as error-id\n\nconst RESOLVERS: Resolver[] = [\n {\n path: [LabelMatchers, VectorSelector],\n fun: resolveLabelKeysWithEquals,\n },\n {\n path: [PromQL],\n fun: resolveTopLevel,\n },\n {\n path: [FunctionCallBody],\n fun: resolveInFunction,\n },\n {\n path: [StringLiteral, UnquotedLabelMatcher],\n fun: resolveLabelMatcher,\n },\n {\n path: [ERROR_NODE_NAME, BinaryExpr, PromQL],\n fun: resolveTopLevel,\n },\n {\n path: [ERROR_NODE_NAME, UnquotedLabelMatcher],\n fun: resolveLabelMatcher,\n },\n {\n path: [ERROR_NODE_NAME, NumberDurationLiteralInDurationContext, MatrixSelector],\n fun: resolveDurations,\n },\n {\n path: [GroupingLabels],\n fun: resolveLabelsForGrouping,\n },\n];\n\nconst LABEL_OP_MAP = new Map<number, LabelOperator>([\n [EqlSingle, '='],\n [EqlRegex, '=~'],\n [Neq, '!='],\n [NeqRegex, '!~'],\n]);\n\nfunction getLabelOp(opNode: SyntaxNode): LabelOperator | null {\n const opChild = opNode.firstChild;\n if (opChild === null) {\n return null;\n }\n\n return LABEL_OP_MAP.get(opChild.type.id) ?? null;\n}\n\nfunction getLabel(labelMatcherNode: SyntaxNode, text: string): Label | null {\n if (labelMatcherNode.type.id !== UnquotedLabelMatcher) {\n return null;\n }\n\n const nameNode = walk(labelMatcherNode, [['firstChild', LabelName]]);\n\n if (nameNode === null) {\n return null;\n }\n\n const opNode = walk(nameNode, [['nextSibling', MatchOp]]);\n if (opNode === null) {\n return null;\n }\n\n const op = getLabelOp(opNode);\n if (op === null) {\n return null;\n }\n\n const valueNode = walk(labelMatcherNode, [['lastChild', StringLiteral]]);\n\n if (valueNode === null) {\n return null;\n }\n\n const name = getNodeText(nameNode, text);\n const value = parsePromQLStringLiteral(getNodeText(valueNode, text));\n\n return { name, value, op };\n}\n\nfunction getLabels(labelMatchersNode: SyntaxNode, text: string): Label[] {\n if (labelMatchersNode.type.id !== LabelMatchers) {\n return [];\n }\n\n const labelNodes = labelMatchersNode.getChildren(UnquotedLabelMatcher);\n return labelNodes.map((ln) => getLabel(ln, text)).filter(notEmpty);\n}\n\nfunction getNodeChildren(node: SyntaxNode): SyntaxNode[] {\n let child: SyntaxNode | null = node.firstChild;\n const children: SyntaxNode[] = [];\n while (child !== null) {\n children.push(child);\n child = child.nextSibling;\n }\n return children;\n}\n\nfunction getNodeInSubtree(node: SyntaxNode, typeId: NodeTypeId): SyntaxNode | null {\n // first we try the current node\n if (node.type.id === typeId) {\n return node;\n }\n\n // then we try the children\n const children = getNodeChildren(node);\n for (const child of children) {\n const n = getNodeInSubtree(child, typeId);\n if (n !== null) {\n return n;\n }\n }\n\n return null;\n}\n\nfunction resolveLabelsForGrouping(node: SyntaxNode, text: string, _pos: number): Situation | null {\n const aggrExpNode = walk(node, [\n ['parent', AggregateModifier],\n ['parent', AggregateExpr],\n ]);\n if (aggrExpNode === null) {\n return null;\n }\n const bodyNode = aggrExpNode.getChild(FunctionCallBody);\n if (bodyNode === null) {\n return null;\n }\n\n const metricIdNode = getNodeInSubtree(bodyNode, Identifier);\n if (metricIdNode === null) {\n return null;\n }\n\n const metricName = getNodeText(metricIdNode, text);\n return {\n type: 'IN_GROUPING',\n metricName,\n otherLabels: [],\n };\n}\n\nfunction resolveLabelMatcher(node: SyntaxNode, text: string, _pos: number): Situation | null {\n // we can arrive here in two situation. `node` is either:\n // - a StringNode (like in `{job=\"^\"}`)\n // - or an error node (like in `{job=^}`)\n const inStringNode = !node.type.isError;\n\n const parent = walk(node, [['parent', UnquotedLabelMatcher]]);\n if (parent === null) {\n return null;\n }\n\n const labelNameNode = walk(parent, [['firstChild', LabelName]]);\n if (labelNameNode === null) {\n return null;\n }\n\n const labelName = getNodeText(labelNameNode, text);\n\n const labelMatchersNode = walk(parent, [['parent', LabelMatchers]]);\n if (labelMatchersNode === null) {\n return null;\n }\n\n // now we need to find the other names\n const allLabels = getLabels(labelMatchersNode, text);\n\n // we need to remove \"our\" label from all-labels, if it is in there\n const otherLabels = allLabels.filter((label) => label.name !== labelName);\n\n const metricNameNode = walk(labelMatchersNode, [\n ['parent', VectorSelector],\n ['firstChild', Identifier],\n ]);\n\n if (metricNameNode === null) {\n // we are probably in a situation without a metric name\n return {\n type: 'IN_LABEL_SELECTOR_WITH_LABEL_NAME',\n labelName,\n betweenQuotes: inStringNode,\n otherLabels,\n };\n }\n\n const metricName = getNodeText(metricNameNode, text);\n\n return {\n type: 'IN_LABEL_SELECTOR_WITH_LABEL_NAME',\n metricName,\n labelName,\n betweenQuotes: inStringNode,\n otherLabels,\n };\n}\n\nfunction resolveTopLevel(): Situation {\n return {\n type: 'AT_ROOT',\n };\n}\n\nfunction resolveInFunction(): Situation {\n return {\n type: 'IN_FUNCTION',\n };\n}\n\nfunction resolveDurations(): Situation {\n return {\n type: 'IN_DURATION',\n };\n}\n\nfunction resolveLabelKeysWithEquals(node: SyntaxNode, text: string, pos: number): Situation | null {\n // next false positive:\n // `something{a=\"1\"^}`\n const child = walk(node, [['firstChild', UnquotedLabelMatcher]]);\n if (child !== null) {\n // means the label-matching part contains at least one label already.\n //\n // in this case, we will need to have a `,` character at the end,\n // to be able to suggest adding the next label.\n // the area between the end-of-the-child-node and the cursor-pos\n // must contain a `,` in this case.\n const textToCheck = text.slice(child.to, pos);\n\n if (!textToCheck.includes(',')) {\n return null;\n }\n }\n\n const metricNameNode = walk(node, [\n ['parent', VectorSelector],\n ['firstChild', Identifier],\n ]);\n\n const otherLabels = getLabels(node, text);\n\n if (metricNameNode === null) {\n // we are probably in a situation without a metric name.\n return {\n type: 'IN_LABEL_SELECTOR_NO_LABEL_NAME',\n otherLabels,\n };\n }\n\n const metricName = getNodeText(metricNameNode, text);\n\n return {\n type: 'IN_LABEL_SELECTOR_NO_LABEL_NAME',\n metricName,\n otherLabels,\n };\n}\n\n// we find the first error-node in the tree that is at the cursor-position.\n// NOTE: this might be too slow, might need to optimize it\n// (ideas: we do not need to go into every subtree, based on from/to)\n// also, only go to places that are in the sub-tree of the node found\n// by default by lezer. problem is, `next()` will go upward too,\n// and we do not want to go higher than our node\nfunction getErrorNode(tree: Tree, pos: number): SyntaxNode | null {\n const cur = tree.cursorAt(pos);\n while (true) {\n if (cur.from === pos && cur.to === pos) {\n const { node } = cur;\n if (node.type.isError) {\n return node;\n }\n }\n\n if (!cur.next()) {\n break;\n }\n }\n return null;\n}\n\nexport function getSituation(text: string, pos: number): Situation | null {\n // there is a special-case when we are at the start of writing text,\n // so we handle that case first\n\n if (text === '') {\n return {\n type: 'EMPTY',\n };\n }\n\n /**\n PromQL\n Expr\n VectorSelector\n LabelMatchers\n */\n const tree = parser.parse(text);\n\n // if the tree contains error, it is very probable that\n // our node is one of those error-nodes.\n // also, if there are errors, the node lezer finds us,\n // might not be the best node.\n // so first we check if there is an error-node at the cursor-position\n const maybeErrorNode = getErrorNode(tree, pos);\n\n const cur = maybeErrorNode != null ? maybeErrorNode.cursor() : tree.cursorAt(pos);\n const currentNode = cur.node;\n\n const ids = [cur.type.id];\n while (cur.parent()) {\n ids.push(cur.type.id);\n }\n\n for (let resolver of RESOLVERS) {\n // i do not use a foreach because i want to stop as soon\n // as i find something\n if (isPathMatch(resolver.path, ids)) {\n return resolver.fun(currentNode, text, pos);\n }\n }\n\n return null;\n}\n\nfunction notEmpty<TValue>(value: TValue | null | undefined): value is TValue {\n return value !== null && value !== undefined;\n}\n","import UFuzzy from '@leeoniya/ufuzzy';\n\nimport { FUNCTIONS } from '../promql';\nimport { makeSelector, NeverCaseError } from '../util';\nimport type { DataProvider } from './DataProvider';\nimport type { Situation } from './situation';\nimport type { Label } from '../types';\n\nexport type CompletionType = 'HISTORY' | 'FUNCTION' | 'METRIC_NAME' | 'DURATION' | 'LABEL_NAME' | 'LABEL_VALUE';\n\ntype Completion = {\n type: CompletionType;\n label: string;\n insertText: string;\n detail?: string;\n documentation?: string;\n triggerOnInsert?: boolean;\n};\n\nconst metricNamesSearchClient = new UFuzzy({ intraMode: 1 });\n\n// we order items like: history, functions, metrics\nfunction getAllMetricNamesCompletions(dataProvider: DataProvider): Completion[] {\n let metricNames = dataProvider.getAllMetricNames();\n\n if (metricNames.length > dataProvider.metricNamesSuggestionLimit) {\n const { monacoSettings } = dataProvider;\n monacoSettings.enableAutocompleteSuggestionsUpdate();\n\n if (monacoSettings.inputInRange) {\n metricNames =\n metricNamesSearchClient\n .filter(metricNames, monacoSettings.inputInRange)\n ?.slice(0, dataProvider.metricNamesSuggestionLimit)\n .map((idx) => metricNames[idx]) ?? [];\n } else {\n metricNames = metricNames.slice(0, dataProvider.metricNamesSuggestionLimit);\n }\n }\n\n return dataProvider.metricNamesToMetrics(metricNames).map((metric) => ({\n type: 'METRIC_NAME',\n label: metric.name,\n insertText: metric.name,\n detail: `${metric.name} : ${metric.type}`,\n documentation: metric.help,\n }));\n}\n\nconst FUNCTION_COMPLETIONS: Completion[] = FUNCTIONS.map((f) => ({\n type: 'FUNCTION',\n label: f.label,\n insertText: f.insertText ?? '', // i don't know what to do when this is nullish. it should not be.\n detail: f.detail,\n documentation: f.documentation,\n}));\n\nasync function getAllFunctionsAndMetricNamesCompletions(dataProvider: DataProvider): Promise<Completion[]> {\n const metricNames = getAllMetricNamesCompletions(dataProvider);\n\n return [...FUNCTION_COMPLETIONS, ...metricNames];\n}\n\nconst DURATION_COMPLETIONS: Completion[] = ['1m', '5m', '10m', '30m', '1h', '1d'].map((text) => ({\n type: 'DURATION',\n label: text,\n insertText: text,\n}));\n\nconst DURATION_VARIABLES_COMPLETIONS: Completion[] = ['$__interval', '$__range', '$__rate_interval'].map((text) => ({\n type: 'DURATION',\n label: text,\n insertText: text,\n}));\n\nfunction getAllHistoryCompletions(_dataProvider: DataProvider): Completion[] {\n return [];\n // function getAllHistoryCompletions(queryHistory: PromHistoryItem[]): Completion[] {\n // NOTE: the typescript types are wrong. historyItem.query.expr can be undefined\n // const allHistory = dataProvider.getHistory();\n // FIXME: find a better history-limit\n // return allHistory.slice(0, 10).map((expr) => ({\n // type: 'HISTORY',\n // label: expr,\n // insertText: expr,\n // }));\n}\n\nasync function getLabelNames(metric: string | undefined, otherLabels: Label[], dataProvider: DataProvider): Promise<string[]> {\n if (metric === undefined || metric === '') {\n const selector = makeSelector('', otherLabels);\n return await dataProvider.fetchLabels(selector);\n } else {\n const selector = makeSelector(metric, otherLabels);\n const series = await dataProvider.fetchSeries(selector);\n const labelNames = new Set<string>();\n for (const labelSet of series) {\n for (const [key] of Object.entries(labelSet)) {\n if (key === '__name__') {\n continue;\n }\n labelNames.add(key);\n }\n }\n return Array.from(labelNames);\n }\n}\n\nasync function getLabelNamesForCompletions(\n metric: string | undefined,\n suffix: string,\n triggerOnInsert: boolean,\n otherLabels: Label[],\n dataProvider: DataProvider,\n): Promise<Completion[]> {\n const labelNames = await getLabelNames(metric, otherLabels, dataProvider);\n return labelNames.map((text) => ({\n type: 'LABEL_NAME',\n label: text,\n insertText: `${text}${suffix}`,\n triggerOnInsert,\n }));\n}\n\nasync function getLabelNamesForSelectorCompletions(metric: string | undefined, otherLabels: Label[], dataProvider: DataProvider): Promise<Completion[]> {\n return getLabelNamesForCompletions(metric, '=', true, otherLabels, dataProvider);\n}\n\nasync function getLabelNamesForByCompletions(metric: string | undefined, otherLabels: Label[], dataProvider: DataProvider): Promise<Completion[]> {\n return getLabelNamesForCompletions(metric, '', false, otherLabels, dataProvider);\n}\n\nasync function getLabelValues(metric: string | undefined, labelName: string, otherLabels: Label[], dataProvider: DataProvider): Promise<string[]> {\n if (metric === undefined || metric === '') {\n const selector = makeSelector('', otherLabels);\n return await dataProvider.fetchLabelValues(labelName, selector);\n } else {\n const selector = makeSelector(metric, otherLabels, labelName);\n const series = await dataProvider.fetchSeries(selector);\n const labelValues = new Set<string>();\n for (const labelSet of series) {\n for (const [key, value] of Object.entries(labelSet)) {\n if (key === '__name__') {\n continue;\n }\n if (key === labelName) {\n labelValues.add(value);\n }\n }\n }\n const variablesNames = dataProvider.getVariablesNames();\n return variablesNames.concat(Array.from(labelValues));\n }\n}\n\nasync function getLabelValuesForMetricCompletions(\n metric: string | undefined,\n labelName: string,\n betweenQuotes: boolean,\n otherLabels: Label[],\n dataProvider: DataProvider,\n): Promise<Completion[]> {\n const values = await getLabelValues(metric, labelName, otherLabels, dataProvider);\n return values.map((text) => ({\n type: 'LABEL_VALUE',\n label: text,\n insertText: betweenQuotes ? text : `\"${text}\"`, // FIXME: escaping strange characters?\n }));\n}\n\nexport function getCompletions(situation: Situation, dataProvider: DataProvider): Promise<Completion[]> {\n switch (situation.type) {\n case 'IN_DURATION':\n if (dataProvider.durationVariablesCompletion) {\n return Promise.resolve(DURATION_VARIABLES_COMPLETIONS.concat(DURATION_COMPLETIONS));\n }\n return Promise.resolve(DURATION_COMPLETIONS);\n case 'IN_FUNCTION':\n return getAllFunctionsAndMetricNamesCompletions(dataProvider);\n case 'AT_ROOT': {\n return getAllFunctionsAndMetricNamesCompletions(dataProvider);\n }\n case 'EMPTY': {\n const metricNames = getAllMetricNamesCompletions(dataProvider);\n const historyCompletions = getAllHistoryCompletions(dataProvider);\n return Promise.resolve([...historyCompletions, ...FUNCTION_COMPLETIONS, ...metricNames]);\n }\n case 'IN_LABEL_SELECTOR_NO_LABEL_NAME':\n return getLabelNamesForSelectorCompletions(situation.metricName, situation.otherLabels, dataProvider);\n case 'IN_GROUPING':\n return getLabelNamesForByCompletions(situation.metricName, situation.otherLabels, dataProvider);\n case 'IN_LABEL_SELECTOR_WITH_LABEL_NAME':\n return getLabelValuesForMetricCompletions(situation.metricName, situation.labelName, situation.betweenQuotes, situation.otherLabels, dataProvider);\n default:\n throw new NeverCaseError(situation);\n }\n}\n","import type * as monacoTypes from 'monaco-editor/esm/vs/editor/editor.api';\n\nimport { NeverCaseError } from '../util';\nimport { DataProvider } from './DataProvider';\nimport { getSituation } from './situation';\nimport { getCompletions } from './completions';\n\nexport type { monacoTypes };\nexport type Monaco = typeof monacoTypes;\nexport type CompletionType = 'HISTORY' | 'FUNCTION' | 'METRIC_NAME' | 'DURATION' | 'LABEL_NAME' | 'LABEL_VALUE';\n\nfunction getMonacoCompletionItemKind(type: CompletionType, monaco: Monaco): monacoTypes.languages.CompletionItemKind {\n switch (type) {\n case 'DURATION':\n return monaco.languages.CompletionItemKind.Unit;\n case 'FUNCTION':\n return monaco.languages.CompletionItemKind.Variable;\n case 'HISTORY':\n return monaco.languages.CompletionItemKind.Snippet;\n case 'LABEL_NAME':\n return monaco.languages.CompletionItemKind.Enum;\n case 'LABEL_VALUE':\n return monaco.languages.CompletionItemKind.EnumMember;\n case 'METRIC_NAME':\n return monaco.languages.CompletionItemKind.Constructor;\n default:\n throw new NeverCaseError(type);\n }\n}\n\nexport function getCompletionProvider(monaco: Monaco, dataProvider: DataProvider): monacoTypes.languages.CompletionItemProvider {\n const provideCompletionItems = (\n model: monacoTypes.editor.ITextModel,\n position: monacoTypes.Position,\n ): monacoTypes.languages.ProviderResult<monacoTypes.languages.CompletionList> => {\n const word = model.getWordAtPosition(position);\n const range =\n word != null\n ? monaco.Range.lift({\n startLineNumber: position.lineNumber,\n endLineNumber: position.lineNumber,\n startColumn: word.startColumn,\n endColumn: word.endColumn,\n })\n : monaco.Range.fromPositions(position);\n // documentation says `position` will be \"adjusted\" in `getOffsetAt`\n // i don't know what that means, to be sure i clone it\n\n const positionClone = {\n column: position.column,\n lineNumber: position.lineNumber,\n };\n dataProvider.monacoSettings.setInputInRange(model.getValueInRange(range));\n\n // Check to see if the browser supports window.getSelection()\n if (window.getSelection) {\n const selectedText = window.getSelection()?.toString();\n // If the user has selected text, adjust the cursor position to be at the start of the selection, instead of the end\n if (selectedText && selectedText.length > 0) {\n positionClone.column = positionClone.column - selectedText.length;\n }\n }\n\n const offset = model.getOffsetAt(positionClone);\n const situation = getSituation(model.getValue(), offset);\n const completionsPromise = situation != null ? getCompletions(situation, dataProvider) : Promise.resolve([]);\n\n return completionsPromise.then((items) => {\n // monaco by-default alphabetically orders the items.\n // to stop it, we use a number-as-string sortkey,\n // so that monaco keeps the order we use\n const maxIndexDigits = items.length.toString().length;\n const suggestions: monacoTypes.languages.CompletionItem[] = items.map((item, index) => ({\n kind: getMonacoCompletionItemKind(item.type, monaco),\n label: item.label,\n insertText: item.insertText,\n detail: item.detail,\n documentation: item.documentation,\n sortText: index.toString().padStart(maxIndexDigits, '0'), // to force the order we have\n range,\n command: item.triggerOnInsert\n ? {\n id: 'editor.action.triggerSuggest',\n title: '',\n }\n : undefined,\n }));\n return { suggestions, incomplete: dataProvider.monacoSettings.suggestionsIncomplete };\n });\n };\n\n return {\n triggerCharacters: ['{', ',', '[', '(', '=', '~', ' ', '\"'],\n provideCompletionItems,\n };\n}\n","import { SyntaxNode } from '@lezer/common';\nimport { LRParser } from '@lezer/lr';\n\nexport const ErrorId = 0;\n\ninterface ParserErrorBoundary {\n startLineNumber: number;\n startColumn: number;\n endLineNumber: number;\n endColumn: number;\n error: string;\n}\n\ninterface ParseError {\n text: string;\n node: SyntaxNode;\n}\n\nexport function validateQuery(query: string, interpolatedQuery: string, queryLines: string[], parser: LRParser): ParserErrorBoundary[] | false {\n if (!query) {\n return false;\n }\n\n const interpolatedErrors: ParseError[] = parseQuery(interpolatedQuery, parser);\n if (!interpolatedErrors.length) {\n return false;\n }\n\n let parseErrors: ParseError[] = interpolatedErrors;\n if (query !== interpolatedQuery) {\n const queryErrors: ParseError[] = parseQuery(query, parser);\n parseErrors = interpolatedErrors.flatMap((interpolatedError) => queryErrors.filter((queryError) => interpolatedError.text === queryError.text) || interpolatedError);\n }\n\n return parseErrors.map((parseError) => findErrorBoundary(query, queryLines, parseError)).filter(isErrorBoundary);\n}\n\nfunction parseQuery(query: string, parser: LRParser) {\n const parseErrors: ParseError[] = [];\n const tree = parser.parse(query);\n tree.iterate({\n enter: (nodeRef): false | void => {\n if (nodeRef.type.id === ErrorId) {\n const node = nodeRef.node;\n parseErrors.push({\n node: node,\n text: query.substring(node.from, node.to),\n });\n }\n },\n });\n return parseErrors;\n}\n\nfunction findErrorBoundary(query: string, queryLines: string[], parseError: ParseError): ParserErrorBoundary | null {\n if (queryLines.length === 1) {\n const isEmptyString = parseError.node.from === parseError.node.to;\n const errorNode = isEmptyString && parseError.node.parent ? parseError.node.parent : parseError.node;\n const error = isEmptyString ? query.substring(errorNode.from, errorNode.to) : parseError.text;\n return {\n startLineNumber: 1,\n startColumn: errorNode.from + 1,\n endLineNumber: 1,\n endColumn: errorNode.to + 1,\n error,\n };\n }\n\n let startPos = 0,\n endPos = 0;\n for (let line = 0; line < queryLines.length; line++) {\n endPos = startPos + queryLines[line].length;\n\n if (parseError.node.from > endPos) {\n startPos += queryLines[line].length + 1;\n continue;\n }\n\n return {\n startLineNumber: line + 1,\n startColumn: parseError.node.from - startPos + 1,\n endLineNumber: line + 1,\n endColumn: parseError.node.to - startPos + 1,\n error: parseError.text,\n };\n }\n\n return null;\n}\n\nfunction isErrorBoundary(boundary: ParserErrorBoundary | null): boundary is ParserErrorBoundary {\n return boundary !== null;\n}\n","import React, { useEffect, useRef } from 'react';\nimport MonacoEditor from 'react-monaco-editor';\nimport * as monaco from 'monaco-editor';\nimport { promLanguageDefinition } from 'monaco-promql';\nimport type * as monacoTypes from 'monaco-editor/esm/vs/editor/editor.api';\nimport { parser } from '@fc-components/lezer-metricsql';\nimport { v4 as uuidv4 } from 'uuid';\nimport { css } from '@emotion/css';\n\nimport { language, languageConfiguration } from './promql';\nimport { DataProvider } from './completion/DataProvider';\nimport { getCompletionProvider } from './completion/getCompletionProvider';\nimport type { DataProviderParams } from './types';\nimport { validateQuery } from './validation';\n\ninterface PromQLEditorProps {\n size?: 'small' | 'middle' | 'large';\n theme?: 'light' | 'dark';\n value?: string;\n placeholder?: string;\n enableAutocomplete?: boolean;\n durationVariablesCompletion?: boolean;\n readOnly?: boolean;\n disabled?: boolean;\n interpolateString?: (query: string) => string;\n onChange?: (value: string) => void;\n onEnter?: (value: string) => void;\n onBlur?: (value: string) => void;\n editorDidMount?: (editor: monacoTypes.editor.IStandaloneCodeEditor) => void;\n}\n\nconst PROMQL_LANG_ID = promLanguageDefinition.id;\nconst SIZE_MAP: Record<\n string,\n {\n className: string;\n top: number;\n bottom: number;\n }\n> = {\n small: {\n className: 'ant-input-sm',\n top: 1,\n bottom: 1,\n },\n middle: {\n className: 'ant-input-md',\n top: 1,\n bottom: 1,\n },\n large: {\n className: 'ant-input-lg',\n top: 3,\n bottom: 2,\n },\n};\nconst themeMap: Record<string, string> = {\n light: 'n9e-light',\n dark: 'n9e-dark',\n};\n\nconst containerDisabledClassName = css`\n .monaco-editor {\n user-select: none;\n pointer-events: none;\n }\n`;\n\nconst containerReadOnlyClassName = css`\n .monaco-editor .cursors-layer > .cursor {\n opacity: 0 !important; /* 完全透明 */\n }\n`;\n\nconst getStyles = (placeholder?: string) => {\n return {\n placeholder: css({\n '::after': {\n content: `'${placeholder}'`,\n opacity: 0.6,\n },\n }),\n };\n};\n\nexport default function PromQLEditor(props: PromQLEditorProps & DataProviderParams) {\n const id = uuidv4();\n const {\n size = 'middle',\n theme = 'light',\n value,\n placeholder,\n interpolateString,\n enableAutocomplete = true,\n readOnly = false,\n disabled = false,\n onChange,\n onEnter,\n onBlur,\n editorDidMount,\n } = props;\n const autocompleteDisposeFun = useRef<(() => void) | null>(null);\n const containerRef = useRef<HTMLDivElement>(null);\n const dataProviderRef = useRef<DataProvider | null>(null);\n const editorRef = useRef<monacoTypes.editor.IStandaloneCodeEditor | null>(null);\n const styles = getStyles(placeholder);\n const handleEditorDidMount = (editor: monacoTypes.editor.IStandaloneCodeEditor) => {\n editorRef.current = editor;\n\n monaco.editor.defineTheme('n9e-light', {\n base: 'vs',\n inherit: true,\n rules: [],\n colors: {\n 'editor.background': '#00000000',\n focusBorder: '#00000000',\n },\n });\n\n monaco.editor.defineTheme('n9e-dark', {\n base: 'vs-dark',\n inherit: true,\n rules: [],\n colors: {\n 'editor.background': '#00000000',\n focusBorder: '#00000000',\n },\n });\n\n const isEditorFocused = editor.createContextKey<boolean>('isEditorFocused' + id, false);\n // we setup on-blur\n editor.onDidBlurEditorWidget(() => {\n isEditorFocused.set(false);\n onBlur?.(editor.getValue());\n // reset the selection to the current position\n const position = editor.getPosition();\n if (position) {\n const newSelection = new monaco.Selection(position.lineNumber, position.column, position.lineNumber, position.column);\n editor.setSelection(newSelection);\n }\n });\n\n editor.onDidFocusEditorText(() => {\n isEditorFocused.set(true);\n });\n\n // set the height of the editor container\n const updateElementHeight = () => {\n const containerDiv = containerRef.current;\n if (containerDiv !== null) {\n const pixelHeight = editor.getContentHeight();\n containerDiv.style.height = `${pixelHeight}px`;\n containerDiv.style.width = '100%';\n const pixelWidth = containerDiv.clientWidth;\n editor.layout({ width: pixelWidth, height: pixelHeight });\n }\n };\n\n editor.onDidContentSizeChange(updateElementHeight);\n updateElementHeight();\n\n // Fixes Monaco capturing the search key binding and displaying a useless search box within the Editor.\n monaco.editor.addKeybindingRule({\n keybinding: monaco.KeyMod.CtrlCmd | monaco.KeyCode.KeyF,\n command: null,\n });\n\n // 设置 Shift + Enter 为在光标位置换行\n editor.addCommand(\n monaco.KeyMod.Shift | monaco.KeyCode.Enter,\n () => {\n // 在光标位置插入换行符\n const position = editor.getPosition();\n if (position) {\n editor.executeEdits('shift-enter', [\n {\n range: new monaco.Range(position.lineNumber, position.column, position.lineNumber, position.column),\n text: '\\n',\n },\n ]);\n // 将光标移动到新行\n editor.setPosition({\n lineNumber: position.lineNumber + 1,\n column: 1,\n });\n }\n },\n 'isEditorFocused' + id,\n );\n\n // 完全阻止 Enter 键的默认行为(包括换行)\n monaco.editor.addKeybindingRule({\n keybinding: monaco.KeyCode.Enter,\n command: '-',\n when: '!suggestWidgetVisible',\n });\n\n // handle: enter - 只有在没有建议窗口时才执行自定义行为\n editor.addCommand(\n monaco.KeyCode.Enter,\n () => {\n onEnter?.(editor.getValue());\n },\n '!suggestWidgetVisible && isEditorFocused' + id,\n );\n\n editor.onDidChangeModelContent(() => {\n const model = editor.getModel();\n if (model) {\n const query = model.getValue();\n const errors = validateQuery(query, interpolateString ? interpolateString(query) : query, model.getLinesContent(), parser) || [];\n const markers = errors.map(({ error, ...boundary }) => ({\n message: `${error ? `Error parsing \"${error}\"` : 'Parse error'}. The query appears to be incorrect and could fail to be executed.`,\n severity: monaco.MarkerSeverity.Error,\n ...boundary,\n }));\n\n monaco.editor.setModelMarkers(model, 'owner', markers);\n }\n });\n\n editorDidMount?.(editor);\n };\n\n useEffect(() => {\n // 注册 PromQL 语言\n const { aliases, extensions, mimetypes } = promLanguageDefinition;\n monaco.languages.register({\n id: PROMQL_LANG_ID,\n aliases,\n extensions,\n mimetypes,\n });\n\n // 设置语法高亮\n monaco.languages.setMonarchTokensProvider(PROMQL_LANG_ID, language as any);\n\n // 设置语言配置\n monaco.languages.setLanguageConfiguration(PROMQL_LANG_ID, languageConfiguration as any);\n\n return () => {\n autocompleteDisposeFun.current?.();\n dataProviderRef.current = null;\n };\n }, []);\n\n useEffect(() => {\n const editor = editorRef.current;\n if (!editor) return;\n\n // clean up previous autocomplete provider\n if (autocompleteDisposeFun.current) {\n autocompleteDisposeFun.current();\n autocompleteDisposeFun.current = null;\n }\n dataProviderRef.current = null;\n\n // If autocomplete is enabled, set up a new autocomplete provider\n if (enableAutocomplete) {\n const dataProvider = new DataProvider({\n url: props.url,\n lookbackInterval: props.lookbackInterval,\n variablesNames: props.variablesNames,\n durationVariablesCompletion: props.durationVariablesCompletion,\n request: props.request,\n httpMethod: props.httpMethod,\n apiPrefix: props.apiPrefix,\n httpErrorHandler: props.httpErrorHandler,\n });\n dataProviderRef.current = dataProvider;\n dataProvider.start();\n\n const completionProvider = getCompletionProvider(monaco, dataProvider);\n\n const filteringCompletionProvider: monacoTypes.languages.CompletionItemProvider = {\n ...completionProvider,\n provideCompletionItems: (model, position, context, token) => {\n if (editor.getModel()?.id !== model.id) {\n return { suggestions: [] };\n }\n return completionProvider.provideCompletionItems(model, position, context, token);\n },\n };\n\n const { dispose } = monaco.languages.registerCompletionItemProvider(PROMQL_LANG_ID, filteringCompletionProvider);\n autocompleteDisposeFun.current = dispose;\n }\n\n // clean up previous placeholder decorations\n const model = editor.getModel();\n if (model) {\n model.deltaDecorations(\n model.getAllDecorations().map((d) => d.id),\n [],\n );\n }\n\n if (placeholder) {\n const placeholderDecorators = [\n {\n range: new monaco.Range(1, 1, 1, 1),\n options: {\n className: styles.placeholder,\n isWholeLine: true,\n },\n },\n ];\n\n let decorators: string[] = [];\n\n const checkDecorators: () => void = () => {\n const model = editor.getModel();\n\n if (!model) {\n return;\n }\n\n const newDecorators = model.getValueLength() === 0 ? placeholderDecorators : [];\n decorators = model.deltaDecorations(decorators, newDecorators);\n };\n\n checkDecorators();\n editor.onDidChangeModelContent(checkDecorators);\n }\n }, [\n enableAutocomplete,\n props.url,\n props.lookbackInterval,\n JSON.stringify(props.variablesNames),\n props.durationVariablesCompletion,\n props.httpMethod,\n props.apiPrefix,\n placeholder,\n ]);\n\n return (\n <div\n className={\n 'ant-input' +\n (size ? ` ${SIZE_MAP[size].className}` : '') +\n (disabled ? ` ant-input-disabled ${containerDisabledClassName}` : '') +\n (readOnly ? ` ${containerReadOnlyClassName}` : '')\n }\n >\n <div ref={containerRef}>\n <MonacoEditor\n width='100%'\n height='100%'\n language='promql'\n theme={themeMap[theme]}\n value={value}\n onChange={onChange}\n editorDidMount={handleEditorDidMount}\n options={{\n readOnly,\n codeLens: false,\n contextmenu: false,\n fixedOverflowWidgets: true,\n folding: false,\n fontSize: 12,\n lineDecorationsWidth: 0,\n lineNumbers: 'off',\n minimap: { enabled: false },\n overviewRulerBorder: false,\n overviewRulerLanes: 0,\n padding: {\n top: SIZE_MAP[size].top,\n bottom: SIZE_MAP[size].bottom,\n },\n renderLineHighlight: 'none',\n scrollbar: {\n vertical: 'hidden',\n verticalScrollbarSize: 8,\n horizontal: 'hidden',\n horizontalScrollbarSize: 0,\n alwaysConsumeMouseWheel: false,\n },\n scrollBeyondLastLine: false,\n suggest: {\n showWords: false,\n // 防止补全层自动关闭的关键配置\n filterGraceful: false, // 禁用优雅过滤,避免在输入时关闭补全\n snippetsPreventQuickSuggestions: false, // 允许在代码片段后继续显示补全\n shareSuggestSelections: false, // 不共享选择状态,避免意外关闭\n },\n suggestFontSize: 12,\n wordWrap: 'on',\n automaticLayout: true,\n occurrencesHighlight: 'off', // Disable word highlighting\n }}\n />\n </div>\n </div>\n );\n}\n"],"names":["languageConfiguration","wordPattern","comments","lineComment","brackets","autoClosingPairs","open","close","surroundingPairs","folding","aggregations","functions","aggregationsOverTime","_i","aggregations_1","length","agg","push","vectorMatching","vectorMatchingRegex","reduce","prev","curr","operators","offsetModifier","keywords","concat","language","ignoreCase","defaultToken","tokenPostfix","symbols","escapes","digits","octaldigits","binarydigits","hexdigits","integersuffix","floatsuffix","tokenizer","root","cases","include","string_double","string_single","string_backtick","clauses","whitespace","TRIGONOMETRIC_FUNCTIONS","label","insertText","detail","documentation","AGGREGATION_OPERATORS","FUNCTIONS","NeverCaseError","_Error","_value","call","_inheritsLoose","_wrapNativeSuper","Error","escapeLabelValueInExactSelector","labelValue","replace","makeSelector","metricName","labels","labelName","allLabels","filter","name","value","allLabelTexts","map","op","join","DEFAULT_SERIES_LIMIT","badRequest","unprocessableEntity","serviceUnavailable","CODE_MODE_SUGGESTIONS_INCOMPLETE_EVENT","DataProvider","params","input","init","fetch","_ref","_asyncToGenerator","_regenerator","m","_callee","selector","withLimit","end","start","url","urlParams","request","w","_context","n","Date","getTime","_this","lookbackInterval","apiPrefix","toISOString","_extends","limit","buildRequest","URLSearchParams","uri","method","httpMethod","body","a","v","_x","_x2","apply","arguments","_ref2","_callee2","_context2","then","res","labelKeys","_x3","_ref3","_callee3","_context3","_x4","_x5","_callee4","_t","_context4","fetchLabelValues","metrics","Promise","all","loadMetricsMetadata","inputInRange","metricNamesSuggestionLimit","suggestionsIncomplete","errorHandler","httpErrorHandler","variablesNames","durationVariablesCompletion","_params$durationVaria","customRequest","_proto","prototype","getVariablesNames","setVariablesNames","endpoint","resource","ok","includes","status","statusText","json","apiRes","error","undefined","_this2","data","getAllMetricNames","_loadMetricsMetadata","_callee5","_context5","metricsMetadata","metricNamesToMetrics","metricNames","result","metaItem","_this3$metricsMetadat","_this3","help","_metaItem$help","type","_metaItem$type","setInputInRange","textInput","enableAutocompleteSuggestionsUpdate","dispatchEvent","CustomEvent","_createClass","key","get","bind","move","node","direction","parent","firstChild","lastChild","nextSibling","walk","path","current","_iterator","_createForOfIteratorHelperLoose","_step","done","_step$value","expectedType","id","getNodeText","text","slice","from","to","parsePromQLStringLiteral","inside","startsWith","endsWith","isPathMatch","resolverPath","cursorPath","every","item","index","ERROR_NODE_NAME","RESOLVERS","LabelMatchers","VectorSelector","fun","resolveLabelKeysWithEquals","PromQL","resolveTopLevel","FunctionCallBody","resolveInFunction","StringLiteral","UnquotedLabelMatcher","resolveLabelMatcher","BinaryExpr","NumberDurationLiteralInDurationContext","MatrixSelector","resolveDurations","GroupingLabels","resolveLabelsForGrouping","LABEL_OP_MAP","Map","EqlSingle","EqlRegex","Neq","NeqRegex","getLabelOp","opNode","opChild","_LABEL_OP_MAP$get","getLabel","labelMatcherNode","nameNode","LabelName","MatchOp","valueNode","getLabels","labelMatchersNode","labelNodes","getChildren","ln","notEmpty","getNodeChildren","child","children","getNodeInSubtree","typeId","_iterator2","_step2","_pos","aggrExpNode","AggregateModifier","AggregateExpr","bodyNode","getChild","metricIdNode","Identifier","otherLabels","inStringNode","isError","labelNameNode","metricNameNode","betweenQuotes","pos","textToCheck","getErrorNode","tree","cur","cursorAt","next","getSituation","parser","parse","maybeErrorNode","cursor","currentNode","ids","_iterator3","_step3","resolver","metricNamesSearchClient","UFuzzy","intraMode","getAllMetricNamesCompletions","dataProvider","monacoSettings","_metricNamesSearchCli","_metricNamesSearchCli2","idx","metric","FUNCTION_COMPLETIONS","f","_f$insertText","getAllFunctionsAndMetricNamesCompletions","_getAllFunctionsAndMetricNamesCompletions","DURATION_COMPLETIONS","DURATION_VARIABLES_COMPLETIONS","getAllHistoryCompletions","_dataProvider","getLabelNames","_getLabelNames","_selector","series","labelNames","labelSet","_Object$entries","_Object$entries$_i","fetchLabels","fetchSeries","Set","Object","entries","add","Array","getLabelNamesForCompletions","_x6","_x7","_x8","_x9","_getLabelNamesForCompletions","suffix","triggerOnInsert","getLabelNamesForSelectorCompletions","_x0","_x1","_x10","_getLabelNamesForSelectorCompletions","getLabelNamesForByCompletions","_x11","_x12","_x13","_getLabelNamesForByCompletions","getLabelValues","_x14","_x15","_x16","_x17","_getLabelValues","_callee6","_selector2","labelValues","_i2","_Object$entries2","_Object$entries2$_i","_context6","getLabelValuesForMetricCompletions","_x18","_x19","_x20","_x21","_x22","_getLabelValuesForMetricCompletions","_callee7","values","_context7","getCompletions","situation","resolve","historyCompletions","getMonacoCompletionItemKind","monaco","languages","CompletionItemKind","Unit","Variable","Snippet","Enum","EnumMember","Constructor","getCompletionProvider","provideCompletionItems","model","position","word","getWordAtPosition","range","Range","lift","startLineNumber","lineNumber","endLineNumber","startColumn","endColumn","fromPositions","positionClone","column","getValueInRange","window","getSelection","_window$getSelection","selectedText","toString","offset","getOffsetAt","getValue","completionsPromise","items","maxIndexDigits","suggestions","kind","sortText","padStart","command","title","incomplete","triggerCharacters","ErrorId","validateQuery","query","interpolatedQuery","queryLines","interpolatedErrors","parseQuery","parseErrors","queryErrors","flatMap","interpolatedError","queryError","parseError","findErrorBoundary","isErrorBoundary","iterate","enter","nodeRef","substring","isEmptyString","errorNode","startPos","endPos","line","boundary","PROMQL_LANG_ID","promLanguageDefinition","SIZE_MAP","small","className","top","bottom","middle","large","themeMap","light","dark","containerDisabledClassName","css","_templateObject","_taggedTemplateLiteralLoose","containerReadOnlyClassName","_templateObject2","getStyles","placeholder","content","opacity","PromQLEditor","props","uuidv4","_props$size","size","_props$theme","theme","interpolateString","_props$enableAutocomp","enableAutocomplete","_props$readOnly","readOnly","_props$disabled","disabled","onChange","onEnter","onBlur","editorDidMount","autocompleteDisposeFun","useRef","containerRef","dataProviderRef","editorRef","styles","handleEditorDidMount","editor","defineTheme","base","inherit","rules","colors","focusBorder","isEditorFocused","createContextKey","onDidBlurEditorWidget","set","getPosition","newSelection","setSelection","onDidFocusEditorText","updateElementHeight","containerDiv","pixelHeight","getContentHeight","style","height","width","pixelWidth","clientWidth","layout","onDidContentSizeChange","addKeybindingRule","keybinding","CtrlCmd","KeyF","addCommand","Shift","Enter","executeEdits","setPosition","when","onDidChangeModelContent","getModel","errors","getLinesContent","markers","_objectWithoutPropertiesLoose","_excluded","message","severity","setModelMarkers","useEffect","aliases","extensions","mimetypes","register","setMonarchTokensProvider","setLanguageConfiguration","completionProvider","filteringCompletionProvider","context","token","_editor$getModel","_monaco$languages$reg","registerCompletionItemProvider","dispose","deltaDecorations","getAllDecorations","d","placeholderDecorators","options","isWholeLine","decorators","checkDecorators","newDecorators","getValueLength","JSON","stringify","React","ref","MonacoEditor","codeLens","contextmenu","fixedOverflowWidgets","fontSize","lineDecorationsWidth","lineNumbers","minimap","enabled","overviewRulerBorder","overviewRulerLanes","padding","renderLineHighlight","scrollbar","vertical","verticalScrollbarSize","horizontal","horizontalScrollbarSize","alwaysConsumeMouseWheel","scrollBeyondLastLine","suggest","showWords","filterGraceful","snippetsPreventQuickSuggestions","shareSuggestSelections","suggestFontSize","wordWrap","automaticLayout","occurrencesHighlight"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAO,IAAMA,qBAAqB,GAAG;;EAEnCC,WAAW,EAAE,4DAA4D;;EAEzEC,QAAQ,EAAE;IACRC,WAAW,EAAE;GACd;EACDC,QAAQ,EAAE,CACR,CAAC,GAAG,EAAE,GAAG,CAAC,EACV,CAAC,GAAG,EAAE,GAAG,CAAC,EACV,CAAC,GAAG,EAAE,GAAG,CAAC,CACX;EACDC,gBAAgB,EAAE,CAChB;IAAEC,IAAI,EAAE,GAAG;IAAEC,KAAK,EAAE;GAAK,EACzB;IAAED,IAAI,EAAE,GAAG;IAAEC,KAAK,EAAE;GAAK,EACzB;IAAED,IAAI,EAAE,GAAG;IAAEC,KAAK,EAAE;GAAK,EACzB;IAAED,IAAI,EAAE,GAAG;IAAEC,KAAK,EAAE;GAAK,EACzB;IAAED,IAAI,EAAE,GAAG;IAAEC,KAAK,EAAE;GAAK,CAC1B;EACDC,gBAAgB,EAAE,CAChB;IAAEF,IAAI,EAAE,GAAG;IAAEC,KAAK,EAAE;GAAK,EACzB;IAAED,IAAI,EAAE,GAAG;IAAEC,KAAK,EAAE;GAAK,EACzB;IAAED,IAAI,EAAE,GAAG;IAAEC,KAAK,EAAE;GAAK,EACzB;IAAED,IAAI,EAAE,GAAG;IAAEC,KAAK,EAAE;GAAK,EACzB;IAAED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