From 571e71606cabd2dde200c6181f0d4b9241f56082 Mon Sep 17 00:00:00 2001 From: "Pavel V. Talanov" Date: Wed, 17 Dec 2014 20:56:41 +0300 Subject: [PATCH] getModuleInfo for KotlinLightClassForDecompiledDeclaration --- .../org/jetbrains/jet/plugin/caches/resolve/getModuleInfo.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/idea/idea-analysis/src/org/jetbrains/jet/plugin/caches/resolve/getModuleInfo.kt b/idea/idea-analysis/src/org/jetbrains/jet/plugin/caches/resolve/getModuleInfo.kt index d16f62aed03..34e67a28dfd 100644 --- a/idea/idea-analysis/src/org/jetbrains/jet/plugin/caches/resolve/getModuleInfo.kt +++ b/idea/idea-analysis/src/org/jetbrains/jet/plugin/caches/resolve/getModuleInfo.kt @@ -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() -} \ No newline at end of file +}