Search in sources :

Example 1 with GrFieldStub

use of org.jetbrains.plugins.groovy.lang.psi.stubs.GrFieldStub in project intellij-community by JetBrains.

the class GrFieldElementType method deserializeFieldStub.

static GrFieldStub deserializeFieldStub(StubInputStream dataStream, StubElement parentStub) throws IOException {
    StringRef ref = dataStream.readName();
    final String[] annNames = GrStubUtils.readStringArray(dataStream);
    final String[] namedParameters = GrStubUtils.readStringArray(dataStream);
    byte flags = dataStream.readByte();
    final String typeText = GrStubUtils.readNullableString(dataStream);
    return new GrFieldStub(parentStub, ref, annNames, namedParameters, GrFieldStub.isEnumConstant(flags) ? GroovyElementTypes.ENUM_CONSTANT : GroovyElementTypes.FIELD, flags, typeText);
}
Also used : GrFieldStub(org.jetbrains.plugins.groovy.lang.psi.stubs.GrFieldStub) StringRef(com.intellij.util.io.StringRef)

Example 2 with GrFieldStub

use of org.jetbrains.plugins.groovy.lang.psi.stubs.GrFieldStub in project intellij-community by JetBrains.

the class GrFieldImpl method getNamedParameters.

@Override
@NotNull
public Map<String, NamedArgumentDescriptor> getNamedParameters() {
    final GrFieldStub stub = getStub();
    if (stub != null) {
        String[] namedParameters = stub.getNamedParameters();
        if (namedParameters.length == 0)
            return Collections.emptyMap();
        Map<String, NamedArgumentDescriptor> result = ContainerUtil.newHashMap();
        for (String parameter : namedParameters) {
            result.put(parameter, GrNamedArgumentSearchVisitor.CODE_NAMED_ARGUMENTS_DESCR);
        }
        return result;
    }
    return GrNamedArgumentSearchVisitor.find(this);
}
Also used : GrFieldStub(org.jetbrains.plugins.groovy.lang.psi.stubs.GrFieldStub) NamedArgumentDescriptor(org.jetbrains.plugins.groovy.extensions.NamedArgumentDescriptor) NotNull(org.jetbrains.annotations.NotNull)

Aggregations

GrFieldStub (org.jetbrains.plugins.groovy.lang.psi.stubs.GrFieldStub)2 StringRef (com.intellij.util.io.StringRef)1 NotNull (org.jetbrains.annotations.NotNull)1 NamedArgumentDescriptor (org.jetbrains.plugins.groovy.extensions.NamedArgumentDescriptor)1