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

Bug 422495

Summary: Improve outlining of object and function assignments
Product: [ECD] Orion Reporter: Michael Rennie <Michael_Rennie>
Component: JS ToolsAssignee: Michael Rennie <Michael_Rennie>
Status: RESOLVED FIXED QA Contact:
Severity: enhancement    
Priority: P3    
Version: 5.0   
Target Milestone: 5.0 M1   
Hardware: PC   
OS: Mac OS X   
Whiteboard:
Bug Depends on:    
Bug Blocks: 422080    

Description Michael Rennie CLA 2013-11-25 11:44:34 EST
Consider the following snippet:

var Foo;

Foo.bar = {
	one: function(param) {
		
	},
	
	two: {}
};

In its current state that will get outlined as:

closure {...}
  one(param)
  two {...}

and the selection range for the 'closure' entry is the entire object (no useful). We should properly handle the assignment expression and parse out the name for the object assignment. In this case I would expect the outline to be:

Foo.bar {...}
  one(param)
  two {...}

and the selection range to be the string 'Foo.bar'.
Comment 1 Michael Rennie CLA 2013-11-25 12:54:44 EST
The same goes for function assignments:

var Foo;

Foo.baz = function(a, b, c) {
	
};

should be outlined as:

Foo.baz(a, b, c) with a selection range of 'Foo.baz'.
Comment 2 Michael Rennie CLA 2013-11-25 13:42:37 EST
Pushed to Gerrit: https://git.eclipse.org/r/18843
Comment 3 Michael Rennie CLA 2013-11-27 11:47:37 EST
(In reply to Michael Rennie from comment #2)
> Pushed to Gerrit: https://git.eclipse.org/r/18843

I had to redo the gerrit change because the other one was completely un-mergable:

https://git.eclipse.org/r/18986
Comment 4 Michael Rennie CLA 2013-11-27 12:35:54 EST
(In reply to Michael Rennie from comment #3)
> (In reply to Michael Rennie from comment #2)
> > Pushed to Gerrit: https://git.eclipse.org/r/18843
> 
> I had to redo the gerrit change because the other one was completely
> un-mergable:
> 
> https://git.eclipse.org/r/18986

The change has been merged: http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=03a03dff7c3bd4dfbe4aa51bb0938fe7459bc88c