Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ES|QL] remove meta #189302

Merged
merged 3 commits into from
Jul 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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', {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'",
Expand Down Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion packages/kbn-monaco/src/esql/lib/esql_theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export const buildESQlTheme = (): monaco.editor.IStandaloneThemeData => ({

// source commands
...buildRuleGroup(
['from', 'row', 'show', 'meta'],
['from', 'row', 'show'],
euiThemeVars.euiColorPrimaryText,
true // isBold
),
Expand Down