From 4caae4e4a6381a74c80941d04df0929d342965a5 Mon Sep 17 00:00:00 2001 From: Augustin Husson Date: Mon, 8 Nov 2021 14:32:38 +0100 Subject: [PATCH] add a negative boost for some trigonometric functions that can overlapp other regular promQL functions (#9688) * add a negative boost for some trigonometric functions that can overlapp other regular promQL functions Signed-off-by: Augustin Husson * add comments to explain the purpose of the attribute boost Signed-off-by: Augustin Husson --- .../module/codemirror-promql/src/complete/promql.terms.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/web/ui/module/codemirror-promql/src/complete/promql.terms.ts b/web/ui/module/codemirror-promql/src/complete/promql.terms.ts index 4aba94e9f..5b2da2088 100644 --- a/web/ui/module/codemirror-promql/src/complete/promql.terms.ts +++ b/web/ui/module/codemirror-promql/src/complete/promql.terms.ts @@ -142,12 +142,16 @@ export const functionIdentifierTerms = [ detail: 'function', info: 'Calculate the cosine, in radians, for input series', type: 'function', + // Avoid ranking higher than `count`. + boost: -1, }, { label: 'cosh', detail: 'function', info: 'Calculate the hyperbolic cosine, in radians, for input series', type: 'function', + // Avoid ranking higher than `count`. + boost: -1, }, { label: 'count_over_time', @@ -178,6 +182,8 @@ export const functionIdentifierTerms = [ detail: 'function', info: 'Convert radians to degrees for input series', type: 'function', + // Avoid ranking higher than `delta`. + boost: -1, }, { label: 'delta', @@ -328,6 +334,8 @@ export const functionIdentifierTerms = [ detail: 'function', info: 'Convert degrees to radians for input series', type: 'function', + // Avoid ranking higher than `rate`. + boost: -1, }, { label: 'rate',