Html (@NotNull PsiFile file, int offset) { Icon icon = file.getIcon(0); Document document = file.getViewProvider().getDocument(); HtmlBuilder builder = new HtmlBuilder(); builder.append(HtmlChunk.htmlEntity("&rarr;")).append(" "); builder.append(getIconChunk(icon, "icon")); builder.append(file.getName()); if (document.getTextLength() > offset) { int lineNumber = document.getLineNumber(offset); builder.append(AnalysisBundle.message("html.preview.navigate.line")) .append(String.valueOf(lineNumber+1)); } return new Html(builder.wrapWith("p")); }