Search in sources :

Example 1 with KotlinAnnotationEntryStubImpl

use of org.jetbrains.kotlin.psi.stubs.impl.KotlinAnnotationEntryStubImpl in project kotlin by JetBrains.

the class KtAnnotationEntryElementType method createStub.

@Override
public KotlinAnnotationEntryStub createStub(@NotNull KtAnnotationEntry psi, StubElement parentStub) {
    Name shortName = KtPsiUtil.getShortName(psi);
    String resultName = shortName != null ? shortName.asString() : psi.getText();
    KtValueArgumentList valueArgumentList = psi.getValueArgumentList();
    boolean hasValueArguments = valueArgumentList != null && !valueArgumentList.getArguments().isEmpty();
    return new KotlinAnnotationEntryStubImpl(parentStub, StringRef.fromString(resultName), hasValueArguments);
}
Also used : KotlinAnnotationEntryStubImpl(org.jetbrains.kotlin.psi.stubs.impl.KotlinAnnotationEntryStubImpl) KtValueArgumentList(org.jetbrains.kotlin.psi.KtValueArgumentList) Name(org.jetbrains.kotlin.name.Name)

Example 2 with KotlinAnnotationEntryStubImpl

use of org.jetbrains.kotlin.psi.stubs.impl.KotlinAnnotationEntryStubImpl in project kotlin by JetBrains.

the class KtAnnotationEntryElementType method deserialize.

@NotNull
@Override
public KotlinAnnotationEntryStub deserialize(@NotNull StubInputStream dataStream, StubElement parentStub) throws IOException {
    StringRef text = dataStream.readName();
    boolean hasValueArguments = dataStream.readBoolean();
    return new KotlinAnnotationEntryStubImpl(parentStub, text, hasValueArguments);
}
Also used : KotlinAnnotationEntryStubImpl(org.jetbrains.kotlin.psi.stubs.impl.KotlinAnnotationEntryStubImpl) StringRef(com.intellij.util.io.StringRef) NotNull(org.jetbrains.annotations.NotNull)

Aggregations

KotlinAnnotationEntryStubImpl (org.jetbrains.kotlin.psi.stubs.impl.KotlinAnnotationEntryStubImpl)2 StringRef (com.intellij.util.io.StringRef)1 NotNull (org.jetbrains.annotations.NotNull)1 Name (org.jetbrains.kotlin.name.Name)1 KtValueArgumentList (org.jetbrains.kotlin.psi.KtValueArgumentList)1