Closed ftomassetti closed 9 years ago
It should be fixed now.
@davidor you can now use solveSuperclass
(to get the direct parent class) and getAllSuperclasses
(to get all the parents, recurisively)
Do not expect it to work all the times :)
To solve types not in the same file you should set the dynamic variable typeSolver
.
Probably you want to do something like:
(def typeSolver (typeSolverOnList my-list-of-type-declarations))
where my-list-of-type-declarations
is a list of type declarations (classes, enums, interfaces). To get a list of type declarations you can get a list of compilation units and call (flatten (map allTypes cus))
If you have any questions feel absolutely free to write me/ping me!
(closing this issue because it should be solved)
Given this example:
We need to find the superclasses of C (A and B).
We have most of the logic in place for that, but I could write the last bit for this particular case.
I would write a function named "solveSuperclass" in funcs.clj which would get a ClassDeclaration instance and basically call
solveClass is a method from a protocol.
Once we have this function we can create getAllSuperclasses calling recursively solveSuperclass.