Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 452697

Summary: Implement the ability to show hover info during content assist
Product: [ECD] Orion Reporter: Eric Moffatt <emoffatt>
Component: ClientAssignee: Project Inbox <orion.client-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: curtis.windatt.public, Michael_Rennie
Version: unspecified   
Target Milestone: 8.0   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Bug Depends on:    
Bug Blocks: 450152, 453086    
Attachments:
Description Flags
Hover for JS proposals none

Description Eric Moffatt CLA 2014-11-21 13:48:27 EST
We'd like to be able to show extra info for the selected proposal in content assist such as the JSDoc for a method... (a la eclipse).
Comment 1 Eric Moffatt CLA 2014-11-21 15:12:39 EST
I've committed the initial stub code for this. It's in contentAssist.js but commented out...

The code that actually fetches and formats the SJDoc needs to be added by Michael; note that we may need to augment the tooltip to allow 'markdown' as a known 'contents' type (i.e. directly returned from the target's 'getHoverInfo' method as opposed to through extension plugins).

There's also an initialization defect where we don't show the hover on the initial proposal but only when you arrow through them.
Comment 3 Michael Rennie CLA 2014-12-01 14:44:34 EST
Created attachment 249076 [details]
Hover for JS proposals

In the screen shot you can see the hover is not quite polished yet:

1. it opens way off from the selected item
2. there is no support for formatting the returned results
3. its too big, I would expect it to bound itself so it looks / feels more like a child of the assist popup
4. might be nice if it also had the same colouring / style as the assist popup

To get this example working I uncommented the code in master and returned a 'hover' property from the JS proposal computer. It might be a good idea to be able to return a hover object like we do for the hover service. That way clients could format their hover using markdown et. al. like we can for the normal hover.
Comment 4 Michael Rennie CLA 2014-12-08 13:46:31 EST
I pushed support in the JS tooling to forward doc + url from an index:

http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=431eae3b7cd432b10d1863a16466b896bc15b82b

A JS proposal will now and a hover object to a proposal that looks like:

{
  hover: <markdown text>,
  type: 'markdown'
}
Comment 5 Curtis Windatt CLA 2014-12-10 17:35:42 EST
http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=aa9059222067fab6f4df6abfa12ab6ce7667bbd8

1) Set the sizing of the hover to about the size of the content assist, allow vertical scrolling.
2) Tooltip opens with content assist and stays open until content assist closes.
3) Tooltip can be anchored on the left side if no room on the right.

Since we have no real useful information to show in the popup, I have left the activation code in the editor ContentAssist.js commented out.
Comment 6 Curtis Windatt CLA 2014-12-11 12:58:45 EST
http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=3c07436fa644154fdb6033c3b2c49801ebde6620

1) Enabled tooltips in master
2) Tooltip content now calculated using the hover service (now supports markdown, etc.). The proposal is passed to in the context.
3) Additional tweaks to look and feel.

I'll update the developer guide.

Marking as FIXED.