feat(loki-monaco-editor): add support for in_aggregation situation (#56680)

This commit is contained in:
Matias Chomicki 2022-10-11 17:52:57 +02:00 committed by GitHub
parent 33eb4a2807
commit 6a74cd207a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -75,11 +75,9 @@ describe('situation', () => {
labels: [{ name: 'level', value: 'info', op: '=' }],
});
/*
Currently failing, reason unknown
assertSituation('sum(^)', {
type: 'IN_AGGREGATION',
});*/
});
});
it('handles label names', () => {

View File

@ -17,6 +17,8 @@ import {
Identifier,
Grouping,
Expr,
LiteralExpr,
MetricExpr,
} from '@grafana/lezer-logql';
type Direction = 'parent' | 'firstChild' | 'lastChild' | 'nextSibling';
@ -162,7 +164,7 @@ const RESOLVERS: Resolver[] = [
fun: resolveLogRangeFromError,
},
{
path: [ERROR_NODE_ID, VectorAggregationExpr],
path: [ERROR_NODE_ID, LiteralExpr, MetricExpr, VectorAggregationExpr, MetricExpr, Expr, LogQL],
fun: () => ({ type: 'IN_AGGREGATION' }),
},
{