PSI Cookbook: cleanup

This commit is contained in:
Yann Cébron 2019-05-21 14:50:45 +02:00
parent cb4b62fe61
commit dda50e0cd3

View File

@ -41,9 +41,12 @@ This page gives a list of recipes for the most common operations for working wit
### How do I get a reference to the containing package of a Java class?
```java
PsiJavaFile javaFile = (PsiJavaFile) psiClass.getContaningFile();
PsiJavaFile javaFile = (PsiJavaFile) psiClass.getContainingFile();
PsiPackage pkg = JavaPsiFacade.getInstance(project).findPackage(javaFile.getPackageName());
```
```
or
`com.intellij.psi.util.PsiUtil.getPackageName()`
### How do I find the methods overriding a specific method?