getModuleInfo for KotlinLightClassForDecompiledDeclaration

This commit is contained in:
Pavel V. Talanov
2014-12-17 20:56:41 +03:00
parent f72f67ed97
commit 571e71606c
@@ -100,10 +100,13 @@ private fun getModuleInfoByVirtualFile(project: Project, virtualFile: VirtualFil
}
private fun KotlinLightElement<*, *>.getModuleInfoForLightElement(): IdeaModuleInfo {
if (this is KotlinLightClassForDecompiledDeclaration) {
return getModuleInfoByVirtualFile(getProject(), getContainingFile().getVirtualFile(), false)
}
val element = origin ?: when (this) {
is FakeLightClassForFileOfPackage -> this.getContainingFile()!!
is KotlinLightClassForPackage -> this.getFiles().first()
else -> throw IllegalStateException("Unknown light class without origin is referenced by IDE lazy resolve: $javaClass")
}
return element.getModuleInfo()
}
}