Skip to main content



      Home
Home » Eclipse Projects » Dynamic Languages Toolkit (DLTK) » [PDT/PHP] Find superclass(es) for given class(How can I search for PHP superclasses using DLTK/PDT dev APIs?)
icon5.gif  [PDT/PHP] Find superclass(es) for given class [message #658435] Tue, 08 March 2011 09:05 Go to next message
Eclipse UserFriend
Hi everyone. I'm developing a DLTK/PDT plugin (it's a goal evaluator extensions that do type hinting for Code Assist). I did something like:
http://wiki.eclipse.org/Extending_PDT_2.2#Type_inference_hin ting

Now I'm stucked because, after I succed to get the PHP class name I need, I can't find the way to check if that XXX class is a subclass of YYY. I can't figure out!
There's a way to explore the PHP Type Hierarchy? Or something, I don't know...

Thank you.
Lorenzo.
Re: [PDT/PHP] Find superclass(es) for given class [message #666823 is a reply to message #658435] Fri, 22 April 2011 16:27 Go to previous message
Eclipse UserFriend
Hello Lorenzo.

I just had to do something similar but starting with an "ISourceModule" instance.

for (IType type : sourceModule.getTypes()) {
    String[] ancestors = type.getSuperClasses();
    // ancestors are only the immediate parent types, not the grand-parent types
    foreach (String superClass : ancestors) {
        System.out.println(superClass);
    }
}


Basically the key is in "IType#getSuperClasses()". Much easier than I expected it to be!
Previous Topic:Use DefaultProblem to put error marker in editor
Next Topic:[BUILD] I-I201104241621-201104241621
Goto Forum:
  


Current Time: Tue Jul 15 03:27:16 EDT 2025

Powered by FUDForum. Page generated in 0.05061 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top