Search in sources :

Example 1 with KotlinObjectStubImpl

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

the class KtObjectElementType method createStub.

@Override
public KotlinObjectStub createStub(@NotNull KtObjectDeclaration psi, StubElement parentStub) {
    String name = psi.getName();
    FqName fqName = ResolveSessionUtils.safeFqNameForLazyResolve(psi);
    List<String> superNames = KtPsiUtilKt.getSuperNames(psi);
    return new KotlinObjectStubImpl(parentStub, StringRef.fromString(name), fqName, Utils.INSTANCE.wrapStrings(superNames), psi.isTopLevel(), psi.isCompanion(), psi.isLocal(), psi.isObjectLiteral());
}
Also used : FqName(org.jetbrains.kotlin.name.FqName) KotlinObjectStubImpl(org.jetbrains.kotlin.psi.stubs.impl.KotlinObjectStubImpl)

Example 2 with KotlinObjectStubImpl

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

the class KtObjectElementType method deserialize.

@NotNull
@Override
public KotlinObjectStub deserialize(@NotNull StubInputStream dataStream, StubElement parentStub) throws IOException {
    StringRef name = dataStream.readName();
    StringRef fqNameStr = dataStream.readName();
    FqName fqName = fqNameStr != null ? new FqName(fqNameStr.toString()) : null;
    boolean isTopLevel = dataStream.readBoolean();
    boolean isCompanion = dataStream.readBoolean();
    boolean isLocal = dataStream.readBoolean();
    boolean isObjectLiteral = dataStream.readBoolean();
    int superCount = dataStream.readVarInt();
    StringRef[] superNames = StringRef.createArray(superCount);
    for (int i = 0; i < superCount; i++) {
        superNames[i] = dataStream.readName();
    }
    return new KotlinObjectStubImpl(parentStub, name, fqName, superNames, isTopLevel, isCompanion, isLocal, isObjectLiteral);
}
Also used : FqName(org.jetbrains.kotlin.name.FqName) KotlinObjectStubImpl(org.jetbrains.kotlin.psi.stubs.impl.KotlinObjectStubImpl) StringRef(com.intellij.util.io.StringRef) NotNull(org.jetbrains.annotations.NotNull)

Aggregations

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