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

Guarantee that QuickPickService.showQuickPick resolves on hide #11068

Conversation

colin-grant-work
Copy link
Contributor

@colin-grant-work colin-grant-work commented Apr 22, 2022

What it does

Fixes #11067 by ensuring that the promise returned by QuickPickService.showQuickPick will be resolved by modifying MonacoQuickInputService to resolve undefined after the quick pick is hidden. If the promise has already been resolved, the second resolution will have no effect, and if it hasn't, it will be resolved with undefined.

How to test

  1. There is an included test commit (with a lint error as a reminder to remove it). Run the command Test QuickPickService.show.
  2. If you make a selection, you should see a log reflecting that selection.
  3. If you close the quick pick without making a selection (e.g. hitting Esc or unfocusing the quick pick by clicking elsewhere), you should see a log reflecting a selection of undefined.

Review checklist

Reminder for reviewers

@colin-grant-work colin-grant-work added bug bugs found in the application quick-open issues related to the quick-open labels Apr 22, 2022
Copy link
Member

@vince-fugnitto vince-fugnitto left a comment

Choose a reason for hiding this comment

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

I confirmed the changes work as expected, and resolve the issue 👍

@colin-grant-work colin-grant-work force-pushed the bugfix/quick-pick-guaranteed-resolution branch from eef91ce to 0c5213f Compare April 27, 2022 14:41
@colin-grant-work colin-grant-work force-pushed the bugfix/quick-pick-guaranteed-resolution branch from 0c5213f to 276c7aa Compare April 27, 2022 14:43
@colin-grant-work
Copy link
Contributor Author

Since this PR does not change dependencies, I deem that it is not the cause of the 3pp failure.

@colin-grant-work colin-grant-work merged commit c6ac473 into eclipse-theia:master Apr 27, 2022
@colin-grant-work colin-grant-work deleted the bugfix/quick-pick-guaranteed-resolution branch April 27, 2022 16:19
@vince-fugnitto vince-fugnitto added this to the 1.25.0 milestone Apr 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug bugs found in the application quick-open issues related to the quick-open
Projects
None yet
Development

Successfully merging this pull request may close these issues.

QuickPickService.show doesn't resolve if user focus out or press ESC
2 participants