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

Bug 439156

Summary: Incorrect marking of 'this' occurrences in nested object scopes
Product: [ECD] Orion Reporter: Michael Rennie <Michael_Rennie>
Component: JS ToolsAssignee: Curtis Windatt <curtis.windatt.public>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: curtis.windatt.public
Version: 6.0   
Target Milestone: 8.0   
Hardware: PC   
OS: Mac OS X   
Whiteboard:

Description Michael Rennie CLA 2014-07-08 12:24:02 EDT
1. Open javascript/contentAssist/contentAssist.js
2. put the cursor in _createProposalDescription in the line: 'description: this._createProposalDescription(propTypeObj, env),' in _createInferredProposals
3. notice the decl and the one use is marked, but not the use right below it.

I would expect all of its use to be marked. 

Also note that if you select the decl of _createProposalDescription it does not mark either of the uses.

I'm guessing here, but likely has to do with our ObjectExpression scoping...
Comment 1 Curtis Windatt CLA 2014-10-28 13:07:48 EDT
Still a problem in 8.0, we are limiting the scope of the search to the selected scope and its parents, no sibling scopes.  To fix we need to do something similar to our standard occurrences check where we move occurrences into the parent scope until we find the declaring scope.
Comment 2 Curtis Windatt CLA 2014-10-28 14:53:12 EDT
http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=ff09ee984ca57fcec06ddc231cbc4404d7cb12a7
Fixed in master with tests

We already handled moving the occurrences to the defining scope.  However, we had code to explicitly skip object expressions that didn't contain the selection.