Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 496300 - [hovering][ltk] Support contribution of multiple Hovers to Code Editor
Summary: [hovering][ltk] Support contribution of multiple Hovers to Code Editor
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 4.6   Edit
Hardware: All All
: P2 enhancement (vote)
Target Milestone: 4.7 M3   Edit
Assignee: Mickael Istria CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 496114 503332
  Show dependency tree
 
Reported: 2016-06-17 09:17 EDT by Mickael Istria CLA
Modified: 2016-10-11 11:01 EDT (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 Mickael Istria CLA 2016-06-17 09:17:52 EDT
Similarily to hyperlinks, it would be nice to add the possiblity to add a Hover support to any text-based editor by declaring and composing extensions rather than having to subclass the editor.
It seems to be mostly a matter of implementing an extension based getTextHover method in TextSourceViewerConfiguration , mimicking getHyperlinkDetectors could ne a nice way of doing it.
Some other editor such as the SSE editors have implemented exactly this kind of thing. Maybe we could simply considering a copy-paste-adapt?
Comment 1 Angelo ZERR CLA 2016-06-17 09:24:09 EDT
Mickael, it should be very cool to have this feature.

But If you support this feature, please give the capability to sort the hover to retrieve the best match hover. 

I had a problem with Eclipse WTP WebResources to support hover for CSS class. See my explanation at https://github.com/angelozerr/eclipse-wtp-webresources#why-orgeclipseawstwebresourcesui and bug that I had created at https://bugs.eclipse.org/bugs/show_bug.cgi?id=444189
Comment 2 Mickael Istria CLA 2016-06-20 04:07:32 EDT
(In reply to Angelo ZERR from comment #1)
> But If you support this feature, please give the capability to sort the
> hover to retrieve the best match hover. 

IMO, it would be better to show all hover proposals at once, just like the 1st completion page shows proposals from all providers.
Comment 3 Dani Megert CLA 2016-06-20 08:30:25 EDT
Makes sense. It's already there for the Java editor (org.eclipse.jdt.ui.javaEditorTextHovers).
Comment 4 Eclipse Genie CLA 2016-06-24 08:43:45 EDT
New Gerrit change created: https://git.eclipse.org/r/75921
Comment 6 Mickael Istria CLA 2016-10-04 06:55:46 EDT
Currently, a given Generic Editor instance only accept a single hover provider. However, it's very likely that we need a way to include several providers and use the ones that make the most sense according to the location where hover is requested. Some priority tags are already declared in the extension point.

Example of possible hovers on a given file:
* Problems
* Debug
* Documentation
* Content-assist

The actual hover should either dispatch to one of the possible providers, or even consider creating an aggregation of those providers.
Comment 7 Eclipse Genie CLA 2016-10-10 13:50:56 EDT
New Gerrit change created: https://git.eclipse.org/r/82861
Comment 9 Mickael Istria CLA 2016-10-11 11:01:24 EDT
Generic Editor now support multiple hovers. They can be sorted one relatively to another using the isBefore and isAfter extensions attributes.