HtmlChunk (@NotNull PyTargetExpression target, @NotNull TypeEvalContext context) { final HtmlBuilder result = new HtmlBuilder(); result.append(styledSpan(StringUtil.notNullize(target.getName()), DefaultLanguageHighlighterColors.IDENTIFIER)); result.append(styledSpan(": ", PyHighlighter.PY_OPERATION_SIGN)); result.append(styledSpan(formatTypeWithLinks(context.getType(target), target, target, context), PyHighlighter.PY_ANNOTATION)); // Can return not physical elements such as foo()[0] for assignments like x, _ = foo() final PyExpression value = target.findAssignedValue(); if (value != null) { result.append(styledSpan(" = ", PyHighlighter.PY_OPERATION_SIGN)); final String initializerText = value.getText(); final int index = value.getText().indexOf("\n"); if (index < 0) { result.append(highlightExpressionText(initializerText, value)); } else { result.append(highlightExpressionText(initializerText.substring(0, index), value)); result.append(styledSpan("...", PyHighlighter.PY_DOT)); } } return result.toFragment(); }