use of org.jetbrains.plugins.groovy.lang.psi.stubs.GrPackageDefinitionStub in project intellij-community by JetBrains.
the class GroovyFileImpl method getPackageDefinition.
@Override
public GrPackageDefinition getPackageDefinition() {
final StubElement<?> stub = getStub();
if (stub != null) {
for (StubElement element : stub.getChildrenStubs()) {
if (element instanceof GrPackageDefinitionStub)
return (GrPackageDefinition) element.getPsi();
}
return null;
}
ASTNode node = calcTreeElement().findChildByType(GroovyElementTypes.PACKAGE_DEFINITION);
return node != null ? (GrPackageDefinition) node.getPsi() : null;
}
use of org.jetbrains.plugins.groovy.lang.psi.stubs.GrPackageDefinitionStub in project intellij-community by JetBrains.
the class GrPackageDefinitionImpl method getPackageName.
@Override
public String getPackageName() {
final GrPackageDefinitionStub stub = getStub();
if (stub != null) {
return stub.getPackageName();
}
GrCodeReferenceElement ref = getPackageReference();
if (ref == null)
return "";
return PsiUtil.getQualifiedReferenceText(ref);
}
Aggregations