Use older utility to fix compilation for as31 and 173 branches

This commit is contained in:
Pavel V. Talanov
2018-08-16 16:33:49 +02:00
parent ac65aebb19
commit 42f39a3ea4
@@ -187,7 +187,12 @@ private fun StringBuilder.appendElement(element: PsiElement) {
if (moduleInfo != null) {
info("moduleInfo.platform", moduleInfo.platform?.toString())
}
info("ideaModule", ifIndexReady { ModuleUtil.findModuleForFile(element.containingFile)?.name ?: "null" } ?: "<index not ready>")
val virtualFile = element.containingFile?.virtualFile
if (virtualFile != null) {
info(
"ideaModule",
ifIndexReady { ModuleUtil.findModuleForFile(virtualFile, element.project)?.name ?: "null" } ?: "<index not ready>")
}
}
private fun <T : Any> ifIndexReady(body: () -> T): T? = try {