HtmlChunk (@NotNull PyClass cls, @NotNull TypeEvalContext context) { final HtmlBuilder result = new HtmlBuilder(); final @NlsSafe String name = StringUtil.notNullize(cls.getName(), PyNames.UNNAMED_ELEMENT); result.append(styledSpan("class ", PyHighlighter.PY_KEYWORD)); //NON-NLS result.append(styledSpan(name, PyHighlighter.PY_CLASS_DEFINITION)); final PyExpression[] superClasses = cls.getSuperClassExpressions(); if (superClasses.length > 0) { result.append(styledSpan("(", PyHighlighter.PY_PARENTHS)); boolean isNotFirst = false; for (PyExpression superClass : superClasses) { if (isNotFirst) { result.append(styledSpan(", ", PyHighlighter.PY_COMMA)); } else { isNotFirst = true; } result.append(describeSuperClass(superClass, context)); } result.append(styledSpan(")", PyHighlighter.PY_PARENTHS)); } return result.toFragment(); }