Bug 506467 - Asynchronous & non-blocking hyperlink detection
Summary: Asynchronous & non-blocking hyperlink detection
Status: ASSIGNED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 4.6   Edit
Hardware: PC All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Platform-Text-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 569402 (view as bug list)
Depends on:
Blocks: 561372
  Show dependency tree
 
Reported: 2016-10-24 16:25 EDT by Michal Niewrzal CLA
Modified: 2021-01-25 04:46 EST (History)
6 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michal Niewrzal CLA 2016-10-24 16:25:28 EDT
At the moment hyperlinks are calculated in UI thread. Such calculation can be heavy operation and it can easily freeze UI. I believe it will make IDE more responsive and user friendly. It will also make IDE more resistant to 3rd party plugins with poor performance.

Similar issue is opened for CA (bug 251156) but I couldn't find version for hyperlinks.
Comment 1 Angelo ZERR CLA 2017-05-05 03:40:24 EDT
It should really fantastic if we could have an async hyperlink detector which could work with CompletableFuture by providing an interface like this:

----------------------------------
public interface IAsyncHyperlinkDetector {
	CompletableFuture<IHyperlink[]> detectHyperlinks(ITextViewer textViewer, IRegion region, boolean canShowMultipleHyperlinks);

}
----------------------------------
Comment 2 Andrey Loskutov CLA 2020-12-03 08:05:56 EST
*** Bug 569402 has been marked as a duplicate of this bug. ***
Comment 3 Eclipse Genie CLA 2020-12-03 10:16:01 EST
New Gerrit change created: https://git.eclipse.org/r/c/platform/eclipse.platform.text/+/173318
Comment 4 Eclipse Genie CLA 2020-12-03 10:19:15 EST
New Gerrit change created: https://git.eclipse.org/r/c/lsp4e/lsp4e/+/173319
Comment 5 Johan Compagner CLA 2020-12-03 10:20:28 EST
i made a patch for platform.text and a small patch for this that works with it
With this first cut (as an idea) it already works its fully async
Comment 6 Johan Compagner CLA 2020-12-03 10:22:29 EST
and a small patch for: https://bugs.eclipse.org/bugs/show_bug.cgi?id=561372
Comment 7 Johan Compagner CLA 2020-12-06 10:21:15 EST
i updated the patch so it doesn't break api
and now the extension point will way if it is async or not so we can upfront create the right delegates

i didn't change it yet to Flow.Publisher/Subscriber.
will have a look at that later 

The detection strategies are implemented, except that "first" only works currently with the default "sync" operation not with the async api.

Maybe if we are Publish/Subscibe that can be also implemented easier. (i guess with the current futures this should be also possible, the first future that returns is leading?)

I guess that first is really an optimization to get as quickly a result in the event thread.. it doesn't matter to much now i guess.
Except if one really takes long... now everything waits for it.
Comment 8 Johan Compagner CLA 2021-01-25 04:46:58 EST
i made a new patch (and something did go wrong with the changeid, because i needed to revert some stuff first)

https://git.eclipse.org/r/c/platform/eclipse.platform.text/+/175291