Drop isLocalClass, do not write KotlinLocalClass
This commit is contained in:
+4
-3
@@ -69,11 +69,12 @@ fun isKotlinInternalCompiledFile(file: VirtualFile): Boolean {
|
||||
if (ClassFileViewProvider.isInnerClass(file)) {
|
||||
return true
|
||||
}
|
||||
val header = IDEKotlinBinaryClassCache.getKotlinBinaryClassHeaderData(file)?.classHeader ?: return false
|
||||
|
||||
val (header, classId) = IDEKotlinBinaryClassCache.getKotlinBinaryClassHeaderData(file) ?: return false
|
||||
if (classId.isLocal) return true
|
||||
|
||||
return header.kind == KotlinClassHeader.Kind.SYNTHETIC_CLASS ||
|
||||
header.kind == KotlinClassHeader.Kind.MULTIFILE_CLASS_PART ||
|
||||
header.isLocalClass
|
||||
header.kind == KotlinClassHeader.Kind.MULTIFILE_CLASS_PART
|
||||
}
|
||||
|
||||
fun findMultifileClassParts(file: VirtualFile, classId: ClassId, header: KotlinClassHeader): List<KotlinJvmBinaryClass> {
|
||||
|
||||
+1
-1
@@ -81,7 +81,7 @@ open class KotlinClsStubBuilder : ClsStubBuilder() {
|
||||
}
|
||||
return when (header.kind) {
|
||||
KotlinClassHeader.Kind.CLASS -> {
|
||||
if (header.isLocalClass) return null
|
||||
if (classId.isLocal) return null
|
||||
val (nameResolver, classProto) = JvmProtoBufUtil.readClassDataFrom(annotationData, strings)
|
||||
val context = components.createContext(nameResolver, packageFqName, TypeTable(classProto.typeTable))
|
||||
createTopLevelClassStub(classId, classProto, context)
|
||||
|
||||
+6
-5
@@ -22,19 +22,20 @@ import org.jetbrains.kotlin.idea.caches.IDEKotlinBinaryClassCache
|
||||
import org.jetbrains.kotlin.idea.decompiler.navigation.NavigateToDecompiledLibraryTest
|
||||
import org.jetbrains.kotlin.idea.test.KotlinLightCodeInsightFixtureTestCase
|
||||
import org.jetbrains.kotlin.load.kotlin.header.KotlinClassHeader
|
||||
import org.jetbrains.kotlin.name.ClassId
|
||||
import org.junit.Assert
|
||||
|
||||
abstract class AbstractInternalCompiledClassesTest : KotlinLightCodeInsightFixtureTestCase() {
|
||||
private fun isFileWithHeader(predicate: (KotlinClassHeader) -> Boolean) : VirtualFile.() -> Boolean = {
|
||||
val header = IDEKotlinBinaryClassCache.getKotlinBinaryClassHeaderData(this)?.classHeader
|
||||
header != null && predicate(header)
|
||||
private fun isFileWithHeader(predicate: (KotlinClassHeader, ClassId) -> Boolean) : VirtualFile.() -> Boolean = {
|
||||
val info = IDEKotlinBinaryClassCache.getKotlinBinaryClassHeaderData(this)
|
||||
info != null && predicate(info.classHeader, info.classId)
|
||||
}
|
||||
|
||||
protected fun isSyntheticClass(): VirtualFile.() -> Boolean =
|
||||
isFileWithHeader { it.kind == KotlinClassHeader.Kind.SYNTHETIC_CLASS }
|
||||
isFileWithHeader { header, classId -> header.kind == KotlinClassHeader.Kind.SYNTHETIC_CLASS }
|
||||
|
||||
protected fun doTestNoPsiFilesAreBuiltForLocalClass(): Unit =
|
||||
doTestNoPsiFilesAreBuiltFor("local", isFileWithHeader { it.isLocalClass })
|
||||
doTestNoPsiFilesAreBuiltFor("local", isFileWithHeader { header, classId -> classId.isLocal })
|
||||
|
||||
protected fun doTestNoPsiFilesAreBuiltForSyntheticClasses(): Unit =
|
||||
doTestNoPsiFilesAreBuiltFor("synthetic", isSyntheticClass())
|
||||
|
||||
Reference in New Issue
Block a user