use of org.jetbrains.plugins.groovy.lang.psi.stubs.GrTypeDefinitionStub in project intellij-community by JetBrains.
the class GrTypeDefinitionImpl method getQualifiedName.
@Nullable
@Override
public String getQualifiedName() {
final GrTypeDefinitionStub stub = getStub();
if (stub != null) {
return stub.getQualifiedName();
}
PsiElement parent = getParent();
if (parent instanceof GroovyFile) {
String packageName = ((GroovyFile) parent).getPackageName();
return !packageName.isEmpty() ? packageName + "." + getName() : getName();
}
final PsiClass containingClass = getContainingClass();
if (containingClass != null && containingClass.getQualifiedName() != null) {
return containingClass.getQualifiedName() + "." + getName();
}
return null;
}
use of org.jetbrains.plugins.groovy.lang.psi.stubs.GrTypeDefinitionStub in project intellij-community by JetBrains.
the class GrTypeDefinitionImpl method getScope.
@Nullable
@Override
public PsiElement getScope() {
final GrTypeDefinitionStub stub = getStub();
if (stub != null) {
return stub.getParentStub().getPsi();
}
ASTNode treeElement = getNode();
ASTNode parent = treeElement.getTreeParent();
while (parent != null) {
if (parent.getElementType() instanceof IStubElementType && !(parent.getElementType() == GroovyElementTypes.CLASS_BODY)) {
return parent.getPsi();
}
parent = parent.getTreeParent();
}
return getContainingFile();
}
Aggregations