use of com.intellij.psi.impl.java.stubs.PsiClassInitializerStub in project intellij-community by JetBrains.
the class PsiClassImpl method getContextStub.
@Nullable
private StubElement getContextStub() {
PsiClassStub<?> stub = getStub();
if (stub == null)
return null;
// if AST is not loaded, then we only can need context to resolve supertype references
// this can be done by stubs unless there are local/anonymous classes referencing other local classes
StubElement parent = stub.getParentStub();
if (parent instanceof PsiClassInitializerStub || parent instanceof PsiMethodStub) {
if (parent.getChildrenByType(JavaStubElementTypes.CLASS, PsiElement.ARRAY_FACTORY).length <= 1) {
parent = parent.getParentStub();
}
}
return parent instanceof PsiClassStub ? parent : null;
}
Aggregations