Add a signal to proxy all Completer.selected signals#16312
Merged
Conversation
Completer currently emits a signal when a completion is selected. This surfaces that signal to the CompletionProviderManager, which then proxies all the Completer signals to the new signal. This will allow extensions to know when a selection is made in a Completer. Currently there are edge cases where a selection can be made without calling a command that can be connected to. Signed-off-by: Alex Bozarth <ajbozart@us.ibm.com>
|
Thanks for making a pull request to jupyterlab! |
Member
Author
|
@krassowski here's my implementation I pitched in #16294 based on your idea:
I'm still open to other solutions, but figured I would implement and submit this PR since it was pretty easy to do so. I've also tested that it does solve my problem |
krassowski
reviewed
May 10, 2024
krassowski
reviewed
May 12, 2024
Completer.selected signals
ImpSy
pushed a commit
to spotinst/jupyterlab
that referenced
this pull request
Jan 7, 2025
* Add Signal to proxy all Completer selected Signals Completer currently emits a signal when a completion is selected. This surfaces that signal to the CompletionProviderManager, which then proxies all the Completer signals to the new signal. This will allow extensions to know when a selection is made in a Completer. Currently there are edge cases where a selection can be made without calling a command that can be connected to. Signed-off-by: Alex Bozarth <ajbozart@us.ibm.com> * Emit ICompleterSelection instead of string * change text to insertText * add new test for selected --------- Signed-off-by: Alex Bozarth <ajbozart@us.ibm.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
References
Fixes #16294
Code changes
Completercurrently emits a signal (_selected) when a completion is selected. This PR creates a new signal inCompletionProviderManager, which proxies theCompletersignal from everyCompletionHandlerthat is generated.This will allow extensions to know when a selection is made by any Completer. Currently there are edge cases (as listed in #16294) where a selection can be made without calling a command that can be connected to.