mirror of
https://github.com/elastic/kibana.git
synced 2025-04-22 08:49:27 -04:00
## Summary Closes https://github.com/elastic/kibana/issues/172649 This PR extracts the ES|QL service like "validation", "autocomplete", "code_action" (quick fixes) and some other services into a separate package `@kbn/esql-validation-autocomplete` which has no tie with Monaco editor anymore. All the AST and grammar logic has been encapsulated into a single `@kbn/esql-ast` package who contains the `getAst` function together with the `parser` and `lexer`. ## Validation enhancements The validation API has been enhanced to gracefully degrade whenever callbacks are not provided, via the `ignoreOnMissingCallback` option. Tests are included as well for this scenario. ### Example plugin An example plugin app has been developed to show to to use the validation API <img width="500" alt="Screenshot 2024-03-22 at 17 45 38" src="ebc172d3
-ee61-4f3a-9e42-dcb9b15c7e69"> The app starts with a missing callback: <img width="855" alt="Screenshot 2024-03-22 at 17 36 22" src="c9b81370
-8a10-487d-b22f-2359e1365a54"> Toggling the ignore option will hide the index error due to the lack of `getSources` callback: <img width="816" alt="Screenshot 2024-03-22 at 17 28 17" src="931f4e5f
-3ad6-46f7-97ca-63d7bb66646b"> Warnings are shown as well when detected: <img width="807" alt="Screenshot 2024-03-22 at 17 35 56" src="5e3e0537
-cba2-475f-946b-0302867384ca"> #### Code snippet The example app produces a copyable code snippet of the current configuration of the validator:  ### Checklist - [x] [Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html) was added for features that require explanation or tutorials - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
45 lines
1.1 KiB
Text
45 lines
1.1 KiB
Text
**/*.js.snap
|
|
__tmp__
|
|
/.es
|
|
/.chromium
|
|
/build
|
|
/built_assets
|
|
/config/apm.dev.js
|
|
/data
|
|
/html_docs
|
|
/optimize
|
|
/plugins
|
|
/test/fixtures/scenarios
|
|
/x-pack/build
|
|
node_modules
|
|
target
|
|
snapshots.js
|
|
|
|
!/.eslintrc.js
|
|
!.storybook
|
|
!.buildkite
|
|
|
|
# plugin overrides
|
|
/src/core/lib/kbn_internal_native_observable
|
|
/src/plugins/data/common/es_query/kuery/ast/_generated_/**
|
|
/x-pack/plugins/canvas/canvas_plugin
|
|
/x-pack/plugins/canvas/shareable_runtime/build
|
|
/x-pack/plugins/canvas/storybook/build
|
|
/x-pack/plugins/reporting/server/export_types/printable_pdf/server/lib/pdf/assets/**
|
|
/x-pack/plugins/reporting/server/export_types/printable_pdf_v2/server/lib/pdf/assets/**
|
|
/x-pack/plugins/cloud_integrations/cloud_full_story/server/assets/**
|
|
|
|
# package overrides
|
|
/packages/kbn-eslint-config
|
|
/packages/kbn-plugin-generator/template
|
|
/packages/kbn-generate/templates
|
|
/packages/kbn-pm/dist
|
|
/packages/kbn-test/src/functional_test_runner/__tests__/fixtures/
|
|
/packages/kbn-test/src/functional_test_runner/lib/config/__tests__/fixtures/
|
|
/packages/kbn-ui-framework/dist
|
|
/packages/kbn-flot-charts/lib
|
|
/packages/kbn-monaco/src/**/antlr
|
|
/packages/kbn-esql-ast/src/**/antlr
|
|
|
|
# Bazel
|
|
/bazel-*
|