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

Bug 498152

Summary: [quickfix] Remove unused param leaves dangling comma
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: Olivier_Thomann
Version: 12.0   
Target Milestone: 13.0   
Hardware: PC   
OS: Mac OS X   
Whiteboard:

Description Michael Rennie CLA 2016-07-19 12:07:44 EDT
Consider the following snippet:

define("webtools/htmlOutliner", [
	'orion/objects',
], function(Objects) {

});

If you use the quickfix to remove the unused param it leaves a dangling comma.

After the fix:

define("webtools/htmlOutliner", [
	,
], function() {

});
Comment 1 Olivier Thomann CLA 2016-08-22 14:18:32 EDT
This can be easily fixed when there is one element in the array, but when you have:
/*eslint-env amd */
define("webtools/htmlOutliner", [
	'orion/objects', 'orion/edit',
], function(Objects, Edits) {
	
});

and you apply the quickfix for all, you end up with:
/*eslint-env amd */
define("webtools/htmlOutliner", [
	,
], function() {
	
});

Each quickfix doesn't see itself as the last parameter to remove. It is only when both changes are applied that the array is empty.

I will see if removing an element into an array can check for trailing commas.