Community
Participate
Working Groups
When I do a search for references on a local variable I would expect the serach to be limited to the references of that variable within the function (or code loop) where it it has scope. Unfortunately for some reason eclipse finds all the references to variables of that type. Eg if the local variable is a String all the 1,000s of references to String variables are found. Eg. Create a new class public class testc { public void test() { String aString = null; } } Highlight the variable name 'aString' and then right click choose search | references | project or serach | references | workspace There really is only one reference. However 1,000s of Strings are found. Go on, try it. If it dont work ask me for me details.
The problem is that J Core returns the type instead of the local variable (for which we do not have a model element) when doing code assist. Besides searching there are other side effects e.g. F3 does not go to the declaration but opens the type. Moving to J Core for comments.
Support for local variable elements is planned for M5
JDT/Core now supports searching for references to and declarations of local variables. UI side needs to be fixed (see 45448)
*** Bug 6015 has been marked as a duplicate of this bug. ***
Verified