Add packageProto/nameResolver to JvmPackagePartSource
May be useful for loading platform-specific protobuf extensions (such as package_module_name on JVM) when analyzing deserialized top level members
This commit is contained in:
+1
-1
@@ -92,7 +92,7 @@ class DeserializerForClassfileDecompiler(
|
||||
val (nameResolver, packageProto) = JvmProtoBufUtil.readPackageDataFrom(annotationData, strings)
|
||||
val membersScope = DeserializedPackageMemberScope(
|
||||
createDummyPackageFragment(header.packageName?.let(::FqName) ?: facadeFqName.parent()), packageProto, nameResolver,
|
||||
JvmPackagePartSource(binaryClassForPackageClass), deserializationComponents
|
||||
JvmPackagePartSource(binaryClassForPackageClass, packageProto, nameResolver), deserializationComponents
|
||||
) { emptyList() }
|
||||
return membersScope.getContributedDescriptors().toList()
|
||||
}
|
||||
|
||||
+6
-3
@@ -75,7 +75,8 @@ fun createFileFacadeStub(
|
||||
val fileStub = KotlinFileStubForIde.forFileFacadeStub(facadeFqName)
|
||||
setupFileStub(fileStub, packageFqName)
|
||||
val container = ProtoContainer.Package(
|
||||
packageFqName, c.nameResolver, c.typeTable, JvmPackagePartSource(JvmClassName.byClassId(ClassId.topLevel(facadeFqName)), null)
|
||||
packageFqName, c.nameResolver, c.typeTable,
|
||||
JvmPackagePartSource(JvmClassName.byClassId(ClassId.topLevel(facadeFqName)), null, packageProto, c.nameResolver)
|
||||
)
|
||||
createDeclarationsStubs(fileStub, c, container, packageProto)
|
||||
return fileStub
|
||||
@@ -95,8 +96,10 @@ fun createMultifileClassStub(
|
||||
val partHeader = partFile.classHeader
|
||||
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))
|
||||
val container = ProtoContainer.Package(
|
||||
packageFqName, partContext.nameResolver, partContext.typeTable,
|
||||
JvmPackagePartSource(partFile, packageProto, nameResolver)
|
||||
)
|
||||
createDeclarationsStubs(fileStub, partContext, container, packageProto)
|
||||
}
|
||||
return fileStub
|
||||
|
||||
Reference in New Issue
Block a user