Search in sources :

Example 1 with PerlSubDefinitionStub

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

the class PerlSubDefinitionBase method getSubArgumentsList.

@NotNull
@Override
public List<PerlSubArgument> getSubArgumentsList() {
    PerlSubDefinitionStub stub = getStub();
    if (stub != null) {
        return new ArrayList<>(stub.getSubArgumentsList());
    }
    List<PerlSubArgument> arguments = getPerlSubArgumentsFromSignature();
    if (arguments == null) {
        arguments = getPerlSubArgumentsFromBody();
    }
    return arguments;
}
Also used : PerlSubDefinitionStub(com.perl5.lang.perl.psi.stubs.subsdefinitions.PerlSubDefinitionStub) PerlSubArgument(com.perl5.lang.perl.psi.utils.PerlSubArgument) ArrayList(java.util.ArrayList) NotNull(org.jetbrains.annotations.NotNull)

Example 2 with PerlSubDefinitionStub

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

the class PerlSubDefinitionElementType method deserialize.

@NotNull
@Override
public PerlSubDefinitionStub deserialize(@NotNull StubInputStream dataStream, StubElement parentStub) throws IOException {
    // noinspection ConstantConditions
    String packageName = dataStream.readName().getString();
    // noinspection ConstantConditions
    String functionName = dataStream.readName().getString();
    List<PerlSubArgument> arguments = PerlSubArgument.deserializeList(dataStream);
    PerlSubAnnotations annotations = null;
    if (dataStream.readBoolean()) {
        annotations = PerlSubAnnotations.deserialize(dataStream);
    }
    return createStubElement(parentStub, packageName, functionName, arguments, annotations);
}
Also used : PerlSubAnnotations(com.perl5.lang.perl.psi.utils.PerlSubAnnotations) PerlSubArgument(com.perl5.lang.perl.psi.utils.PerlSubArgument) NotNull(org.jetbrains.annotations.NotNull)

Example 3 with PerlSubDefinitionStub

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

the class PerlSubDefinitionElementType method serialize.

@Override
public void serialize(@NotNull PerlSubDefinitionStub stub, @NotNull StubOutputStream dataStream) throws IOException {
    dataStream.writeName(stub.getPackageName());
    dataStream.writeName(stub.getSubName());
    PerlSubArgument.serializeList(dataStream, stub.getSubArgumentsList());
    PerlSubAnnotations subAnnotations = stub.getAnnotations();
    if (subAnnotations == null) {
        dataStream.writeBoolean(false);
    } else {
        dataStream.writeBoolean(true);
        subAnnotations.serialize(dataStream);
    }
}
Also used : PerlSubAnnotations(com.perl5.lang.perl.psi.utils.PerlSubAnnotations)

Aggregations

PerlSubAnnotations (com.perl5.lang.perl.psi.utils.PerlSubAnnotations)2 PerlSubArgument (com.perl5.lang.perl.psi.utils.PerlSubArgument)2 NotNull (org.jetbrains.annotations.NotNull)2 PerlSubDefinitionStub (com.perl5.lang.perl.psi.stubs.subsdefinitions.PerlSubDefinitionStub)1 ArrayList (java.util.ArrayList)1