mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
[ES|QL] remove meta (#189302)
## Summary close https://github.com/elastic/kibana/issues/188481 `META` is still in the grammar so you won't get a syntax error, but no highlighting, validation, or autocomplete support. <img width="268" alt="Screenshot 2024-07-26 at 9 46 09 AM" src="https://github.com/user-attachments/assets/563ba2fe-c35d-437e-bc6c-e717cd8b0de8"> --------- Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
This commit is contained in:
parent
80cd581ee8
commit
49fb36c69c
5 changed files with 1 additions and 109 deletions
|
@ -145,13 +145,6 @@ describe('autocomplete', () => {
|
|||
}
|
||||
});
|
||||
|
||||
describe('meta', () => {
|
||||
testSuggestions('meta ', ['FUNCTIONS']);
|
||||
for (const fn of ['functions']) {
|
||||
testSuggestions(`meta ${fn} `, ['|']);
|
||||
}
|
||||
});
|
||||
|
||||
describe('where', () => {
|
||||
const allEvalFns = getFunctionSignaturesByReturnType('where', 'any', {
|
||||
scalar: true,
|
||||
|
|
|
@ -62,19 +62,6 @@ export const commandDefinitions: CommandDefinition[] = [
|
|||
params: [{ name: 'index', type: 'source', wildcards: true }],
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'meta',
|
||||
description: i18n.translate('kbn-esql-validation-autocomplete.esql.definitions.metaDoc', {
|
||||
defaultMessage: 'Returns information about the ES|QL environment',
|
||||
}),
|
||||
examples: ['meta functions'],
|
||||
options: [],
|
||||
modes: [],
|
||||
signature: {
|
||||
multipleParams: false,
|
||||
params: [{ name: 'functions', type: 'function' }],
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'show',
|
||||
description: i18n.translate('kbn-esql-validation-autocomplete.esql.definitions.showDoc', {
|
||||
|
|
|
@ -2092,46 +2092,6 @@
|
|||
],
|
||||
"warning": []
|
||||
},
|
||||
{
|
||||
"query": "meta",
|
||||
"error": [
|
||||
"SyntaxError: missing 'functions' at '<EOF>'"
|
||||
],
|
||||
"warning": []
|
||||
},
|
||||
{
|
||||
"query": "meta functions",
|
||||
"error": [],
|
||||
"warning": []
|
||||
},
|
||||
{
|
||||
"query": "meta functions()",
|
||||
"error": [
|
||||
"SyntaxError: token recognition error at: '('",
|
||||
"SyntaxError: token recognition error at: ')'"
|
||||
],
|
||||
"warning": []
|
||||
},
|
||||
{
|
||||
"query": "meta functions blah",
|
||||
"error": [
|
||||
"SyntaxError: token recognition error at: 'b'",
|
||||
"SyntaxError: token recognition error at: 'l'",
|
||||
"SyntaxError: token recognition error at: 'a'",
|
||||
"SyntaxError: token recognition error at: 'h'"
|
||||
],
|
||||
"warning": []
|
||||
},
|
||||
{
|
||||
"query": "meta info",
|
||||
"error": [
|
||||
"SyntaxError: token recognition error at: 'i'",
|
||||
"SyntaxError: token recognition error at: 'n'",
|
||||
"SyntaxError: token recognition error at: 'fo'",
|
||||
"SyntaxError: missing 'functions' at '<EOF>'"
|
||||
],
|
||||
"warning": []
|
||||
},
|
||||
{
|
||||
"query": "show",
|
||||
"error": [
|
||||
|
|
|
@ -446,40 +446,8 @@ describe('validation logic', () => {
|
|||
});
|
||||
});
|
||||
|
||||
describe('meta', () => {
|
||||
testErrorsAndWarnings('meta', ["SyntaxError: missing 'functions' at '<EOF>'"]);
|
||||
testErrorsAndWarnings('meta functions', []);
|
||||
testErrorsAndWarnings('meta functions()', [
|
||||
"SyntaxError: token recognition error at: '('",
|
||||
"SyntaxError: token recognition error at: ')'",
|
||||
]);
|
||||
testErrorsAndWarnings('meta functions blah', [
|
||||
"SyntaxError: token recognition error at: 'b'",
|
||||
"SyntaxError: token recognition error at: 'l'",
|
||||
"SyntaxError: token recognition error at: 'a'",
|
||||
"SyntaxError: token recognition error at: 'h'",
|
||||
]);
|
||||
testErrorsAndWarnings('meta info', [
|
||||
"SyntaxError: token recognition error at: 'i'",
|
||||
"SyntaxError: token recognition error at: 'n'",
|
||||
"SyntaxError: token recognition error at: 'fo'",
|
||||
"SyntaxError: missing 'functions' at '<EOF>'",
|
||||
]);
|
||||
});
|
||||
|
||||
describe('show', () => {
|
||||
testErrorsAndWarnings('show', ["SyntaxError: missing 'info' at '<EOF>'"]);
|
||||
testErrorsAndWarnings('show functions', [
|
||||
"SyntaxError: token recognition error at: 'f'",
|
||||
"SyntaxError: token recognition error at: 'u'",
|
||||
"SyntaxError: token recognition error at: 'n'",
|
||||
"SyntaxError: token recognition error at: 'c'",
|
||||
"SyntaxError: token recognition error at: 't'",
|
||||
"SyntaxError: token recognition error at: 'io'",
|
||||
"SyntaxError: token recognition error at: 'n'",
|
||||
"SyntaxError: token recognition error at: 's'",
|
||||
"SyntaxError: missing 'info' at '<EOF>'",
|
||||
]);
|
||||
testErrorsAndWarnings('show info', []);
|
||||
testErrorsAndWarnings('show numberField', [
|
||||
"SyntaxError: token recognition error at: 'n'",
|
||||
|
@ -1551,22 +1519,6 @@ describe('validation logic', () => {
|
|||
});
|
||||
});
|
||||
|
||||
it('should call fields callbacks also for meta command', async () => {
|
||||
const callbackMocks = getCallbackMocks();
|
||||
await validateQuery(
|
||||
`meta functions | keep name`,
|
||||
getAstAndSyntaxErrors,
|
||||
undefined,
|
||||
callbackMocks
|
||||
);
|
||||
expect(callbackMocks.getSources).not.toHaveBeenCalled();
|
||||
expect(callbackMocks.getPolicies).not.toHaveBeenCalled();
|
||||
expect(callbackMocks.getFieldsFor).toHaveBeenCalledTimes(1);
|
||||
expect(callbackMocks.getFieldsFor).toHaveBeenLastCalledWith({
|
||||
query: 'meta functions',
|
||||
});
|
||||
});
|
||||
|
||||
it('should call fields callbacks also for show command', async () => {
|
||||
const callbackMocks = getCallbackMocks();
|
||||
await validateQuery(
|
||||
|
|
|
@ -48,7 +48,7 @@ export const buildESQlTheme = (): monaco.editor.IStandaloneThemeData => ({
|
|||
|
||||
// source commands
|
||||
...buildRuleGroup(
|
||||
['from', 'row', 'show', 'meta'],
|
||||
['from', 'row', 'show'],
|
||||
euiThemeVars.euiColorPrimaryText,
|
||||
true // isBold
|
||||
),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue