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

Bug 493276

Summary: [es6] Comments attached to incorrect node in 'export' statement
Product: [ECD] Orion Reporter: Michael Rennie <Michael_Rennie>
Component: JS ToolsAssignee: Olivier Thomann <Olivier_Thomann>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: curtis.windatt.public, Olivier_Thomann
Version: 12.0   
Target Milestone: 12.0   
Hardware: PC   
OS: Mac OS X   
Whiteboard:
Bug Depends on:    
Bug Blocks: 493463    
Attachments:
Description Flags
Proposed patch including regression tests
none
Proposed patch including updated regression tests none

Description Michael Rennie CLA 2016-05-09 17:24:13 EDT
Consider the following snippet:

/**
  * @description Returns a String value
  */
 export function myFunc(){ return MYCONSTANT};

You get no hover over the the function name.

If you change the snippet slightly to:

export
/**
  * @description Returns a String value
  */
function myFunc(){ return MYCONSTANT};

the hover works fine.
Comment 1 Olivier Thomann CLA 2016-05-10 09:46:53 EDT
I can take a look.
Comment 2 Curtis Windatt CLA 2016-05-10 11:01:19 EDT
Also check that the add JSDoc comment command inserts the comment at the right place.
Comment 3 Olivier Thomann CLA 2016-05-10 11:14:39 EDT
(In reply to Curtis Windatt from comment #2)
> Also check that the add JSDoc comment command inserts the comment at the
> right place.
Where do you want to insert the comment? In front of the export statement?
Comment 4 Curtis Windatt CLA 2016-05-10 11:24:32 EDT
(In reply to Olivier Thomann from comment #3)
> (In reply to Curtis Windatt from comment #2)
> > Also check that the add JSDoc comment command inserts the comment at the
> > right place.
> Where do you want to insert the comment? In front of the export statement?

Yes, as long as the comment is attached to the right node so hovers work.  The end result should match the first example from comment 0.
/**
  * @description Returns a String value
  */
 export function myFunc(){ return MYCONSTANT};
Comment 5 Olivier Thomann CLA 2016-05-10 20:34:43 EDT
Created attachment 261619 [details]
Proposed patch including regression tests

This patch handles:
- hover
- missing-doc rule
- quickfix
for the export named declaration.
Comment 6 Olivier Thomann CLA 2016-05-13 19:10:19 EDT
Created attachment 261741 [details]
Proposed patch including updated regression tests
Comment 7 Olivier Thomann CLA 2016-05-13 20:03:56 EDT
Delivered.
Comment 8 Curtis Windatt CLA 2016-05-16 09:57:37 EDT
The commit was:
http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=fc98f1f32bd890b2c6429e99fe19cc6305507ca1

Thanks Olivier, this is working well for me.