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

Bug 458567

Summary: [quickfix] The quickfix to add an unknown var to globals or eslint-env can disrupt element doc
Product: [ECD] Orion Reporter: Michael Rennie <Michael_Rennie>
Component: JS ToolsAssignee: Michael Rennie <Michael_Rennie>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 8.0   
Target Milestone: 8.0   
Hardware: All   
OS: All   
Whiteboard:

Description Michael Rennie CLA 2015-01-27 13:22:45 EST
Consider the following snippet:

/**
 * @name Foo.bar
 * @description description
 * @function
 * @returns returns
 */
Foo['bar'] = function() {};

Steps:
1. activate the quick fix to add 'Foo' to globals
2. notice it stuffs it in front of the existing JSDoc for the function - basically breaking that doc block as 'belonging' to the function.

We should add some sanity checks to make sure this doesn't happen, but at the same time we want to avoid putting the globals / eslint-env directives before any common file header like the @license, etc.
Comment 2 Michael Rennie CLA 2015-02-12 15:58:45 EST
Additional tweak for expression statements + more tests:

http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=3307adcedabc15f03db2591abf6eea790f153420