HtmlChunk (@Nullable MethodCandidateInfo info, @NotNull PsiSubstitutor substitutor, PsiParameter @NotNull [] parameters, PsiExpression[] expressions) { String greyedColor = ColorUtil.toHtmlColor(UIUtil.getContextHelpForeground()); HtmlBuilder table = new HtmlBuilder(); HtmlChunk.Element td = HtmlChunk.tag("td"); HtmlChunk requiredHeader = td.style("color: " + greyedColor + "; padding-left: 16px; padding-right: 24px;") .addText(JavaAnalysisBundle.message("required.type")); HtmlChunk providedHeader = td.style("color: " + greyedColor + "; padding-right: 28px;") .addText(JavaAnalysisBundle.message("provided.type")); table.append(HtmlChunk.tag("tr").children(td, requiredHeader, providedHeader)); String parameterNameStyle = String.format("color: %s; font-size:%dpt; padding:1px 4px 1px 4px;", greyedColor, StartupUiUtil.getLabelFont().getSize() - (SystemInfo.isWindows ? 0 : 1)); Color paramBgColor = EditorColorsUtil.getGlobalOrDefaultColorScheme() .getAttributes(DefaultLanguageHighlighterColors.INLINE_PARAMETER_HINT) .getBackgroundColor(); if (paramBgColor != null) { parameterNameStyle += "background-color: " + ColorUtil.toHtmlColor(paramBgColor) + ";"; } boolean varargAdded = false; for (int i = 0; i < Math.max(parameters.length, expressions.length); i++) { boolean varargs = info != null && info.isVarargs(); if (assignmentCompatible(i, parameters, expressions, substitutor, varargs)) continue; PsiParameter parameter = null; if (i < parameters.length) { parameter = parameters[i]; varargAdded = parameter.isVarArgs(); } else if (!varargAdded) { parameter = parameters[parameters.length - 1]; varargAdded = true; } PsiType parameterType = substitutor.substitute(PsiTypesUtil.getParameterType(parameters, i, varargs)); PsiExpression expression = i < expressions.length ? expressions[i] : null; boolean showShortType = HighlightUtil.showShortType(parameterType, expression != null ? expression.getType() : null); HtmlChunk.Element nameCell = td; HtmlChunk.Element typeCell = td.style("padding-left: 16px; padding-right: 24px;"); if (parameter != null) { nameCell = nameCell.child(td.style(parameterNameStyle).addText(parameter.getName() + ":") .wrapWith("tr").wrapWith("table")); typeCell = typeCell.child(HighlightUtil.redIfNotMatch(substitutor.substitute(parameter.getType()), true, showShortType)); } HtmlChunk.Element mismatchedCell = td.style("padding-right: 28px;"); if (expression != null) { mismatchedCell = mismatchedCell.child(mismatchedExpressionType(parameterType, expression)); } table.append(HtmlChunk.tag("tr").children(nameCell, typeCell, mismatchedCell)); } return table.wrapWith("table"); }