Bug 550835 - once selected quick access elements from lsp4e disappear from list
Summary: once selected quick access elements from lsp4e disappear from list
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: LSP4E (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Martin Lippert CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 550881
Blocks:
  Show dependency tree
 
Reported: 2019-09-06 05:41 EDT by Martin Lippert CLA
Modified: 2022-02-04 09:12 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Lippert CLA 2019-09-06 05:41:38 EDT
If you select a quick access element provided by lsp4e, it disappears from the quick access list and never comes back.

The reason for that is that the selected element gets moved into the "previous picks" list. But the handling for "previous picks" uses the old "public QuickAccessElement[] computeElements()" method of the quick access provider in its internals.

The lsp4e quick access provider doesn't implement that method, it implements the newer version of it (public QuickAccessElement[] computeElements(String query, IProgressMonitor monitor)).

We can fix this in the lsp4e quick access provider by letting the old method return the same results than the new method, but the question remains if the platform implementation of the previous picks should also use the new method instead of the old one (or both).
Comment 1 Mickael Istria CLA 2019-09-06 05:51:00 EDT
I think it's more a bug in Platform: in case the previousPick element cannot be re-created by the provider as usual, it should be discarded from the list of previous pick.
As a result, previous picks wouldn't necessary work for incremental Quick Access provider, but that might be acceptable as a 1st step forward.
Comment 2 Mickael Istria CLA 2019-09-06 05:54:37 EDT
(In reply to Martin Lippert from comment #0)
> We can fix this in the lsp4e quick access provider by letting the old method
> return the same results than the new method, but the question remains if the
> platform implementation of the previous picks should also use the new method
> instead of the old one (or both).

The new method returns different results according to its param, so we cannot just return all the possble results in the old "static" method.
IIRC, the QUick Access support stores the request that allowed to get a previous pick. So we could -in case the QuickAccessPRovider uses the incremental extension- invoke the new method with the request that was used by the previous pick, instead of invoking the "all static results" method.
Comment 3 Martin Lippert CLA 2019-09-06 06:11:11 EDT
I fixed this in my experimental quick access provider by generating new and unique IDs for the quick access elements each time the provider is called - not a nice workaround, but it seems to work for the moment.

And your fix on the platform side sounds quite reasonable to me, too.
Comment 4 Mickael Istria CLA 2019-09-06 07:17:41 EDT
I you wish to contribute a workaround for LSP4E in the meantime, that'd be welcome. Note that I'd like to tag/promote next release on Monday.
Comment 5 Eclipse Genie CLA 2019-09-08 07:04:56 EDT
New Gerrit change created: https://git.eclipse.org/r/149118
Comment 6 Martin Lippert CLA 2019-09-08 07:06:31 EDT
I implemented a workaround for the workspace symbols quick access elements. They still do not show up in the previous picks list, but that problem needs to be solved in the platform. Might be too late for the upcoming release (also not terribly important), but feel free to take a look and pull it in, if you feel comfortable with it.
Comment 7 Mickael Istria CLA 2019-09-09 03:02:39 EDT
Let's discuss the patch on Gerrit.
Related platform bugs:
* Not store as previous pick things that we can't rebuild: bug 550880
* Make the proposals from incremental providers re-buildable: bug 550881
Comment 8 Mickael Istria CLA 2019-09-09 03:14:23 EDT
Thanks Martin!
Comment 10 Martin Lippert CLA 2019-09-09 03:15:46 EDT
Thank you Michael, for the fast turnaround, feedback, and great collaboration - as usual. Much appreciated!