From 6dd5780cbda750f95f198ea854d4e39548af01ef Mon Sep 17 00:00:00 2001 From: Evgeny Gerashchenko Date: Wed, 2 May 2012 20:51:17 +0400 Subject: [PATCH] Replaced plain-text types rendered in IdeErrorMessages with HTML. --- .../plugin/highlighter/IdeErrorMessages.java | 21 +++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/idea/src/org/jetbrains/jet/plugin/highlighter/IdeErrorMessages.java b/idea/src/org/jetbrains/jet/plugin/highlighter/IdeErrorMessages.java index ea0c7300bdb..f8efd55141e 100644 --- a/idea/src/org/jetbrains/jet/plugin/highlighter/IdeErrorMessages.java +++ b/idea/src/org/jetbrains/jet/plugin/highlighter/IdeErrorMessages.java @@ -72,28 +72,37 @@ public class IdeErrorMessages { } }; + private static final Renderer HTML_RENDER_TYPE = new Renderer() { + @NotNull + @Override + public String render(@NotNull JetType type) { + return DescriptorRenderer.HTML.renderType(type); + } + }; + static { - MAP.put(TYPE_MISMATCH, "Type mismatch.
Required:{0}
Found:{1}
", RENDER_TYPE, RENDER_TYPE); + MAP.put(TYPE_MISMATCH, "Type mismatch.
Required:{0}
Found:{1}
", + HTML_RENDER_TYPE, HTML_RENDER_TYPE); MAP.put(ASSIGN_OPERATOR_AMBIGUITY, "Assignment operators ambiguity. All these functions match.
    {0}
", HTML_AMBIGUOUS_CALLS); MAP.put(WRONG_SETTER_PARAMETER_TYPE, "Setter parameter type must be equal to the type of the property." + "" + - "
Expected:{0}
Found:{1}
", RENDER_TYPE, RENDER_TYPE); + "Found:{1}", HTML_RENDER_TYPE, HTML_RENDER_TYPE); MAP.put(WRONG_GETTER_RETURN_TYPE, "Getter return type must be equal to the type of the property." + "" + - "
Expected:{0}
Found:{1}
", RENDER_TYPE, RENDER_TYPE); + "Found:{1}", HTML_RENDER_TYPE, HTML_RENDER_TYPE); MAP.put(ITERATOR_AMBIGUITY, "Method ''iterator()'' is ambiguous for this expression.
    {0}
", HTML_AMBIGUOUS_CALLS); MAP.put(UPPER_BOUND_VIOLATED, "Type argument is not within its bounds." + "" + - "
Expected:{0}
Found:{1}
", RENDER_TYPE, RENDER_TYPE); + "Found:{1}", HTML_RENDER_TYPE, HTML_RENDER_TYPE); MAP.put(TYPE_MISMATCH_IN_FOR_LOOP, "Loop parameter type mismatch." + "" + - "
Iterated values:{0}
Parameter:{1}
", RENDER_TYPE, RENDER_TYPE); + "Parameter:{1}", HTML_RENDER_TYPE, HTML_RENDER_TYPE); MAP.put(RETURN_TYPE_MISMATCH_ON_OVERRIDE, "Return type is ''{0}'', which is not a subtype of overridden
" + "{1}", @@ -118,7 +127,7 @@ public class IdeErrorMessages { MAP.put(RESULT_TYPE_MISMATCH, "Function return type mismatch." + "" + - "
Expected:{1}
Found:{2}
", TO_STRING, RENDER_TYPE, RENDER_TYPE); + "Found:{2}", TO_STRING, HTML_RENDER_TYPE, HTML_RENDER_TYPE); MAP.put(OVERLOAD_RESOLUTION_AMBIGUITY, "Overload resolution ambiguity. All these functions match.
    {0}
", HTML_AMBIGUOUS_CALLS); MAP.put(NONE_APPLICABLE, "None of the following functions can be called with the arguments supplied.
    {0}
",