Bug 111215 - Search matches should report innermost enclosing java element on request
Summary: Search matches should report innermost enclosing java element on request
Status: RESOLVED DUPLICATE of bug 110336
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows XP
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-09-30 10:50 EDT by Markus Keller CLA
Modified: 2005-09-30 11:05 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Keller CLA 2005-09-30 10:50:09 EDT
As discussed at the JDT Summit 2005, we'd like to have a new flag on the search
engine to enable more precise enclosing element resolution.

This could be a new matchRule flag for
SearchPattern#createPattern(element, limitTo, matchRule).

When the flag is enabled, the enclosing element should also return
ILocalVariables iff applicable (and probably ITypeParameters, too).
E.g. here ...

    public class Try {
        <TP extends Try> void m(Try methodParam) {
            Try localVar;
            for (java.util.List<Try> localVar2;;) {
    
            }
        }
    }

... the references to Try should have as enclosing element:
- the ITypeParameter TP
- the ILocalVariable methodParam
- the ILocalVariable localVar
- the ILocalVariable localVar2
Comment 1 Markus Keller CLA 2005-09-30 10:53:52 EDT
We will use this to enhance rename refactorings (bug 37219), such that when you
e.g. rename type Try to Troy, a local variable _try can also be renamed to _troy.
Comment 2 Jerome Lanneluc CLA 2005-09-30 10:58:50 EDT

*** This bug has been marked as a duplicate of 110336 ***