use of com.perl5.lang.perl.psi.stubs.variables.PerlVariableDeclarationStub in project Perl5-IDEA by Camelcade.
the class PerlVariableDeclarationElementMixin method getNamespaceName.
@Override
@NotNull
public String getNamespaceName() {
PerlVariableDeclarationStub stub = getGreenStub();
if (stub != null) {
return stub.getNamespaceName();
}
String qualifierName = getVariable().getExplicitNamespaceName();
if (StringUtil.isNotEmpty(qualifierName)) {
return qualifierName;
}
return PerlPackageUtil.getContextNamespaceName(getVariable());
}
use of com.perl5.lang.perl.psi.stubs.variables.PerlVariableDeclarationStub in project Perl5-IDEA by Camelcade.
the class PerlVariableDeclarationElementMixin method getDeclaredType.
@Nullable
@Override
public String getDeclaredType() {
PerlVariableAnnotations variableAnnotations = getVariableAnnotations();
if (variableAnnotations != null) {
String type = variableAnnotations.getType();
if (type != null) {
return type;
}
}
PerlVariableDeclarationStub stub = getStub();
if (stub != null) {
return stub.getDeclaredType();
} else {
return getLocallyDeclaredType();
}
}
use of com.perl5.lang.perl.psi.stubs.variables.PerlVariableDeclarationStub in project Perl5-IDEA by Camelcade.
the class PerlVariableDeclarationElementMixin method getPsiDeclaredValue.
@NotNull
public PerlValue getPsiDeclaredValue() {
PerlVariableDeclarationStub stub = getGreenStub();
if (stub != null) {
return stub.getDeclaredValue();
}
PerlVariableDeclarationExpr declaration = getPerlDeclaration();
return declaration == null ? UNKNOWN_VALUE : PerlScalarValue.create(declaration.getDeclarationType());
}
use of com.perl5.lang.perl.psi.stubs.variables.PerlVariableDeclarationStub in project Perl5-IDEA by Camelcade.
the class PerlVariableDeclarationElementMixin method getVariableAnnotations.
@Override
@Nullable
public PerlVariableAnnotations getVariableAnnotations() {
PerlVariableAnnotations variableAnnotations;
PerlVariableDeclarationStub stub = getGreenStub();
if (stub != null) {
variableAnnotations = stub.getVariableAnnotations();
} else {
// re-parsing
variableAnnotations = getLocalVariableAnnotations();
}
if (variableAnnotations != null) {
return variableAnnotations;
}
return getExternalVariableAnnotations();
}
use of com.perl5.lang.perl.psi.stubs.variables.PerlVariableDeclarationStub in project Perl5-IDEA by Camelcade.
the class PerlVariableStubElementType method serialize.
@Override
public void serialize(@NotNull PerlVariableDeclarationStub stub, @NotNull StubOutputStream dataStream) throws IOException {
dataStream.writeName(stub.getNamespaceName());
dataStream.writeName(stub.getVariableName());
stub.getDeclaredValue().serialize(dataStream);
dataStream.writeByte(stub.getActualType().ordinal());
PerlVariableAnnotations annotations = stub.getVariableAnnotations();
if (annotations == null) {
dataStream.writeBoolean(false);
} else {
dataStream.writeBoolean(true);
annotations.serialize(dataStream);
}
}
Aggregations