record (@NotNull TextRange range, @NotNull TextAttributesKey attributesKey, boolean hideByTextChange) { /** * @param range new range * @return the same info but with updated range */ public @NotNull HighlightInfo withRange(@NotNull TextRange range) { if (range.getStartOffset() == range().getStartOffset() && range.getEndOffset() == range().getEndOffset()) { return this; } return new HighlightInfo(range, attributesKey, hideByTextChange); } }