[Console] Add ESQL autocomplete support in single quotes#224601
[Console] Add ESQL autocomplete support in single quotes#224601ElenaStoeva merged 5 commits intoelastic:mainfrom
Conversation
|
Pinging @elastic/kibana-management (Team:Kibana Management) |
| /* | ||
| * This function returns an array of completion items for the esql suggestions | ||
| */ | ||
| export const getEsqlCompletionItems = ( |
There was a problem hiding this comment.
This was unnecessarily added in #219980 but it's not used anywhere so safe to remove.
|
Thanks for reviewing @stratoula! I think one of my last commits caused this this issue - I just fixed it in cea4aac! |
SoniaSanzV
left a comment
There was a problem hiding this comment.
tested locally, lgtm :)
💛 Build succeeded, but was flaky
Failed CI StepsTest Failures
Metrics [docs]Module Count
Async chunks
Page load bundle
History
cc @ElenaStoeva |
stratoula
left a comment
There was a problem hiding this comment.
Seems good now, I did a very brief testing but we can fix bugs as a follow up. Thanx Elena, I love it more than the triple quotes 👼
|
Starting backport for target branches: 8.19 https://github.com/elastic/kibana/actions/runs/15781785111 |
💔 All backports failed
Manual backportTo create the backport manually run: Questions ?Please refer to the Backport tool documentation |
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
) Closes elastic#223954 Closes elastic#223921 ## Summary This PR adds support for ESQL autocompletion inside single quotes, which allows suggestions that include triple quotes such as `KQL(``````)`. <img width="1165" alt="Screenshot 2025-06-19 at 13 39 51" src="https://github.com/user-attachments/assets/8ff59bf7-534e-4539-8cf8-2a1145dbf842" /> **Changes include:** - The lexer rules have been updated to recognize single-quote query as ESQL so that the highlighting is correct - We escape and unescape characters that are invalid in a Console string when we suggest inside single quotes so that we don't cause errors in Console **How to test:** Make sure that ESQL suggestions are displayed inside both `"query": "...` and `"query": """...` and that suggestions that contain quotes are correctly escaped inside single-quote queries. --------- Co-authored-by: Stratoula Kalafateli <efstratia.kalafateli@elastic.co> (cherry picked from commit 88ef1ac) # Conflicts: # src/platform/packages/shared/kbn-monaco/src/console/index.ts # src/platform/plugins/shared/console/public/application/containers/editor/monaco_editor_actions_provider.ts
) (#224733) # Backport This will backport the following commits from `main` to `8.19`: - [[Console] Add ESQL autocomplete support in single quotes (#224601)](#224601) <!--- 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-20T14:58:54Z","message":"[Console] Add ESQL autocomplete support in single quotes (#224601)\n\nCloses https://github.com/elastic/kibana/issues/223954\nCloses https://github.com/elastic/kibana/issues/223921\n\n## Summary\n\nThis PR adds support for ESQL autocompletion inside single quotes, which\nallows suggestions that include triple quotes such as `KQL(``````)`.\n \n<img width=\"1165\" alt=\"Screenshot 2025-06-19 at 13 39 51\"\nsrc=\"https://github.com/user-attachments/assets/8ff59bf7-534e-4539-8cf8-2a1145dbf842\"\n/>\n\n**Changes include:**\n- The lexer rules have been updated to recognize single-quote query as\nESQL so that the highlighting is correct\n- We escape and unescape characters that are invalid in a Console string\nwhen we suggest inside single quotes so that we don't cause errors in\nConsole\n\n**How to test:**\nMake sure that ESQL suggestions are displayed inside both `\"query\":\n\"...` and `\"query\": \"\"\"...` and that suggestions that contain quotes are\ncorrectly escaped inside single-quote queries.\n\n---------\n\nCo-authored-by: Stratoula Kalafateli <efstratia.kalafateli@elastic.co>","sha":"88ef1ac8b2a5a77803c3102d3124c23e3d3bc6e9","branchLabelMapping":{"^v9.1.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Feature:Console","Team:Kibana Management","release_note:skip","backport:version","v9.1.0","v8.19.0"],"title":"[Console] Add ESQL autocomplete support in single quotes","number":224601,"url":"https://github.com/elastic/kibana/pull/224601","mergeCommit":{"message":"[Console] Add ESQL autocomplete support in single quotes (#224601)\n\nCloses https://github.com/elastic/kibana/issues/223954\nCloses https://github.com/elastic/kibana/issues/223921\n\n## Summary\n\nThis PR adds support for ESQL autocompletion inside single quotes, which\nallows suggestions that include triple quotes such as `KQL(``````)`.\n \n<img width=\"1165\" alt=\"Screenshot 2025-06-19 at 13 39 51\"\nsrc=\"https://github.com/user-attachments/assets/8ff59bf7-534e-4539-8cf8-2a1145dbf842\"\n/>\n\n**Changes include:**\n- The lexer rules have been updated to recognize single-quote query as\nESQL so that the highlighting is correct\n- We escape and unescape characters that are invalid in a Console string\nwhen we suggest inside single quotes so that we don't cause errors in\nConsole\n\n**How to test:**\nMake sure that ESQL suggestions are displayed inside both `\"query\":\n\"...` and `\"query\": \"\"\"...` and that suggestions that contain quotes are\ncorrectly escaped inside single-quote queries.\n\n---------\n\nCo-authored-by: Stratoula Kalafateli <efstratia.kalafateli@elastic.co>","sha":"88ef1ac8b2a5a77803c3102d3124c23e3d3bc6e9"}},"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/224601","number":224601,"mergeCommit":{"message":"[Console] Add ESQL autocomplete support in single quotes (#224601)\n\nCloses https://github.com/elastic/kibana/issues/223954\nCloses https://github.com/elastic/kibana/issues/223921\n\n## Summary\n\nThis PR adds support for ESQL autocompletion inside single quotes, which\nallows suggestions that include triple quotes such as `KQL(``````)`.\n \n<img width=\"1165\" alt=\"Screenshot 2025-06-19 at 13 39 51\"\nsrc=\"https://github.com/user-attachments/assets/8ff59bf7-534e-4539-8cf8-2a1145dbf842\"\n/>\n\n**Changes include:**\n- The lexer rules have been updated to recognize single-quote query as\nESQL so that the highlighting is correct\n- We escape and unescape characters that are invalid in a Console string\nwhen we suggest inside single quotes so that we don't cause errors in\nConsole\n\n**How to test:**\nMake sure that ESQL suggestions are displayed inside both `\"query\":\n\"...` and `\"query\": \"\"\"...` and that suggestions that contain quotes are\ncorrectly escaped inside single-quote queries.\n\n---------\n\nCo-authored-by: Stratoula Kalafateli <efstratia.kalafateli@elastic.co>","sha":"88ef1ac8b2a5a77803c3102d3124c23e3d3bc6e9"}},{"branch":"8.19","label":"v8.19.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Sonia Sanz Vivas <sonia.sanzvivas@elastic.co>
) Closes elastic#223954 Closes elastic#223921 ## Summary This PR adds support for ESQL autocompletion inside single quotes, which allows suggestions that include triple quotes such as `KQL(``````)`. <img width="1165" alt="Screenshot 2025-06-19 at 13 39 51" src="https://github.com/user-attachments/assets/8ff59bf7-534e-4539-8cf8-2a1145dbf842" /> **Changes include:** - The lexer rules have been updated to recognize single-quote query as ESQL so that the highlighting is correct - We escape and unescape characters that are invalid in a Console string when we suggest inside single quotes so that we don't cause errors in Console **How to test:** Make sure that ESQL suggestions are displayed inside both `"query": "...` and `"query": """...` and that suggestions that contain quotes are correctly escaped inside single-quote queries. --------- Co-authored-by: Stratoula Kalafateli <efstratia.kalafateli@elastic.co>


Closes #223954
Closes #223921
Summary
This PR adds support for ESQL autocompletion inside single quotes, which allows suggestions that include triple quotes such as
KQL(``````).Changes include:
How to test:
Make sure that ESQL suggestions are displayed inside both
"query": "...and"query": """...and that suggestions that contain quotes are correctly escaped inside single-quote queries.