-
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] Trigger suggestions on deletion #184673
[Console Monaco migration] Trigger suggestions on deletion #184673
Conversation
/ci |
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.
Amazing work @yuliacech! Tested locally and the autocompletion functionality works much better now. It worked as expected for all of the listed use cases in the PR.
I only have two small comments for the code changes.
endColumn: position.column, | ||
}); | ||
// if the line is empty or it matches specified regex, trigger suggestions | ||
console.log({lineContentBefore}) |
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.
nit: we might not need this.
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 catch! 👍
@@ -71,6 +91,13 @@ export class MonacoEditorActionsProvider { | |||
editor.onDidContentSizeChange(async (event) => { | |||
await debouncedHighlightRequests(); | |||
}); | |||
|
|||
editor.onKeyUp((event) => { |
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.
It seems that onKeyUp
is making some jest tests fail. Could we use editor.addAction
or editor.addCommand
instead?
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.
I think there was just a function missing in the mock, so that should fix the tests, otherwise I'll have a look at these 2 alternatives
💚 Build Succeeded
Metrics [docs]Async chunks
History
To update your PR or re-run it, just comment with: |
Summary
Closes #183422
This PR adds logic to manually trigger autocomplete suggestions when the user deletes some of the text in the editor. The suggestions are only triggered if the line content before the cursor position matches specific regular expressions. The use cases include:
/
,?
or=
-> suggest autocomplete for a url path or url paramsScreen recording
Screen.Recording.2024-06-04.at.17.18.49.mov
Checklist
Delete any items that are not applicable to this PR.
Risk Matrix
Delete this section if it is not applicable to this PR.
Before closing this PR, invite QA, stakeholders, and other developers to identify risks that should be tested prior to the change/feature release.
When forming the risk matrix, consider some of the following examples and how they may potentially impact the change:
For maintainers