boolean (final @NotNull TextRange rangeInsideHost, @NotNull StringBuilder outChars) { String displayValue = myXmlAttribute.getDisplayValue(); if (displayValue == null) { return true; } TextRange valueTextRange = myXmlAttribute.getValueTextRange(); int startInDecoded = myXmlAttribute.physicalToDisplay(rangeInsideHost.getStartOffset() - valueTextRange.getStartOffset()); int endInDecoded = myXmlAttribute.physicalToDisplay(rangeInsideHost.getEndOffset() - valueTextRange.getStartOffset()); startInDecoded = Math.max(0, Math.min(startInDecoded, displayValue.length())); endInDecoded = Math.max(0, Math.min(endInDecoded, displayValue.length())); if (startInDecoded > endInDecoded) endInDecoded = startInDecoded; outChars.append(displayValue, startInDecoded, endInDecoded); return true; }