fix(loki-completions): remove rate_interval

Not supported
This commit is contained in:
Matias Chomicki 2022-10-05 17:12:10 +02:00
parent dea9dc2f0f
commit 3ae2769343
2 changed files with 17 additions and 16 deletions

View File

@ -160,7 +160,16 @@ describe('getCompletions', () => {
const situation: Situation = { type: 'IN_DURATION' }; const situation: Situation = { type: 'IN_DURATION' };
const completions = await getCompletions(situation, completionProvider); const completions = await getCompletions(situation, completionProvider);
expect(completions).toHaveLength(9); expect(completions).toEqual([
{ insertText: '$__interval', label: '$__interval', type: 'DURATION' },
{ insertText: '$__range', label: '$__range', type: 'DURATION' },
{ insertText: '1m', label: '1m', type: 'DURATION' },
{ insertText: '5m', label: '5m', type: 'DURATION' },
{ insertText: '10m', label: '10m', type: 'DURATION' },
{ insertText: '30m', label: '30m', type: 'DURATION' },
{ insertText: '1h', label: '1h', type: 'DURATION' },
{ insertText: '1d', label: '1d', type: 'DURATION' },
]);
}); });
test('Returns completion options when the situation is IN_GROUPING', async () => { test('Returns completion options when the situation is IN_GROUPING', async () => {

View File

@ -55,21 +55,13 @@ const FUNCTION_COMPLETIONS: Completion[] = RANGE_VEC_FUNCTIONS.map((f) => ({
documentation: f.documentation, documentation: f.documentation,
})); }));
const DURATION_COMPLETIONS: Completion[] = [ const DURATION_COMPLETIONS: Completion[] = ['$__interval', '$__range', '1m', '5m', '10m', '30m', '1h', '1d'].map(
'$__interval', (text) => ({
'$__range',
'$__rate_interval',
'1m',
'5m',
'10m',
'30m',
'1h',
'1d',
].map((text) => ({
type: 'DURATION', type: 'DURATION',
label: text, label: text,
insertText: text, insertText: text,
})); })
);
const LINE_FILTER_COMPLETIONS: Completion[] = ['|=', '!=', '|~', '!~'].map((item) => ({ const LINE_FILTER_COMPLETIONS: Completion[] = ['|=', '!=', '|~', '!~'].map((item) => ({
type: 'LINE_FILTER', type: 'LINE_FILTER',