Search in sources :

Example 1 with PerlGlobStub

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

the class PerlGlobVariableMixin method getName.

@Override
public String getName() {
    PerlGlobStub stub = getStub();
    if (stub != null) {
        return stub.getName();
    }
    PerlVariableNameElement variableNameElement = getVariableNameElement();
    if (variableNameElement == null) {
        return null;
    }
    String variableNameText = variableNameElement.getText();
    int delimiterIndex = variableNameText.lastIndexOf(':');
    return delimiterIndex == -1 ? variableNameText : variableNameText.substring(delimiterIndex + 1);
}
Also used : PerlVariableNameElement(com.perl5.lang.perl.psi.PerlVariableNameElement) PerlGlobStub(com.perl5.lang.perl.psi.stubs.globs.PerlGlobStub)

Example 2 with PerlGlobStub

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

the class PerlGlobVariableMixin method getPackageName.

@Nullable
@Override
public String getPackageName() {
    PerlGlobStub stub = getStub();
    if (stub != null) {
        return stub.getPackageName();
    }
    String namespace = getExplicitPackageName();
    if (namespace == null) {
        namespace = getContextPackageName();
    }
    return namespace;
}
Also used : PerlGlobStub(com.perl5.lang.perl.psi.stubs.globs.PerlGlobStub) Nullable(org.jetbrains.annotations.Nullable)

Aggregations

PerlGlobStub (com.perl5.lang.perl.psi.stubs.globs.PerlGlobStub)2 PerlVariableNameElement (com.perl5.lang.perl.psi.PerlVariableNameElement)1 Nullable (org.jetbrains.annotations.Nullable)1