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

Bug 424202

Summary: Improve naming of return statements
Product: [ECD] Orion Reporter: Michael Rennie <Michael_Rennie>
Component: JS ToolsAssignee: Michael Rennie <Michael_Rennie>
Status: RESOLVED FIXED QA Contact:
Severity: enhancement    
Priority: P3 CC: curtis.windatt.public
Version: unspecified   
Target Milestone: 5.0 M2   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Attachments:
Description Flags
fix none

Description Michael Rennie CLA 2013-12-16 23:41:56 EST
Consider the following snippet:

function f1() {
	return {
		one: null
	}
}

function f2() {
	return function() {}
}

f1's return is outlined as 'closure {...}' which is not useful, and f2's return is outlined as 'function()' which is better, but should probably have the return part as the selection.

In both cases it might make more sense to outline them as 'return {...}' with the 'return' part as the selection ranges.
Comment 1 Michael Rennie CLA 2013-12-17 00:35:20 EST
Created attachment 238390 [details]
fix

This patch fixes the outlining and adds tests. I will push it to gerrit once bug 424149 is merged to avoid gerrit-dependency hell.
Comment 2 Michael Rennie CLA 2013-12-17 11:56:53 EST
pushed to Gerrit: https://git.eclipse.org/r/19913