use of com.perl5.lang.perl.psi.utils.PerlVariableAnnotations 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.utils.PerlVariableAnnotations 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.utils.PerlVariableAnnotations 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