Rendering nice unicode arrow for function types in UI.
This commit is contained in:
@@ -116,6 +116,17 @@ public class DescriptorRendererImpl implements DescriptorRenderer {
|
||||
return escape("<");
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private String arrow() {
|
||||
switch (textFormat) {
|
||||
case PLAIN:
|
||||
return escape("->");
|
||||
case HTML:
|
||||
return "→";
|
||||
}
|
||||
throw new IllegalStateException("Unexpected textFormat: " + textFormat);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private String renderMessage(@NotNull String message) {
|
||||
switch (textFormat) {
|
||||
@@ -188,7 +199,7 @@ public class DescriptorRendererImpl implements DescriptorRenderer {
|
||||
return "???";
|
||||
}
|
||||
else if (type == CallResolverUtil.PLACEHOLDER_FUNCTION_TYPE) {
|
||||
return "??? -> ???";
|
||||
return "??? " + arrow() + " ???";
|
||||
}
|
||||
else if (ErrorUtils.isErrorType(type)) {
|
||||
return type.toString();
|
||||
@@ -258,7 +269,7 @@ public class DescriptorRendererImpl implements DescriptorRenderer {
|
||||
|
||||
sb.append("(");
|
||||
appendTypeProjections(KotlinBuiltIns.getInstance().getParameterTypeProjectionsFromFunctionType(type), sb);
|
||||
sb.append(") -> ");
|
||||
sb.append(") " + arrow() + " ");
|
||||
sb.append(renderType(KotlinBuiltIns.getInstance().getReturnTypeFromFunctionType(type)));
|
||||
|
||||
if (type.isNullable()) {
|
||||
|
||||
@@ -36,7 +36,7 @@ cannot be applied to</td>
|
||||
<td align="right" style="white-space:nowrap;">
|
||||
<font color=red>
|
||||
<b>
|
||||
??? -> ???</b>
|
||||
??? → ???</b>
|
||||
</font>
|
||||
</td>
|
||||
<td style="white-space:nowrap;">
|
||||
|
||||
@@ -36,7 +36,7 @@ cannot be applied to</td>
|
||||
<td align="right" style="white-space:nowrap;">
|
||||
<font color=red>
|
||||
<b>
|
||||
(???) -> ???</b>
|
||||
(???) → ???</b>
|
||||
</font>
|
||||
</td>
|
||||
<td style="white-space:nowrap;">
|
||||
|
||||
@@ -36,7 +36,7 @@ cannot be applied to</td>
|
||||
<td align="right" style="white-space:nowrap;">
|
||||
<font color=red>
|
||||
<b>
|
||||
(jet.Int) -> ???</b>
|
||||
(jet.Int) → ???</b>
|
||||
</font>
|
||||
</td>
|
||||
<td style="white-space:nowrap;">
|
||||
|
||||
Reference in New Issue
Block a user