Bug 5384 - search engine: behavior different than expected
Summary: search engine: behavior different than expected
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: 2.0 M1   Edit
Assignee: Jerome Lanneluc CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2001-10-31 10:57 EST by Adam Kiezun CLA
Modified: 2002-01-11 09:22 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Adam Kiezun CLA 2001-10-31 10:57:00 EST
i'd like to use the methods on SearchEngine:

searchDeclarationsOfAccessedFields
searchDeclarationsOfReferencedTypes
searchDeclarationsOfSentMessages

however, they very much do not do what i'd like to see:
1. when using searchDeclarationsOfAccessedFields, i'd like to get matches 
 with enclosingJavaElement being IField - these matches should be the field 
declarations (as the name suggests)

2. these matches do not have to be in the java element specified as enclosing.
in fact, when using searchDeclarationsOfReferencedTypes, for instance, i expect 
them to be possibly in many different files.

to put it short- i'd like too see these methods do what their names suggest:
searchDeclarationsOfReferencedTypes - should find declarations of referenced 
types etc. (*declarations*, not just references to types).

i'd like to use these methods to quickly "analyze" code of a method, for 
instance, to see what fields it accesses, what types it uses, what other 
methods it invokes.
Comment 1 Jerome Lanneluc CLA 2001-11-02 07:07:45 EST
Agreed. The current behavior of these methods is incorrect and should be fixed.
Comment 2 Jerome Lanneluc CLA 2001-11-20 12:50:22 EST
Implemented correct behavior by using 3 new patterns:
- DeclarationOfAccessedFieldsPattern that extends FieldReferencePattern
- DeclarationOfReferencedTypesPattern that extends TypeReferencePattern
- DeclarationOfReferencedMethodsPattern that extends MethodReferencePattern

They all redefine the reportReference method by searching for the corresponding 
declaration and reporting it instead of the reference.