Search in sources :

Example 1 with KotlinClassStubImpl

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

the class KtClassElementType method deserialize.

@NotNull
@Override
public KotlinClassStub deserialize(@NotNull StubInputStream dataStream, StubElement parentStub) throws IOException {
    StringRef name = dataStream.readName();
    StringRef qualifiedName = dataStream.readName();
    boolean isTrait = dataStream.readBoolean();
    boolean isEnumEntry = dataStream.readBoolean();
    boolean isLocal = dataStream.readBoolean();
    boolean isTopLevel = dataStream.readBoolean();
    int superCount = dataStream.readVarInt();
    StringRef[] superNames = StringRef.createArray(superCount);
    for (int i = 0; i < superCount; i++) {
        superNames[i] = dataStream.readName();
    }
    return new KotlinClassStubImpl(getStubType(isEnumEntry), parentStub, qualifiedName, name, superNames, isTrait, isEnumEntry, isLocal, isTopLevel);
}
Also used : KotlinClassStubImpl(org.jetbrains.kotlin.psi.stubs.impl.KotlinClassStubImpl) StringRef(com.intellij.util.io.StringRef) NotNull(org.jetbrains.annotations.NotNull)

Example 2 with KotlinClassStubImpl

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

the class KtClassElementType method createStub.

@Override
public KotlinClassStub createStub(@NotNull KtClass psi, StubElement parentStub) {
    FqName fqName = ResolveSessionUtils.safeFqNameForLazyResolve(psi);
    boolean isEnumEntry = psi instanceof KtEnumEntry;
    List<String> superNames = KtPsiUtilKt.getSuperNames(psi);
    return new KotlinClassStubImpl(getStubType(isEnumEntry), parentStub, StringRef.fromString(fqName != null ? fqName.asString() : null), StringRef.fromString(psi.getName()), Utils.INSTANCE.wrapStrings(superNames), psi.isInterface(), isEnumEntry, psi.isLocal(), psi.isTopLevel());
}
Also used : FqName(org.jetbrains.kotlin.name.FqName) KotlinClassStubImpl(org.jetbrains.kotlin.psi.stubs.impl.KotlinClassStubImpl) KtEnumEntry(org.jetbrains.kotlin.psi.KtEnumEntry)

Aggregations

KotlinClassStubImpl (org.jetbrains.kotlin.psi.stubs.impl.KotlinClassStubImpl)2 StringRef (com.intellij.util.io.StringRef)1 NotNull (org.jetbrains.annotations.NotNull)1 FqName (org.jetbrains.kotlin.name.FqName)1 KtEnumEntry (org.jetbrains.kotlin.psi.KtEnumEntry)1