ITypeHierachy problem [message #78483] |
Sun, 20 July 2003 10:27 |
Eclipse User |
|
|
|
Hello,
I want to access the type hierachy of an IType programmatically with my
plugin.
Here's the code
//create the hierachy from a working copy (tmpNewCopy) of the
//ICompilationUnit (knowing that there is always only one type in the
//compilation unit)
ITypeHierarchy hierachy =
tmpNewCopy.getTypes()[0].newSupertypeHierarchy(
new IWorkingCopy[]{tmpNewCopy},
null);
//get the super-types of the IType
IType[] superTypes = hierachy.getAllSupertypes(tmpNewCopy.getTypes()[0]);
for (int i = 0; i < superTypes.length; i++) {
//do something
}
The problem is that hierachy.getAllSupertypes() always returns an empty
array and the loop is not run through, although the type extends a
superclass and implements some interfaces.
At the time when the statement above is processed the working copy contains
only the type definition (which was created with
ICompilationUnit.createType()) and I can see that the source contains the
type by calling ICompilationUnit.getSource(). But the working copy is not
commited.
What's wrong in my code?
Thanks in advance
Michael Taege
-------------------------------------
Dipl. Ing. Michael T
|
|
|
Powered by
FUDForum. Page generated in 0.02920 seconds