Search in sources :

Example 1 with PerlUseStatementStub

use of com.perl5.lang.perl.psi.stubs.imports.PerlUseStatementStub in project Perl5-IDEA by Camelcade.

the class PerlUseStatementMixin method getPackageName.

@Override
public String getPackageName() {
    PerlUseStatementStub stub = getStub();
    if (stub != null) {
        return stub.getPackageName();
    }
    PerlNamespaceElement ns = getNamespaceElement();
    if (ns != null) {
        return ns.getCanonicalName();
    }
    return null;
}
Also used : PerlUseStatementStub(com.perl5.lang.perl.psi.stubs.imports.PerlUseStatementStub)

Example 2 with PerlUseStatementStub

use of com.perl5.lang.perl.psi.stubs.imports.PerlUseStatementStub in project Perl5-IDEA by Camelcade.

the class PerlUseStatementMixin method getImportParameters.

@Override
@Nullable
public List<String> getImportParameters() {
    PerlUseStatementStub stub = getStub();
    if (stub != null) {
        return stub.getImportParameters();
    }
    if (getExpr() == null) {
        return null;
    }
    PerlNamespaceElement namespaceElement = getNamespaceElement();
    if (namespaceElement != null) {
        return PerlPsiUtil.collectStringContents(namespaceElement.getNextSibling());
    } else {
        return Collections.emptyList();
    }
}
Also used : PerlUseStatementStub(com.perl5.lang.perl.psi.stubs.imports.PerlUseStatementStub) Nullable(org.jetbrains.annotations.Nullable)

Aggregations

PerlUseStatementStub (com.perl5.lang.perl.psi.stubs.imports.PerlUseStatementStub)2 Nullable (org.jetbrains.annotations.Nullable)1