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

Bug 488790

Summary: The quick fix for "no-unused-params" failed to remove corresponding JSDoc comments.
Product: [ECD] Orion Reporter: Troy Tao <troytao>
Component: JS ToolsAssignee: Michael Rennie <Michael_Rennie>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: curtis.windatt.public, Michael_Rennie
Version: 11.0   
Target Milestone: 12.0   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Troy Tao CLA 2016-03-01 15:18:34 EST
To reproduce this bug, start with:

var temp = {
		/**
		 * @private
		 * @param {String} text The code to parse.
		 * @param {String} file The file name that we parsed
		 * @returns {Object} The AST.
		 */
		parse: function(text, file) {
			return null;
		}
};

Then click the quick fix for either "text" or "file":

var temp = {
		/**
		 * @private
		 * @param {String} text The code to parse.
		 * @param {String} file The file name that we parsed
		 * @returns {Object} The AST.
		 */
		parse: function(file) {
			return null;
		}
};

The "@param {String} text The code to parse." should also be deleted.
Comment 1 Eclipse Genie CLA 2016-03-01 15:24:18 EST
New Gerrit change created: https://git.eclipse.org/r/67627
Comment 2 Curtis Windatt CLA 2016-03-01 15:44:13 EST
The gerrit change modifies every single line of the file.  Line endings maybe?  this also needs a regression test in quickfixTests.js.
Comment 3 Eclipse Genie CLA 2016-03-01 17:20:27 EST
New Gerrit change created: https://git.eclipse.org/r/67631
Comment 4 Curtis Windatt CLA 2016-03-02 12:14:41 EST
If the doc comments are attached to a different node than what we are expecting, then we might need to fix for function declaractions and other node types.  Will also need tests in case the comments are ever moved again (possible regression from updating Esprima).
Comment 5 Michael Rennie CLA 2016-03-15 16:37:16 EDT
We ended up going with a simpler fix + tests:

http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=9789b89181b3ccc9ec14a14018917b180ef78d37

The fix also adds support for 'fix all' to the quickfix.