mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
incompatible types tooltip: append reason when provided for single arg mismatch
GitOrigin-RevId: 7be63b20a982cd0fb365e022278df6a5c02153f3
This commit is contained in:
committed by
intellij-monorepo-bot
parent
a5ac4d9fbd
commit
0edaac849d
+6
-1
@@ -527,9 +527,14 @@ public class HighlightMethodUtil {
|
||||
boolean varargs = candidateInfo.getApplicabilityLevel() == MethodCandidateInfo.ApplicabilityLevel.VARARGS;
|
||||
int idx = ArrayUtil.find(expressions, wrongArg);
|
||||
PsiType paramType = candidateInfo.getSubstitutor().substitute(PsiTypesUtil.getParameterType(parameters, idx, varargs));
|
||||
String errorMessage = candidateInfo.getInferenceErrorMessage();
|
||||
String reason = errorMessage != null ? "<table><tr><td style='padding-left: 4px; padding-top: 10;'>" +
|
||||
"reason: " + XmlStringUtil.escapeString(errorMessage).replaceAll("\n", "<br/>") +
|
||||
"</td></tr></table>"
|
||||
: "";
|
||||
return HighlightUtil.createIncompatibleTypesTooltip(paramType, argType,
|
||||
(lRawType, lTypeArguments, rRawType, rTypeArguments) ->
|
||||
JavaErrorMessages.message("incompatible.types.html.tooltip", lRawType, lTypeArguments, rRawType, rTypeArguments, "", "#" + ColorUtil.toHex(UIUtil.getContextHelpForeground())));
|
||||
JavaErrorMessages.message("incompatible.types.html.tooltip", lRawType, lTypeArguments, rRawType, rTypeArguments, reason, "#" + ColorUtil.toHex(UIUtil.getContextHelpForeground())));
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user