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?
Please sign in to leave a comment.
PsiClass.getInnerClasses() is made for that.