Avoid disposal of QuickInputExt on hide #13485
Merged
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.
What it does
Remove implicit
dispose()
inQuickInputExt.hide()
. This prevented quick input/quick pick instances from being shown again after they were hidden. This aligns the behavior with VS Code.Note that there is still another issue related to this:
The following code sequence will open an empty quickpick overlay:
This issue is also present in VS Code and is caused by the underlying monaco implementation.
If we also want to fix this we would probably have to directly change this in monaco.
There exists a workaround: Setting the items again before showing results in a correct quick pick overlay.
Fixes #13072
Contributed on behalf of STMicroelectronics
How to test
You can use the following plugin (vsix+sourcecode) to test this:
theia13072.zip
This plugin contributed 3 commands
Test quickpick (hide,show)
: Creates a quick pick, hides it, then shows it againTest quickpick (show,hide,show)
: Creates a quick pick,shows it, hides it, then shows it again. This is the error case described above that results in an empty quickpick overlayTest quickpick (show,hide,show)
: Same as the show-hide-show command but it also incorporate the workaround (setting items again before showing). This should result in a correct quickpick overlay.Here is also a quick demo how the commands behave on master and the PR branch:
Master:
quickpick-master.mp4
PR:
quickpick-fix.mp4
Follow-ups
Review checklist
Reminder for reviewers