Drop KotlinClassHeader#filePartClassNames, use 'data' instead
This commit is contained in:
+2
-2
@@ -76,10 +76,10 @@ fun isKotlinInternalCompiledFile(file: VirtualFile): Boolean {
|
||||
header.isLocalClass
|
||||
}
|
||||
|
||||
fun findMultifileClassParts(file: VirtualFile, classId: ClassId, kotlinClassHeader: KotlinClassHeader): List<KotlinJvmBinaryClass> {
|
||||
fun findMultifileClassParts(file: VirtualFile, classId: ClassId, header: KotlinClassHeader): List<KotlinJvmBinaryClass> {
|
||||
val packageFqName = classId.packageFqName
|
||||
val partsFinder = DirectoryBasedClassFinder(file.parent!!, packageFqName)
|
||||
val partNames = kotlinClassHeader.filePartClassNames ?: return emptyList()
|
||||
val partNames = header.data ?: return emptyList()
|
||||
return partNames.mapNotNull {
|
||||
partsFinder.findKotlinClass(ClassId(packageFqName, Name.identifier(it.substringAfterLast('/'))))
|
||||
}
|
||||
|
||||
+2
-2
@@ -72,7 +72,7 @@ class DeserializerForClassfileDecompiler(
|
||||
}
|
||||
val binaryClassForPackageClass = classFinder.findKotlinClass(ClassId.topLevel(facadeFqName))
|
||||
val header = binaryClassForPackageClass?.classHeader
|
||||
val annotationData = header?.annotationData
|
||||
val annotationData = header?.data
|
||||
val strings = header?.strings
|
||||
if (annotationData == null || strings == null) {
|
||||
LOG.error("Could not read annotation data for $facadeFqName from ${binaryClassForPackageClass?.classId}")
|
||||
@@ -117,7 +117,7 @@ class DirectoryBasedDataFinder(
|
||||
override fun findClassData(classId: ClassId): ClassDataWithSource? {
|
||||
val binaryClass = classFinder.findKotlinClass(classId) ?: return null
|
||||
val classHeader = binaryClass.classHeader
|
||||
val data = classHeader.annotationData
|
||||
val data = classHeader.data
|
||||
if (data == null) {
|
||||
log.error("Annotation data missing for ${binaryClass.classId}")
|
||||
return null
|
||||
|
||||
+1
-1
@@ -70,7 +70,7 @@ open class KotlinClsStubBuilder : ClsStubBuilder() {
|
||||
return createMultifileClassStub(header, partFiles, classId.asSingleFqName(), components)
|
||||
}
|
||||
|
||||
val annotationData = header.annotationData
|
||||
val annotationData = header.data
|
||||
if (annotationData == null) {
|
||||
LOG.error("Corrupted kotlin header for file ${file.name}")
|
||||
return null
|
||||
|
||||
+3
-3
@@ -75,18 +75,18 @@ fun createFileFacadeStub(
|
||||
}
|
||||
|
||||
fun createMultifileClassStub(
|
||||
kotlinClassHeader: KotlinClassHeader,
|
||||
header: KotlinClassHeader,
|
||||
partFiles: List<KotlinJvmBinaryClass>,
|
||||
facadeFqName: FqName,
|
||||
components: ClsStubBuilderComponents
|
||||
): KotlinFileStubImpl {
|
||||
val packageFqName = facadeFqName.parent()
|
||||
val partNames = kotlinClassHeader.filePartClassNames?.asList()?.map { it.substringAfterLast('/') }
|
||||
val partNames = header.data?.asList()?.map { it.substringAfterLast('/') }
|
||||
val fileStub = KotlinFileStubForIde.forMultifileClassStub(facadeFqName, partNames, packageFqName.isRoot)
|
||||
setupFileStub(fileStub, packageFqName)
|
||||
for (partFile in partFiles) {
|
||||
val partHeader = partFile.classHeader
|
||||
val (nameResolver, packageProto) = JvmProtoBufUtil.readPackageDataFrom(partHeader.annotationData!!, partHeader.strings!!)
|
||||
val (nameResolver, packageProto) = JvmProtoBufUtil.readPackageDataFrom(partHeader.data!!, partHeader.strings!!)
|
||||
val partContext = components.createContext(nameResolver, packageFqName, TypeTable(packageProto.typeTable))
|
||||
val container = ProtoContainer.Package(packageFqName, partContext.nameResolver, partContext.typeTable,
|
||||
JvmPackagePartSource(partFile.classId))
|
||||
|
||||
Reference in New Issue
Block a user