how i can get all class ( and inner classes ) from a psiFile?

Answered

I am trying to make a plugin and i want to search the reference of all classes in project and check if the extend a spesific class but how i can parse the inner classes :

PsiJavaFile psiJavaFile = (PsiJavaFile) PsiManager.getInstance(project).findFile(virtualFile);
PsiClass[] javaFileClasses = psiJavaFile.getClasses();

for (PsiClass javaFileClass : javaFileClasses) {

PsiReferenceList extendsList = javaFileClass.getExtendsList();
....to something with extendList...
}

but with getClasses dont gives me the inner classes.

How i can parse the inner classes too?

0
1 comment
Avatar
Permanently deleted user

PsiClass.getInnerClasses() is made for that.

0

Please sign in to leave a comment.