Search in sources :

Example 26 with StringRef

use of com.intellij.util.io.StringRef in project kotlin by JetBrains.

the class KtImportDirectiveElementType method createStub.

@Override
public KotlinImportDirectiveStub createStub(@NotNull KtImportDirective psi, StubElement parentStub) {
    FqName importedFqName = psi.getImportedFqName();
    StringRef fqName = StringRef.fromString(importedFqName == null ? null : importedFqName.asString());
    StringRef aliasName = StringRef.fromString(psi.getAliasName());
    return new KotlinImportDirectiveStubImpl(parentStub, psi.isAllUnder(), fqName, aliasName, psi.isValidImport());
}
Also used : KotlinImportDirectiveStubImpl(org.jetbrains.kotlin.psi.stubs.impl.KotlinImportDirectiveStubImpl) FqName(org.jetbrains.kotlin.name.FqName) StringRef(com.intellij.util.io.StringRef)

Example 27 with StringRef

use of com.intellij.util.io.StringRef 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)

Example 28 with StringRef

use of com.intellij.util.io.StringRef in project kotlin by JetBrains.

the class KtParameterElementType method createStub.

@Override
public KotlinParameterStub createStub(@NotNull KtParameter psi, StubElement parentStub) {
    FqName fqName = psi.getFqName();
    StringRef fqNameRef = StringRef.fromString(fqName != null ? fqName.asString() : null);
    return new KotlinParameterStubImpl(parentStub, fqNameRef, StringRef.fromString(psi.getName()), psi.isMutable(), psi.hasValOrVar(), psi.hasDefaultValue());
}
Also used : FqName(org.jetbrains.kotlin.name.FqName) StringRef(com.intellij.util.io.StringRef) KotlinParameterStubImpl(org.jetbrains.kotlin.psi.stubs.impl.KotlinParameterStubImpl)

Example 29 with StringRef

use of com.intellij.util.io.StringRef in project kotlin by JetBrains.

the class KtPropertyElementType method deserialize.

@NotNull
@Override
public KotlinPropertyStub deserialize(@NotNull StubInputStream dataStream, StubElement parentStub) throws IOException {
    StringRef name = dataStream.readName();
    boolean isVar = dataStream.readBoolean();
    boolean isTopLevel = dataStream.readBoolean();
    boolean hasDelegate = dataStream.readBoolean();
    boolean hasDelegateExpression = dataStream.readBoolean();
    boolean hasInitializer = dataStream.readBoolean();
    boolean hasReceiverTypeRef = dataStream.readBoolean();
    boolean hasReturnTypeRef = dataStream.readBoolean();
    StringRef fqNameAsString = dataStream.readName();
    FqName fqName = fqNameAsString != null ? new FqName(fqNameAsString.toString()) : null;
    return new KotlinPropertyStubImpl(parentStub, name, isVar, isTopLevel, hasDelegate, hasDelegateExpression, hasInitializer, hasReceiverTypeRef, hasReturnTypeRef, fqName);
}
Also used : FqName(org.jetbrains.kotlin.name.FqName) KotlinPropertyStubImpl(org.jetbrains.kotlin.psi.stubs.impl.KotlinPropertyStubImpl) StringRef(com.intellij.util.io.StringRef) NotNull(org.jetbrains.annotations.NotNull)

Example 30 with StringRef

use of com.intellij.util.io.StringRef in project kotlin by JetBrains.

the class KtTypeParameterElementType method deserialize.

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

Aggregations

StringRef (com.intellij.util.io.StringRef)32 NotNull (org.jetbrains.annotations.NotNull)24 FqName (org.jetbrains.kotlin.name.FqName)6 TypeInfo (com.intellij.psi.impl.cache.TypeInfo)3 QualifiedName (com.intellij.psi.util.QualifiedName)2 IOException (java.io.IOException)2 Nullable (org.jetbrains.annotations.Nullable)2 KotlinImportDirectiveStubImpl (org.jetbrains.kotlin.psi.stubs.impl.KotlinImportDirectiveStubImpl)2 KotlinParameterStubImpl (org.jetbrains.kotlin.psi.stubs.impl.KotlinParameterStubImpl)2 PsiClassStubImpl (com.intellij.psi.impl.java.stubs.impl.PsiClassStubImpl)1 PsiFieldStubImpl (com.intellij.psi.impl.java.stubs.impl.PsiFieldStubImpl)1 PsiImportStatementStubImpl (com.intellij.psi.impl.java.stubs.impl.PsiImportStatementStubImpl)1 PsiJavaFileStubImpl (com.intellij.psi.impl.java.stubs.impl.PsiJavaFileStubImpl)1 PsiMethodStubImpl (com.intellij.psi.impl.java.stubs.impl.PsiMethodStubImpl)1 PsiParameterStubImpl (com.intellij.psi.impl.java.stubs.impl.PsiParameterStubImpl)1 PyFileStubImpl (com.jetbrains.python.psi.impl.stubs.PyFileStubImpl)1 ArrayList (java.util.ArrayList)1 BitSet (java.util.BitSet)1 JvmFileClassInfo (org.jetbrains.kotlin.fileClasses.JvmFileClassInfo)1 KotlinAnnotationEntryStubImpl (org.jetbrains.kotlin.psi.stubs.impl.KotlinAnnotationEntryStubImpl)1