int (final int offsetInDecoded, final @NotNull TextRange rangeInsideHost) { TextRange valueTextRange = myXmlAttribute.getValueTextRange(); int displayStart = myXmlAttribute.physicalToDisplay(rangeInsideHost.getStartOffset()-valueTextRange.getStartOffset()); int dp = myXmlAttribute.displayToPhysical(offsetInDecoded + displayStart); if (dp == -1) return -1; return dp + valueTextRange.getStartOffset(); }