From 4899c556733d805ee04d6a62c54573c73de1d008 Mon Sep 17 00:00:00 2001 From: James Strachan Date: Tue, 29 May 2012 13:31:10 +0100 Subject: [PATCH] added better diagnostic messages --- .../org/jetbrains/jet/lang/diagnostics/DiagnosticHolder.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/diagnostics/DiagnosticHolder.java b/compiler/frontend/src/org/jetbrains/jet/lang/diagnostics/DiagnosticHolder.java index 12b8bb0fcf1..23132b58a23 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/diagnostics/DiagnosticHolder.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/diagnostics/DiagnosticHolder.java @@ -19,6 +19,7 @@ package org.jetbrains.jet.lang.diagnostics; import com.intellij.openapi.util.TextRange; import com.intellij.psi.PsiFile; import org.jetbrains.annotations.NotNull; +import org.jetbrains.jet.lang.diagnostics.rendering.DefaultErrorMessages; import java.util.List; @@ -37,7 +38,8 @@ public interface DiagnosticHolder { if (diagnostic.getSeverity() == Severity.ERROR) { PsiFile psiFile = diagnostic.getPsiFile(); List textRanges = diagnostic.getTextRanges(); - throw new IllegalStateException(diagnostic.getFactory().getName() + " " + psiFile.getName() + " " + DiagnosticUtils.atLocation(psiFile, textRanges.get(0))); + String diagnosticText = DefaultErrorMessages.RENDERER.render(diagnostic); + throw new IllegalStateException(diagnostic.getFactory().getName() + ": " + diagnosticText + " " + psiFile.getName() + " " + DiagnosticUtils.atLocation(psiFile, textRanges.get(0))); } } };