Bug 373456 - Create orion.edit.hover service
Summary: Create orion.edit.hover service
Status: CLOSED DUPLICATE of bug 445215
Alias: None
Product: Orion (Archived)
Classification: ECD
Component: Editor (show other bugs)
Version: 0.4   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: 7.0   Edit
Assignee: Eric Moffatt CLA
QA Contact:
URL:
Whiteboard:
Keywords: helpwanted
: 420085 420465 (view as bug list)
Depends on:
Blocks: 444148
  Show dependency tree
 
Reported: 2012-03-06 19:53 EST by Andrew Eisenberg CLA
Modified: 2014-10-16 17:30 EDT (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 Andrew Eisenberg CLA 2012-03-06 19:53:55 EST
If we want to start supporting source hovers in the editor, there needs to be some kind of service that clients can extend.

I propose orion.edit.hover.

This service will provide the following:

* hover index (index in the document that is currently being hovered over
* current hover location (x, y coordinates) (maybe necessary, maybe not)

The return value should be null if there is no hover and an HTML snippet if there is.

This service should be attached to a content type.  There also needs to be a way of handling situations where there are multiple hovers applicable at a given location.  Perhaps handling could be arbitrary, or perhaps there could be a priority that is specified when registering the hover.

It would also be nice if hovers were easy to make sticky somehow, so that if there is a link inside of the hover, then it could be easily clickable.
Comment 1 Chris McGee CLA 2013-06-05 10:47:10 EDT
This would be a great addition to Orion. It would open doors to providing javadoc-style documentation hovers.
Comment 2 John Arthorne CLA 2014-08-28 12:56:25 EDT
*** Bug 420085 has been marked as a duplicate of this bug. ***
Comment 3 John Arthorne CLA 2014-08-28 12:56:37 EDT
*** Bug 420465 has been marked as a duplicate of this bug. ***
Comment 4 John Arthorne CLA 2014-09-04 14:02:37 EDT
The main goal here should be to define the core service so that it can be used by the various language-specific plugins (JS, Java, Go, etc).

A secondary goal is to create a JS implementation of this service. It looks like currently we do not have documentation in our type indexes. @mrennie I'm hoping you can point out the direction here - i.e., should type indexes start to incorporate documentation for functions and we display that comment only for types that have this available. This documentation information would also be valuable as additional information showing during content assist invocation but that is outside the scope of this bug.

@maciej CCing you because we may also be able to make use of this in CF manifest editor (hover help for definition of manifest keys for example).
Comment 5 Michael Rennie CLA 2014-09-05 10:30:40 EDT
(In reply to John Arthorne from comment #4)

> A secondary goal is to create a JS implementation of this service. It looks
> like currently we do not have documentation in our type indexes. @mrennie
> I'm hoping you can point out the direction here - i.e., should type indexes
> start to incorporate documentation for functions and we display that comment
> only for types that have this available. 

The indexes we use can easily incorporate doc - and originally do until we go through them and remove some unneeded entries.

> This documentation information
> would also be valuable as additional information showing during content
> assist invocation but that is outside the scope of this bug.

Tern already uses the doc information when creating the type indexes, which we in turn use in our environment. We also already use the doc in our inferencing.
Comment 6 Michael Rennie CLA 2014-09-24 12:38:24 EDT
(In reply to Michael Rennie from comment #5)
I pushed an example implementation of JavaScript hover to:

http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=3f9d48cf50c651bb90f4a1dfa7381042b31cf262

once the framework-side changes are in for the service we can hook it up.
Comment 7 Eric Moffatt CLA 2014-09-29 10:18:28 EDT

*** This bug has been marked as a duplicate of bug 445215 ***
Comment 8 Alex Boyko CLA 2014-10-16 16:40:23 EDT
Eric, any chance you could add support for HTML data (rather than MD or JSON) for the deferredInfo rendering logic in tooltip.js? (This is needed in the Flux project. JDT service can produce the HTML format Javadoc content and all that's needed at that point is embedding it into the tooltip's div)
Comment 9 Alex Boyko CLA 2014-10-16 17:30:46 EDT
Never mind. Looks like passing { title : htmlStr } would work for me.