Create subclass with PSI
Hi!
I am trying to create a subclass with PSI. I havent figured out how to make one without without useing the createClassFromText method. But when I try that and try to add methods to it afterwards it just seems to create some _Dummy_ class and adds the method to it instead.
It feels like I missed something.. I would really appraciate some help if someone knows how to do this :)
Thanks!
/Johan
Please sign in to leave a comment.
You could change name afterwards, or you could use
factory.createClass("Test");you can
PsiClass clazz = factory.createClassFromText("public class A {}", null).getInnerClasses()[0];