Search in sources :

Example 31 with StringRef

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

Example 32 with StringRef

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

the class IdeStubIndexService method indexFile.

@Override
public void indexFile(KotlinFileStub stub, IndexSink sink) {
    FqName packageFqName = stub.getPackageFqName();
    sink.occurrence(KotlinExactPackagesIndex.getInstance().getKey(), packageFqName.asString());
    if (stub.isScript())
        return;
    FqName facadeFqName = ((KotlinFileStubForIde) stub).getFacadeFqName();
    if (facadeFqName != null) {
        sink.occurrence(KotlinFileFacadeFqNameIndex.INSTANCE.getKey(), facadeFqName.asString());
        sink.occurrence(KotlinFileFacadeShortNameIndex.INSTANCE.getKey(), facadeFqName.shortName().asString());
        sink.occurrence(KotlinFileFacadeClassByPackageIndex.INSTANCE.getKey(), packageFqName.asString());
    }
    FqName partFqName = ((KotlinFileStubForIde) stub).getPartFqName();
    if (partFqName != null) {
        sink.occurrence(KotlinFilePartClassIndex.INSTANCE.getKey(), partFqName.asString());
    }
    List<StringRef> partNames = ((KotlinFileStubForIde) stub).getFacadePartSimpleNames();
    if (partNames != null) {
        for (StringRef partName : partNames) {
            String partSimpleName = StringRef.toString(partName);
            if (partSimpleName == null) {
                continue;
            }
            FqName multifileClassPartFqName = packageFqName.child(Name.identifier(partSimpleName));
            sink.occurrence(KotlinMultifileClassPartIndex.INSTANCE.getKey(), multifileClassPartFqName.asString());
        }
    }
}
Also used : FqName(org.jetbrains.kotlin.name.FqName) StringRef(com.intellij.util.io.StringRef)

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