Search in sources :

Example 6 with StringRef

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

the class PropertyStubStorage method deserialize.

public static PropertyStubStorage deserialize(StubInputStream stream) throws IOException {
    PropertyStubStorage me = new PropertyStubStorage();
    me.myGetter = readOne(stream);
    me.mySetter = readOne(stream);
    me.myDeleter = readOne(stream);
    //
    StringRef ref = stream.readName();
    me.myDoc = ref != null ? ref.getString() : null;
    return me;
}
Also used : StringRef(com.intellij.util.io.StringRef)

Example 7 with StringRef

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

the class PyFunctionElementType method deserialize.

@NotNull
public PyFunctionStub deserialize(@NotNull final StubInputStream dataStream, final StubElement parentStub) throws IOException {
    String name = StringRef.toString(dataStream.readName());
    String docString = dataStream.readUTFFast();
    StringRef deprecationMessage = dataStream.readName();
    final boolean isAsync = dataStream.readBoolean();
    final StringRef typeComment = dataStream.readName();
    return new PyFunctionStubImpl(name, StringUtil.nullize(docString), deprecationMessage == null ? null : deprecationMessage.getString(), isAsync, typeComment == null ? null : typeComment.getString(), parentStub, getStubElementType());
}
Also used : StringRef(com.intellij.util.io.StringRef) NotNull(org.jetbrains.annotations.NotNull)

Example 8 with StringRef

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

the class PyImportElementElementType method deserialize.

@NotNull
public PyImportElementStub deserialize(@NotNull StubInputStream dataStream, StubElement parentStub) throws IOException {
    QualifiedName qName = QualifiedName.deserialize(dataStream);
    StringRef asName = dataStream.readName();
    return new PyImportElementStubImpl(qName, asName.getString(), parentStub, getStubElementType());
}
Also used : QualifiedName(com.intellij.psi.util.QualifiedName) StringRef(com.intellij.util.io.StringRef) NotNull(org.jetbrains.annotations.NotNull)

Example 9 with StringRef

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

the class PyNamedParameterElementType method deserialize.

@NotNull
public PyNamedParameterStub deserialize(@NotNull final StubInputStream dataStream, final StubElement parentStub) throws IOException {
    String name = StringRef.toString(dataStream.readName());
    byte flags = dataStream.readByte();
    final StringRef typeComment = dataStream.readName();
    return new PyNamedParameterStubImpl(name, (flags & POSITIONAL_CONTAINER) != 0, (flags & KEYWORD_CONTAINER) != 0, (flags & HAS_DEFAULT_VALUE) != 0, typeComment == null ? null : typeComment.getString(), parentStub, getStubElementType());
}
Also used : StringRef(com.intellij.util.io.StringRef) NotNull(org.jetbrains.annotations.NotNull)

Example 10 with StringRef

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

the class PyNamedTupleStubImpl method deserialize.

@Nullable
public static PyNamedTupleStub deserialize(@NotNull StubInputStream stream) throws IOException {
    final StringRef calleeName = stream.readName();
    final StringRef name = stream.readName();
    final List<String> fields = deserializeFields(stream, stream.readVarInt());
    if (calleeName == null || name == null) {
        return null;
    }
    return new PyNamedTupleStubImpl(QualifiedName.fromDottedString(calleeName.getString()), name.getString(), fields);
}
Also used : StringRef(com.intellij.util.io.StringRef) Nullable(org.jetbrains.annotations.Nullable)

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