From 2140b9457dd150583ce8fd44df62df11d408fde7 Mon Sep 17 00:00:00 2001 From: Natalia Selezneva Date: Mon, 22 Jan 2018 10:46:59 +0300 Subject: [PATCH] Minor: fix formatting --- .../scratch/compile/KtCompilingExecutor.kt | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/idea/idea-jvm/src/org/jetbrains/kotlin/idea/scratch/compile/KtCompilingExecutor.kt b/idea/idea-jvm/src/org/jetbrains/kotlin/idea/scratch/compile/KtCompilingExecutor.kt index d0fb9cbfa4e..3eef50e6017 100644 --- a/idea/idea-jvm/src/org/jetbrains/kotlin/idea/scratch/compile/KtCompilingExecutor.kt +++ b/idea/idea-jvm/src/org/jetbrains/kotlin/idea/scratch/compile/KtCompilingExecutor.kt @@ -70,25 +70,25 @@ class KtCompilingExecutor(file: ScratchFile) : ScratchExecutor(file) { is KtScratchSourceFileProcessor.Result.Error -> return error(result.message) is KtScratchSourceFileProcessor.Result.OK -> { ApplicationManager.getApplication().invokeLater { - val modifiedScratchSourceFile = - KtPsiFactory(file.psiFile.project).createFileWithLightClassSupport("tmp.kt", result.code, file.psiFile) + val modifiedScratchSourceFile = + KtPsiFactory(file.psiFile.project).createFileWithLightClassSupport("tmp.kt", result.code, file.psiFile) + + try { + val tempDir = compileFileToTempDir(modifiedScratchSourceFile) ?: return@invokeLater try { - val tempDir = compileFileToTempDir(modifiedScratchSourceFile) ?: return@invokeLater - - try { - val handler = CapturingProcessHandler(createCommandLine(module, result.mainClassName, tempDir.path)) - ProcessOutputParser().parse(handler.runProcess()) - } finally { - tempDir.delete() - } - } catch (e: Throwable) { - log.info(result.code, e) - handlers.forEach { it.error(file, e.message ?: "Couldn't compile ${file.psiFile.name}") } + val handler = CapturingProcessHandler(createCommandLine(module, result.mainClassName, tempDir.path)) + ProcessOutputParser().parse(handler.runProcess()) } finally { - handlers.forEach { it.onFinish(file) } + tempDir.delete() } + } catch (e: Throwable) { + log.info(result.code, e) + handlers.forEach { it.error(file, e.message ?: "Couldn't compile ${file.psiFile.name}") } + } finally { + handlers.forEach { it.onFinish(file) } } + } } } }