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

Bug 457067

Summary: Quick Fix for unused parameter may not fix the warning
Product: [ECD] Orion Reporter: Grant Gayed <grant_gayed>
Component: JS ToolsAssignee: Michael Rennie <Michael_Rennie>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: Michael_Rennie
Version: unspecified   
Target Milestone: 8.0   
Hardware: PC   
OS: Mac OS X   
Whiteboard:

Description Grant Gayed CLA 2015-01-08 12:51:14 EST
- start with:

var c = {
	fn: function(a, b) {
		this.window.console.log(b);
	}.bind(this),
};

- shows a warning on line 2 (Parameter 'a' is never used)
- select the "Add @callback to function" quick fix, which then gives:

var c = {
	fn: /* @callback */ function(a, b) {
		this.window.console.log(b);
	}.bind(this),
};

- save it, note that the line 2 warning is not fixed by the Quick Fix change
Comment 1 Michael Rennie CLA 2015-01-08 13:55:31 EST
This is coming from a quirk in the way Esprima attaches comments. In this case, where the function expression appears as part of a call expression, it attaches the comment to the call expression rather than the function expression (like 'normally'), so we fail to find it while linting.

Good find Grant.