-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[Console Monaco migration] Implement request body autocomplete #182562
[Console Monaco migration] Implement request body autocomplete #182562
Conversation
/ci |
2 similar comments
/ci |
/ci |
* For example '{ "test": [' -> ['{', 'test', '[']. This array is used for autocomplete. | ||
* Returns array of strings representing body tokens for autocomplete. | ||
*/ | ||
export const parseBody = (value: string): string[] => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function uses the logic similar to the code in parser, we could consider re-using some of the code in both.
Pinging @elastic/kibana-management (Team:Kibana Management) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great job @yuliacech! Tested locally and the request body params are correctly suggested.
I noticed one small issue though. When I click somewhere outside the autocomplete suggestions pop-up window and then continue typing, I no longer get autocomplete suggestions. This doesn't happen in the Ace Console.
Monaco
Screen.Recording.2024-05-09.at.18.27.08.mov
Ace
Screen.Recording.2024-05-09.at.18.28.19.mov
Would there be an easy fix for this or should we leave it for a follow-up PR?
a911984
to
1ff1acb
Compare
Thanks a lot for the review, @ElenaStoeva! |
💚 Build Succeeded
Metrics [docs]Module Count
Async chunks
History
To update your PR or re-run it, just comment with: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed, the monaco editor has a different behaviour with when autocomplete suggestions are displayed. I'll open an issue to track that. Currently I know that the monaco editor triggers suggestions on specific characters. We will need to find a way to trigger suggestions more often to keep the behaviour similar to ace.
I see, thanks for letting me know! In this case, I'm approving to unblock the PR.
Summary
Closes #180208
This PR adds support for autocomplete suggestions in the request body. The focus of this work is to correctly suggest the names of properties and insert corresponding template snippets.
Screen recording
Screen.Recording.2024-05-08.at.11.15.00.mov
Follow up issues that need to be addressed later
GET _search
, propertyexplain
)