Skip to content

Commit

Permalink
[ES|QL] Treat METRICS command as source command in autocomplete (#1…
Browse files Browse the repository at this point in the history
…90034)

## Summary

Closes #189945

---------

Co-authored-by: Elastic Machine <[email protected]>
  • Loading branch information
vadimkibana and elasticmachine authored Aug 8, 2024
1 parent d82e65a commit e40c095
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ describe('autocomplete', () => {
},
});

const sourceCommands = ['row', 'from', 'show'];
const sourceCommands = ['row', 'from', 'show', 'metrics'];

describe('New command', () => {
testSuggestions(
Expand Down Expand Up @@ -1278,7 +1278,7 @@ describe('autocomplete', () => {
// Source command
testSuggestions(
'F',
['FROM $0', 'ROW $0', 'SHOW $0'].map(attachTriggerCommand).map(attachAsSnippet),
['FROM $0', 'ROW $0', 'SHOW $0', 'METRICS $0'].map(attachTriggerCommand).map(attachAsSnippet),
undefined,
1
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ export function isComma(char: string) {
}

export function isSourceCommand({ label }: { label: string }) {
return ['FROM', 'ROW', 'SHOW'].includes(label);
return ['FROM', 'ROW', 'SHOW', 'METRICS'].includes(label);
}

let fnLookups: Map<string, FunctionDefinition> | undefined;
Expand Down

0 comments on commit e40c095

Please sign in to comment.