Skip to content
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

Add a signal to proxy all Completer.selected signals #16312

Merged
merged 4 commits into from May 16, 2024

Conversation

ajbozarth
Copy link
Contributor

References

Fixes #16294

Code changes

Completer currently emits a signal (_selected) when a completion is selected. This PR creates a new signal in CompletionProviderManager, which proxies the Completer signal from every CompletionHandler that 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.

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 <[email protected]>
@ajbozarth ajbozarth requested a review from krassowski May 9, 2024 20:10
@ajbozarth ajbozarth self-assigned this May 9, 2024
Copy link

Thanks for making a pull request to jupyterlab!
To try out this branch on binder, follow this link: Binder

@ajbozarth
Copy link
Contributor Author

@krassowski here's my implementation I pitched in #16294 based on your idea:

a high level signal which would proxy Selected from all widgets.

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 krassowski added this to the 4.3.0 milestone May 11, 2024
packages/completer/src/tokens.ts Outdated Show resolved Hide resolved
packages/completer/src/manager.ts Show resolved Hide resolved
Copy link
Member

@krassowski krassowski left a comment

Choose a reason for hiding this comment

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

Thank you @ajbozarth!

@krassowski krassowski merged commit e34aad0 into jupyterlab:main May 16, 2024
81 checks passed
@krassowski krassowski changed the title Add Signal to proxy all Completer selected Signals Add a signal to proxy all Completer.selected signals May 16, 2024
@ajbozarth ajbozarth deleted the signal branch May 16, 2024 13:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

No consistent way to execute a callback function upon acceptance of a Completer item
2 participants