use of com.intellij.util.io.StringRef in project kotlin by JetBrains.
the class IdeStubIndexService method deserializeFileStub.
@NotNull
@Override
public KotlinFileStub deserializeFileStub(@NotNull StubInputStream dataStream) throws IOException {
StringRef packageFqNameAsString = dataStream.readName();
boolean isScript = dataStream.readBoolean();
StringRef facadeSimpleName = dataStream.readName();
StringRef partSimpleName = dataStream.readName();
int numPartNames = dataStream.readInt();
List<StringRef> facadePartNames = new ArrayList<StringRef>();
for (int i = 0; i < numPartNames; ++i) {
StringRef partNameRef = dataStream.readName();
facadePartNames.add(partNameRef);
}
return new KotlinFileStubForIde(null, packageFqNameAsString, isScript, facadeSimpleName, partSimpleName, facadePartNames);
}
use of com.intellij.util.io.StringRef in project kotlin by JetBrains.
the class IdeStubIndexService method createFileStub.
@NotNull
@Override
public KotlinFileStub createFileStub(@NotNull KtFile file) {
StringRef packageFqName = StringRef.fromString(file.getPackageFqNameByTree().asString());
boolean isScript = file.isScriptByTree();
if (PackagePartClassUtils.fileHasTopLevelCallables(file)) {
JvmFileClassInfo fileClassInfo = JvmFileClassUtil.getFileClassInfoNoResolve(file);
StringRef facadeSimpleName = StringRef.fromString(fileClassInfo.getFacadeClassFqName().shortName().asString());
StringRef partSimpleName = StringRef.fromString(fileClassInfo.getFileClassFqName().shortName().asString());
return new KotlinFileStubForIde(file, packageFqName, isScript, facadeSimpleName, partSimpleName, null);
}
return new KotlinFileStubForIde(file, packageFqName, isScript, null, null, null);
}
use of com.intellij.util.io.StringRef in project kotlin by JetBrains.
the class IdeStubIndexService method serializeFileStub.
@Override
public void serializeFileStub(@NotNull KotlinFileStub stub, @NotNull StubOutputStream dataStream) throws IOException {
KotlinFileStubForIde fileStub = (KotlinFileStubForIde) stub;
dataStream.writeName(fileStub.getPackageFqName().asString());
dataStream.writeBoolean(fileStub.isScript());
dataStream.writeName(StringRef.toString(fileStub.getFacadeSimpleName()));
dataStream.writeName(StringRef.toString(fileStub.getPartSimpleName()));
List<StringRef> facadePartNames = fileStub.getFacadePartSimpleNames();
if (facadePartNames == null) {
dataStream.writeInt(0);
} else {
dataStream.writeInt(facadePartNames.size());
for (StringRef partName : facadePartNames) {
dataStream.writeName(StringRef.toString(partName));
}
}
}
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;
}
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());
}
Aggregations