How to get the name of PsiAnonymousClass?

已回答

In java an Anonymous class has the name parent$number, and I'd like to somehow get that name from PsiAnonymousClass.

But both PsiAnonymousClass.getQualifiedName() and PsiAnonymousClass.getNameIdentifier() return null.

0

The PSI represents source-level status where anonymous classes do not have a name.

0

Thanks. I will work around this issue by getting the parents of the anonymous class until I get a normal class and will create the name from it (even if not accurate).

0

请先登录再写评论。