Fix KotlinBytecodeToolWindow: show bytecode correctly when there is inline function from another module
#KT-7409 Fixed
This commit is contained in:
@@ -188,15 +188,6 @@ public class KotlinCacheService(val project: Project) {
|
||||
return getCacheToAnalyzeFiles(listOf(file)).getLazyResolveSession(file)
|
||||
}
|
||||
|
||||
public fun getAnalysisResults(elements: Collection<JetElement>): AnalysisResult {
|
||||
if (elements.isEmpty()) return AnalysisResult.EMPTY
|
||||
|
||||
val files = elements.map { it.getContainingJetFile() }.toSet()
|
||||
assertAreInSameModule(files)
|
||||
|
||||
return getCacheToAnalyzeFiles(files).getAnalysisResultsForElements(elements)
|
||||
}
|
||||
|
||||
private fun getCacheToAnalyzeFiles(files: Collection<JetFile>): KotlinResolveCache {
|
||||
val syntheticFiles = findSyntheticFiles(files)
|
||||
return if (syntheticFiles.isNotEmpty()) {
|
||||
@@ -220,19 +211,6 @@ public class KotlinCacheService(val project: Project) {
|
||||
return if (contextFile is JetCodeFragment) contextFile.getContextFile() else contextFile
|
||||
}
|
||||
|
||||
private fun assertAreInSameModule(elements: Collection<JetElement>) {
|
||||
if (elements.size() <= 1) {
|
||||
return
|
||||
}
|
||||
val thisInfo = elements.first().getModuleInfo()
|
||||
elements.forEach {
|
||||
val extraFileInfo = it.getModuleInfo()
|
||||
assert(extraFileInfo == thisInfo) {
|
||||
"All files under analysis should be in the same module.\nExpected: $thisInfo\nWas:$extraFileInfo"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public fun <T> get(extension: CacheExtension<T>): T {
|
||||
return getGlobalCache(extension.platform)[extension]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user