Skip to content

[Console] Add ESQL autocomplete support#219980

Merged
ElenaStoeva merged 34 commits intoelastic:mainfrom
ElenaStoeva:console/add-esql-autocomplete-support
Jun 18, 2025
Merged

[Console] Add ESQL autocomplete support#219980
ElenaStoeva merged 34 commits intoelastic:mainfrom
ElenaStoeva:console/add-esql-autocomplete-support

Conversation

@ElenaStoeva
Copy link
Copy Markdown
Contributor

@ElenaStoeva ElenaStoeva commented May 2, 2025

Closes #208450

Summary

This PR adds ESQL autocomplete support to Console. The ESQL suggestions are only displayed inside triple-quotes queries ("query": """...).

How to test:

  1. Open Kibana and load some data (e.g. the sample data sets).
  2. Navigate to Dev Tools -> Console and type in the following query:
POST _query
{
    "query": """ """
}
  1. Verify that ESQL suggestions are displayed inside the triple quotes and work as in the ESQL editor in Discover. Example ESQL query:
    FROM kibana_sample_data_ecommerce | WHERE order_date >= ?_tstart AND order_date <= ?_tend | LIMIT 10

  2. Verify that no ESQL suggestions are displayed outside triple-quotes queries

  3. Verify that no Console suggestions are displayed inside triple-quotes queries

  4. Verify that the functionality also works in embeddable Console.

Screen.Recording.2025-06-13.at.17.49.18.mov

Release notes

These changes add autocompletion for ESQL query requests in Console.

@ElenaStoeva ElenaStoeva self-assigned this May 2, 2025
@ElenaStoeva
Copy link
Copy Markdown
Contributor Author

/ci

@ElenaStoeva ElenaStoeva marked this pull request as ready for review May 7, 2025 13:07
@ElenaStoeva ElenaStoeva requested review from a team as code owners May 7, 2025 13:07
@ElenaStoeva ElenaStoeva added Feature:Console Dev Tools Console Feature Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more t// release_note:skip Skip the PR/issue when compiling release notes v9.1.0 v8.19.0 labels May 7, 2025
@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/kibana-management (Team:Kibana Management)

@ElenaStoeva ElenaStoeva added the backport:skip This PR does not require backporting label May 7, 2025
@ElenaStoeva ElenaStoeva marked this pull request as draft May 7, 2025 13:30
@ElenaStoeva ElenaStoeva requested a review from stratoula May 7, 2025 13:32
@ElenaStoeva ElenaStoeva marked this pull request as ready for review May 8, 2025 13:39
Copy link
Copy Markdown
Contributor

@drewdaemon drewdaemon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a fabulous!

I suggest we look at using Monaco's existing language boundaries feature instead of trying to do it ourselves. More info in the other comments.

@ElenaStoeva ElenaStoeva added the release_note:feature Makes this part of the condensed release notes label Jun 13, 2025
@ElenaStoeva ElenaStoeva requested a review from sabarasaba June 16, 2025 14:20
@elasticmachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
console 213 246 +33

Public APIs missing comments

Total count of every public API that lacks a comment. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats comments for more detailed information.

id before after diff
@kbn/monaco 187 191 +4
console 30 33 +3
total +7

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
console 186.2KB 192.9KB +6.7KB

Public APIs missing exports

Total count of every type that is part of your API that should be exported but is not. This will cause broken links in the API documentation system. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats exports for more detailed information.

id before after diff
console 0 1 +1

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
console 27.5KB 27.8KB +287.0B
kbnUiSharedDeps-srcJs 3.7MB 3.7MB +681.0B
total +968.0B
Unknown metric groups

API count

id before after diff
@kbn/monaco 187 191 +4
console 39 42 +3
total +7

History

cc @ElenaStoeva

Copy link
Copy Markdown
Member

@sabarasaba sabarasaba left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work @ElenaStoeva! tested locally and kibana management changes lgtm 🚀

Copy link
Copy Markdown
Contributor

@Dosant Dosant left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sharedux code changes lgtm

@ElenaStoeva ElenaStoeva added backport:version Backport to applied version labels and removed backport:skip This PR does not require backporting labels Jun 18, 2025
@ElenaStoeva ElenaStoeva merged commit fe80f76 into elastic:main Jun 18, 2025
13 checks passed
@kibanamachine
Copy link
Copy Markdown
Contributor

Starting backport for target branches: 8.19

https://github.com/elastic/kibana/actions/runs/15729073535

@kibanamachine
Copy link
Copy Markdown
Contributor

💔 All backports failed

Status Branch Result
8.19 Backport failed because of merge conflicts

You might need to backport the following PRs to 8.19:
- [Console] Fix autoselecting last request (#218001)

Manual backport

To create the backport manually run:

node scripts/backport --pr 219980

Questions ?

Please refer to the Backport tool documentation

@ElenaStoeva ElenaStoeva added backport:version Backport to applied version labels and removed backport:version Backport to applied version labels labels Jun 18, 2025
@kibanamachine
Copy link
Copy Markdown
Contributor

Starting backport for target branches: 8.19

https://github.com/elastic/kibana/actions/runs/15734765949

@kibanamachine
Copy link
Copy Markdown
Contributor

💔 All backports failed

Status Branch Result
8.19 Backport failed because of merge conflicts

You might need to backport the following PRs to 8.19:
- [Console] Fix autoselecting last request (#218001)

Manual backport

To create the backport manually run:

node scripts/backport --pr 219980

Questions ?

Please refer to the Backport tool documentation

ElenaStoeva added a commit to ElenaStoeva/kibana that referenced this pull request Jun 18, 2025
Closes elastic#208450

## Summary

This PR adds ESQL autocomplete support to Console. The ESQL suggestions
are only displayed inside triple-quotes queries (`"query": """...`).

**How to test:**
1. Open Kibana and load some data (e.g. the sample data sets).
2. Navigate to Dev Tools -> Console and type in the following query:
```
POST _query
{
    "query": """ """
}
```
3. Verify that ESQL suggestions are displayed inside the triple quotes
and work as in the ESQL editor in Discover. Example ESQL query:
`FROM kibana_sample_data_ecommerce | WHERE order_date >= ?_tstart AND
order_date <= ?_tend | LIMIT 10`

4. Verify that no ESQL suggestions are displayed outside triple-quotes
queries
5. Verify that no Console suggestions are displayed inside triple-quotes
queries
6. Verify that the functionality also works in embeddable Console.

https://github.com/user-attachments/assets/63f1b82d-50a2-4af4-b5ad-812eab9a55a5

## Release notes
These changes add autocompletion for ESQL query requests in Console.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Stratoula Kalafateli <efstratia.kalafateli@elastic.co>
Co-authored-by: Jean-Louis Leysens <jloleysens@gmail.com>
(cherry picked from commit fe80f76)

# Conflicts:
#	src/platform/packages/shared/kbn-monaco/src/languages/console/language.ts
#	src/platform/packages/shared/kbn-monaco/src/languages/index.ts
#	src/platform/packages/shared/kbn-monaco/src/xjson/index.ts
#	src/platform/plugins/shared/console/public/application/containers/editor/monaco_editor_actions_provider.ts
#	src/platform/plugins/shared/console/public/application/containers/editor/utils/index.ts
@ElenaStoeva
Copy link
Copy Markdown
Contributor Author

💚 All backports created successfully

Status Branch Result
8.19

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

@kibanamachine kibanamachine added the backport missing Added to PRs automatically when the are determined to be missing a backport. label Jun 19, 2025
@kibanamachine
Copy link
Copy Markdown
Contributor

Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync.
cc: @ElenaStoeva

ElenaStoeva added a commit that referenced this pull request Jun 20, 2025
# Backport

This will backport the following commits from `main` to `8.19`:
- [[Console] Add ESQL autocomplete support
(#219980)](#219980)

<!--- Backport version: 10.0.1 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Elena
Stoeva","email":"59341489+ElenaStoeva@users.noreply.github.com"},"sourceCommit":{"committedDate":"2025-06-18T09:25:20Z","message":"[Console]
Add ESQL autocomplete support (#219980)\n\nCloses
https://github.com/elastic/kibana/issues/208450\n\n## Summary\n\nThis PR
adds ESQL autocomplete support to Console. The ESQL suggestions\nare
only displayed inside triple-quotes queries (`\"query\":
\"\"\"...`).\n\n**How to test:**\n1. Open Kibana and load some data
(e.g. the sample data sets).\n2. Navigate to Dev Tools -> Console and
type in the following query:\n```\nPOST _query\n{\n \"query\": \"\"\"
\"\"\"\n}\n```\n3. Verify that ESQL suggestions are displayed inside the
triple quotes\nand work as in the ESQL editor in Discover. Example ESQL
query:\n`FROM kibana_sample_data_ecommerce | WHERE order_date >=
?_tstart AND\norder_date <= ?_tend | LIMIT 10`\n\n4. Verify that no ESQL
suggestions are displayed outside triple-quotes\nqueries\n5. Verify that
no Console suggestions are displayed inside triple-quotes\nqueries\n6.
Verify that the functionality also works in embeddable
Console.\n\n\n\nhttps://github.com/user-attachments/assets/63f1b82d-50a2-4af4-b5ad-812eab9a55a5\n\n\n\n##
Release notes\nThese changes add autocompletion for ESQL query requests
in Console.\n\n---------\n\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>\nCo-authored-by:
Stratoula Kalafateli <efstratia.kalafateli@elastic.co>\nCo-authored-by:
Jean-Louis Leysens
<jloleysens@gmail.com>","sha":"fe80f762f071681f981a62a1c47def45644be3d8","branchLabelMapping":{"^v9.1.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Feature:Console","Team:Kibana
Management","release_note:feature","backport:version","v9.1.0","v8.19.0"],"title":"[Console]
Add ESQL autocomplete
support","number":219980,"url":"https://github.com/elastic/kibana/pull/219980","mergeCommit":{"message":"[Console]
Add ESQL autocomplete support (#219980)\n\nCloses
https://github.com/elastic/kibana/issues/208450\n\n## Summary\n\nThis PR
adds ESQL autocomplete support to Console. The ESQL suggestions\nare
only displayed inside triple-quotes queries (`\"query\":
\"\"\"...`).\n\n**How to test:**\n1. Open Kibana and load some data
(e.g. the sample data sets).\n2. Navigate to Dev Tools -> Console and
type in the following query:\n```\nPOST _query\n{\n \"query\": \"\"\"
\"\"\"\n}\n```\n3. Verify that ESQL suggestions are displayed inside the
triple quotes\nand work as in the ESQL editor in Discover. Example ESQL
query:\n`FROM kibana_sample_data_ecommerce | WHERE order_date >=
?_tstart AND\norder_date <= ?_tend | LIMIT 10`\n\n4. Verify that no ESQL
suggestions are displayed outside triple-quotes\nqueries\n5. Verify that
no Console suggestions are displayed inside triple-quotes\nqueries\n6.
Verify that the functionality also works in embeddable
Console.\n\n\n\nhttps://github.com/user-attachments/assets/63f1b82d-50a2-4af4-b5ad-812eab9a55a5\n\n\n\n##
Release notes\nThese changes add autocompletion for ESQL query requests
in Console.\n\n---------\n\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>\nCo-authored-by:
Stratoula Kalafateli <efstratia.kalafateli@elastic.co>\nCo-authored-by:
Jean-Louis Leysens
<jloleysens@gmail.com>","sha":"fe80f762f071681f981a62a1c47def45644be3d8"}},"sourceBranch":"main","suggestedTargetBranches":["8.19"],"targetPullRequestStates":[{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/219980","number":219980,"mergeCommit":{"message":"[Console]
Add ESQL autocomplete support (#219980)\n\nCloses
https://github.com/elastic/kibana/issues/208450\n\n## Summary\n\nThis PR
adds ESQL autocomplete support to Console. The ESQL suggestions\nare
only displayed inside triple-quotes queries (`\"query\":
\"\"\"...`).\n\n**How to test:**\n1. Open Kibana and load some data
(e.g. the sample data sets).\n2. Navigate to Dev Tools -> Console and
type in the following query:\n```\nPOST _query\n{\n \"query\": \"\"\"
\"\"\"\n}\n```\n3. Verify that ESQL suggestions are displayed inside the
triple quotes\nand work as in the ESQL editor in Discover. Example ESQL
query:\n`FROM kibana_sample_data_ecommerce | WHERE order_date >=
?_tstart AND\norder_date <= ?_tend | LIMIT 10`\n\n4. Verify that no ESQL
suggestions are displayed outside triple-quotes\nqueries\n5. Verify that
no Console suggestions are displayed inside triple-quotes\nqueries\n6.
Verify that the functionality also works in embeddable
Console.\n\n\n\nhttps://github.com/user-attachments/assets/63f1b82d-50a2-4af4-b5ad-812eab9a55a5\n\n\n\n##
Release notes\nThese changes add autocompletion for ESQL query requests
in Console.\n\n---------\n\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>\nCo-authored-by:
Stratoula Kalafateli <efstratia.kalafateli@elastic.co>\nCo-authored-by:
Jean-Louis Leysens
<jloleysens@gmail.com>","sha":"fe80f762f071681f981a62a1c47def45644be3d8"}},{"branch":"8.19","label":"v8.19.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
@kibanamachine kibanamachine removed the backport missing Added to PRs automatically when the are determined to be missing a backport. label Jun 20, 2025
@ElenaStoeva ElenaStoeva deleted the console/add-esql-autocomplete-support branch January 31, 2026 19:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:version Backport to applied version labels Feature:Console Dev Tools Console Feature release_note:feature Makes this part of the condensed release notes Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more t// v8.19.0 v9.1.0

8 participants