Bug 571827 - marker resolutions "Computing..." not being updated automatically
Summary: marker resolutions "Computing..." not being updated automatically
Status: NEW
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:
Blocks:
 
Reported: 2021-03-09 16:05 EST by Martin Lippert CLA
Modified: 2022-05-19 19:34 EDT (History)
2 users (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 2021-03-09 16:05:53 EST
Due to a bug report that we got for the Spring tooling (https://github.com/spring-projects/sts4/issues/593) I analyzed the marker resolution mechanism a bit to see what is going on here. To me it seems like the mechanism that is used in

LSPCodeActionMarkerResolution.checkMarkerResoultion

at the end first sets the COMPUTING attribute to the marker, then triggers the computation of the code actions for the marker via the language server - and returns after this computation completed (or times out).

Then, the marker attribute is changed from the COMPUTING to the actions in an async action. That results is that on first invocation, the marker resolutions are most likely "COMPUTING..." (because the async "set actions to marker" hasn't beed executed yet) and that "COMPUTING..." doesn't get changed on the UI. You have to invoke the quick fix action again. Then it shows up the right actions, since they got added to the marker in the meantime.

I thought about fixing this my including the "set actions to marker" future in the timeout instead of the codeAction future, but I am worried about this not being executed if a timeout occurs on one of the codeAction futures.

Any thoughts on this?

Or should we instead update the quick fix popup as soon as actions are set to a marker - in case that is possible?
Comment 1 Mickael Istria CLA 2021-03-10 01:28:17 EST
This piece of code can definitely be improved and be made more reactive.
Setting the "COMPUTING" resolution might be useless: we could instead just store the future that computes the IMarkerResolutions and return either future.get(100) -10 milliseconds seems like an acceptable delay for that as the main UI workflows to get the quickfixes already involve hovering and typing a few keystroke to get out of pure edition flow-, or in case of TimeoutException return the "COMPUTING" and in case of other exception return an error information.
Comment 2 Martin Lippert CLA 2021-03-11 11:12:29 EST
Thanks for the details, I will take a deeper look and come up with a patch.
Comment 3 Mickael Istria CLA 2021-03-25 05:50:04 EDT
This piece of code can definitely be improved and be made more reactive.
Setting the "COMPUTING" resolution might be useless: we could instead just store the future that computes the IMarkerResolutions and return either future.get(100) -10 milliseconds seems like an acceptable delay for that as the main UI workflows to get the quickfixes already involve hovering and typing a few keystroke to get out of pure edition flow-, or in case of TimeoutException return the "COMPUTING" and in case of other exception return an error information.
Comment 4 Mickael Istria CLA 2021-11-16 15:57:16 EST
Eclipse LSP4E is moving away from this bugs.eclipse.org issue tracker to https://github.com/eclipse/lsp4e/issues/ instead. If this issue is relevant to you, your action is required.
0. Verify this issue is still happening with latest LSP4E snapshots (from https://download.eclipse.org/lsp4e/snapshots )
  if issue has disappeared, please change status of this issue to "CLOSED WORKFORME" with some details about your testing environment and how you did verify the issue; and you're done
  if issue is still present with snapshots:
* Create a new issue at https://github.com/eclipse/lsp4e/issues/
  ** Use as title in GitHub the title of this Bugzilla ticket (may include the bug number or not, at your own convenience)
  ** In the GitHub description, start with a link to this bugzilla ticket
  ** Optionally add new content to the description if it can helps towards resolution
  ** Submit GitHub issue
* Update bugzilla ticket
  ** Add to "See also" property (up right column) the link to the newly created GitHub issue
  ** Add a comment "Migrated to <link-to-newly-created-GitHub-issue>"
  ** Set status as CLOSED MOVED
  ** Submit

All issues that remain open will be automatically closed soon. Then the Bugzilla component for LSP4E will be archived and made read-only.
Comment 5 Alex Boyko CLA 2022-05-19 19:34:45 EDT
Migrated to https://github.com/eclipse/lsp4e/issues/123