Bug 569402 - Support resolving hyperlinks without freezing UI Thread.
Summary: Support resolving hyperlinks without freezing UI Thread.
Status: CLOSED DUPLICATE of bug 506467
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 4.18   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Platform-Text-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 569372
  Show dependency tree
 
Reported: 2020-12-02 10:30 EST by Johan Compagner CLA
Modified: 2020-12-03 08:05 EST (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Johan Compagner CLA 2020-12-02 10:30:14 EST
see also the discussion here:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=569372

WWD (or the lsp4j/lsp4e) uses language services to resolve stuff for them, like validation, code completion but also finding declarations (finding links)

That means that there is an IO operation to another process (nodejs) but the HyperLinkManager uses IHyperlinkDetector, that lsp4e implements, that should return:
IHyperlink[] detectHyperlinks(ITextViewer textViewer, IRegion region, boolean canShowMultipleHyperlinks);

problem is that this forces everything to be done in the ui thread, it would be nice if this interface would be reactive.

like that we can have IReactiveHyperlinkDetector:

CompletableFuture<IHyperlink[]> detectHyperlinks(ITextViewer textViewer, IRegion region, boolean canShowMultipleHyperlinks);

which a impl of IHyperlinkDetector can also extend and if that is the case HyperLinkManager  is working more async.

Problem is that for 1 file there can be more like 3 also a few legacy impls and HyperLinkManager wants in the end 1 list that it then wants to show.
So those impls maybe can be called also directly in the ui, but the actual show waits then for the fututure to complete first.
Or we have a default WrappingReactiveHyperlinkDetector  that just wraps the legacy once into one and also calls that outside of the ui thread
But his could be a bit tricky because of the param ITextViewer  where they get ui stuff from like the styledtext, and they are maybe not allowed to access UI stuff from outside of the ui thread.
Comment 1 Johan Compagner CLA 2020-12-03 07:39:56 EST
i see that this is a duplicate of:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=506467

a case from 4 years ago.. with the same "solution" described in the comments.
Comment 2 Andrey Loskutov CLA 2020-12-03 08:05:56 EST
(In reply to Johan Compagner from comment #1)
> i see that this is a duplicate of:
> 
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=506467
> 
> a case from 4 years ago.. with the same "solution" described in the comments.

Thanks, marking as dup of bug 506467.

*** This bug has been marked as a duplicate of bug 506467 ***