Bug 23731 - AST: DCR: getSourcePath
Summary: AST: DCR: getSourcePath
Status: RESOLVED INVALID
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows 2000
: P3 enhancement (vote)
Target Milestone: 2.1 M1   Edit
Assignee: Jim des Rivieres CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-09-18 10:54 EDT by Martin Aeschlimann CLA
Modified: 2003-03-23 12:20 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 Martin Aeschlimann CLA 2002-09-18 10:54:55 EDT
20020917

A ITypeBinding can be asked if it is from source (isFromSource).
I now need to find this source file.
It is possible to do this using IJavaProject and search for the type. However, 
as the compiler already knows the path, it would be convenient if a method
'getSourceFilePath' would exist.
Comment 1 Olivier Thomann CLA 2002-09-18 11:01:39 EDT
API question should be sent to Jim.
Comment 2 Philipe Mulet CLA 2002-09-19 07:35:22 EDT
A binding doesn't remember where it came from. A source lookup action need to 
be perfomed using existing JavaModel API:

IJavaProject#findType(String packageName, String typeQualifiedName) throws 
JavaModelException;

Isn't this enough ?
Comment 3 Martin Aeschlimann CLA 2002-09-19 07:50:12 EDT
That's how I do it, it works.
I was thinking the binding would know the source location (it knows that it's 
from source), so we could avoid eventual problems with findType not finding a 
non public top level typ.
Comment 4 Philipe Mulet CLA 2002-09-19 08:42:49 EDT
As I said, the binding doesn't keep this information.
Ok to close?
Comment 5 Martin Aeschlimann CLA 2002-09-19 09:09:08 EDT
closing