mirror of
https://github.com/elastic/kibana.git
synced 2025-04-21 16:29:04 -04:00
Part of: #144296 ## Summary First step of `[ESQL] Improve the typing experience` (#144296). This PR is the skeleton for later parts, but already supports basic parsing scenarios. ## What was done: - [x] Added new `ESQL` language in `@kbn/monaco` package. Parsing was done using the `antl` syntax; - [x] `kbnUiSharedDeps`-srcJs bundle has been optimised, all workers have been moved into separate chunks. This gave almost minus` 2 MB` 🕺 - [x] existing `esql` lang was renamed to `sql`. In order not to confuse anyone in the future - [x] some code from `painless` folder was moved to `common` and reused in ESQL (probably needs some refactoring in future) ## Next steps: - [ ] improving `ANLT` syntax to cover all cases - [ ] implementing `Autocomplete` feature ## How to use new `ESQL Lang`: To use new language 2 properties should be set for `CodeEditor` component ```ts import { ESQL_LANG_ID, ESQL_THEME_ID } from '@kbn/monaco'; import { CodeEditor } from '@kbn/kibana-react-plugin/public'; <CodeEditor ... languageId={ESQL_LANG_ID} options={{ ... theme: ESQL_THEME_ID, }} /> ``` Currently syntax highlighting looks like: <img width="450" alt="image" src="https://user-images.githubusercontent.com/20072247/205685072-0658fad1-d034-4d36-a44d-6a49e7365ab3.png"> <img width="450" alt="image" src="https://user-images.githubusercontent.com/20072247/205685220-c67db50c-6f3b-49b5-9576-d1ee68428184.png"> Will be updated in Step 2 Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Marco Liberati <dej611@users.noreply.github.com> |
||
---|---|---|
.. | ||
utils | ||
constants.js | ||
fix_generated_antlr.js | ||
generate_autocomplete.js |