From 35cb23ffbe7408dc0cca31ca7e6c2dedaac6da72 Mon Sep 17 00:00:00 2001 From: Natalia Ukhorskaya Date: Thu, 20 Aug 2015 13:21:58 +0300 Subject: [PATCH] Debugger: add tmp file to exception report --- .../idea/debugger/evaluate/extractFunctionForDebuggerUtil.kt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/idea/src/org/jetbrains/kotlin/idea/debugger/evaluate/extractFunctionForDebuggerUtil.kt b/idea/src/org/jetbrains/kotlin/idea/debugger/evaluate/extractFunctionForDebuggerUtil.kt index 6a21cb3b2f3..2a163aa5044 100644 --- a/idea/src/org/jetbrains/kotlin/idea/debugger/evaluate/extractFunctionForDebuggerUtil.kt +++ b/idea/src/org/jetbrains/kotlin/idea/debugger/evaluate/extractFunctionForDebuggerUtil.kt @@ -42,13 +42,14 @@ fun getFunctionForExtractedFragment( breakpointLine: Int ): ExtractionResult? { - fun getErrorMessageForExtractFunctionResult(analysisResult: AnalysisResult): String { + fun getErrorMessageForExtractFunctionResult(analysisResult: AnalysisResult, tmpFile: JetFile): String { if (KotlinInternalMode.enabled) { logger.error("Couldn't extract function for debugger:\n" + "FILE NAME: ${breakpointFile.getName()}\n" + "BREAKPOINT LINE: ${breakpointLine}\n" + "CODE FRAGMENT:\n${codeFragment.getText()}\n" + "ERRORS:\n${analysisResult.messages.map { "$it: ${it.renderMessage()}" }.joinToString("\n")}\n" + + "TMPFILE_TEXT:\n${tmpFile.text}\n" + "FILE TEXT: \n${breakpointFile.getText()}\n") } return analysisResult.messages.map { errorMessage -> @@ -91,7 +92,7 @@ fun getFunctionForExtractedFragment( captureLocalFunctions = true) val analysisResult = ExtractionData(tmpFile, newDebugExpressions.toRange(), targetSibling, null, options).performAnalysis() if (analysisResult.status != Status.SUCCESS) { - throw EvaluateExceptionUtil.createEvaluateException(getErrorMessageForExtractFunctionResult(analysisResult)) + throw EvaluateExceptionUtil.createEvaluateException(getErrorMessageForExtractFunctionResult(analysisResult, tmpFile)) } val validationResult = analysisResult.descriptor!!.validate()