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

Bug 490397

Summary: Useless hover in grunt js file
Product: [ECD] Orion Reporter: Steve Northover <steve_northover>
Component: JS ToolsAssignee: Troy Tao <troytao>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: curtis.windatt.public, Michael_Rennie
Version: 12.0   
Target Milestone: 12.0   
Hardware: PC   
OS: Windows 7   
See Also: https://git.eclipse.org/r/69377
https://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=b0edfe43a857c6f4fc90f7766e6438860902e03a
Whiteboard:
Attachments:
Description Flags
the over none

Description Steve Northover CLA 2016-03-24 16:55:40 EDT
Created attachment 260563 [details]
the over

On beta3:

1) Root/org.eclipse.orion.client/modules/orionode/Gruntfile.js
2) Hover over text in line 23 (see image)
3) A useless hover telling me about a String constructor comes up and hides my code

I think this is just a bug and the wrong hover help is being found.  I wonder how useful hover help is for a String constructor?  I'm guessing that the tooling can't know.  I suppose we could arbitrarily filter ...
Comment 1 Eclipse Genie CLA 2016-03-28 14:35:16 EDT
New Gerrit change created: https://git.eclipse.org/r/69377
Comment 2 Curtis Windatt CLA 2016-03-29 10:49:18 EDT
We have documentation for primitive types.  Tern thinks that it is a String and gives the doc for Strings.  I agree that it isn't helpful to show in hovers.
Comment 3 Steve Northover CLA 2016-03-29 10:52:25 EDT
I wasn't hovering over a string so I was confused.  Whether to show help for a String or Number is another issue that we can sort out elsewhere (or shelve).
Comment 4 Michael Rennie CLA 2016-04-18 16:54:14 EDT
On the one hand, I sometimes find it useful to hover and see what Tern thinks the type is. On the other hand, the primitive hovers talk about constructors, which is not at all helpful.

Troy, can you update the fix to suppress all primitive hovers?

1. string
2. number
3. bool
Comment 5 Steve Northover CLA 2016-04-18 20:55:15 EDT
NOTE:

> I wasn't hovering over a string so I was confused.
Comment 6 Michael Rennie CLA 2016-04-19 10:13:36 EDT
(In reply to Steve Northover from comment #5)
> NOTE:
> 
> > I wasn't hovering over a string so I was confused.

I saw that. The inferred type of the thing you hovered over was a string, that's how we know to show the hover for a string :)
Comment 7 Troy Tao CLA 2016-04-19 16:39:45 EDT
(In reply to Michael Rennie from comment #4)
> On the one hand, I sometimes find it useful to hover and see what Tern
> thinks the type is. On the other hand, the primitive hovers talk about
> constructors, which is not at all helpful.
> 
> Troy, can you update the fix to suppress all primitive hovers?
> 
> 1. string
> 2. number
> 3. bool

Done :)
Comment 8 Michael Rennie CLA 2016-04-21 14:42:16 EDT
(In reply to Troy Tao from comment #7)
> (In reply to Michael Rennie from comment #4)
> > On the one hand, I sometimes find it useful to hover and see what Tern
> > thinks the type is. On the other hand, the primitive hovers talk about
> > constructors, which is not at all helpful.
> > 
> > Troy, can you update the fix to suppress all primitive hovers?
> > 
> > 1. string
> > 2. number
> > 3. bool
> 
> Done :)

I think there is more we need to do here, just ignoring the types has the negative side-effect that it shuts off doc hovers for those types completely.

Consider the snippet:

/**
 * @description This is a super important number that we no longer need
 * @since 123.45
 * @public
 * @deprecated
 */
var num = 10;

we no longer see the doc in the hover.

As much as I am not a fan of modifying Tern code unless we have to, I think it might be easiest to take the doc off if the 'thing' is not actually the primitive constructor.
Comment 9 Curtis Windatt CLA 2016-04-25 10:01:19 EDT
(In reply to Michael Rennie from comment #8)
> As much as I am not a fan of modifying Tern code unless we have to, I think
> it might be easiest to take the doc off if the 'thing' is not actually the
> primitive constructor.

Just keep me in the loop as for Tern 18 I'm trying to reduce the number of changes we have to make for Orion.
Comment 10 Troy Tao CLA 2016-04-26 11:05:32 EDT
(In reply to Michael Rennie from comment #8)
> (In reply to Troy Tao from comment #7)
> > (In reply to Michael Rennie from comment #4)
> > > On the one hand, I sometimes find it useful to hover and see what Tern
> > > thinks the type is. On the other hand, the primitive hovers talk about
> > > constructors, which is not at all helpful.
> > > 
> > > Troy, can you update the fix to suppress all primitive hovers?
> > > 
> > > 1. string
> > > 2. number
> > > 3. bool
> > 
> > Done :)
> 
> I think there is more we need to do here, just ignoring the types has the
> negative side-effect that it shuts off doc hovers for those types completely.
> 
> Consider the snippet:
> 
> /**
>  * @description This is a super important number that we no longer need
>  * @since 123.45
>  * @public
>  * @deprecated
>  */
> var num = 10;
> 
> we no longer see the doc in the hover.
> 
> As much as I am not a fan of modifying Tern code unless we have to, I think
> it might be easiest to take the doc off if the 'thing' is not actually the
> primitive constructor.

A new patch has been updated and it excludes docs of Boolean, String, Number and RegRex constructors when generate type docs to display at hover time.
Comment 11 Troy Tao CLA 2016-04-26 11:08:44 EDT
(In reply to Curtis Windatt from comment #9)
> (In reply to Michael Rennie from comment #8)
> > As much as I am not a fan of modifying Tern code unless we have to, I think
> > it might be easiest to take the doc off if the 'thing' is not actually the
> > primitive constructor.
> 
> Just keep me in the loop as for Tern 18 I'm trying to reduce the number of
> changes we have to make for Orion.

I have put a "/*Orion*/" in tern.js to denote our change and hope it will suffice.