I'm trying to get the supertype hierarchy in an ASTVisitor, but unfortunately it keeps throwing a ModelException when callling newSupertypeHierarchy():
public boolean visit(TypeDeclaration s) throws Exception
{
try { if (s instanceof ClassDeclaration) { IType type = sourceModule.getType(s.getName()); ITypeHierarchy hierarchy = type.newSupertypeHierarchy(new NullProgressMonitor());
} } catch (ModelException e) { e.printStackTrace(); }
return super.visit(s); }
The exception thrown is "SubTest [in SubTest.php [in src [in <project root> [in test]]]] does not exist" when calling type.newSupertypeHierarchy().
However, the SubTest class exists and is open in the current editor.