@Override
    public void documentChanged(@NotNull DocumentEvent event) {
      if (myCaretVirtualEnd > myCaretOffset) {
        myCaretOffset = updateOffset(event, myCaretOffset, true);
        myCaretVirtualEnd = updateOffset(event, myCaretVirtualEnd, false);
      } else {
        myCaretOffset = myCaretVirtualEnd = updateOffset(event, myCaretOffset, false);
      }
      mySelection = updateRange(event, mySelection);
      myHighlightInfos.replaceAll(info -> info.withRange(updateRange(event, info.range())));
      myTemplateFields.replaceAll(info -> info.withRange(updateRange(event, info.range())));
      myTrackedDeclarations.replaceAll(range -> range.withNewRange(updateRange(event, range.newRange())));
      if (myRenameSymbol != null) {
        ModStartRename.RenameSymbolRange renameSymbolRange = myRenameSymbol.symbolRange();

        myRenameSymbol = myRenameSymbol.withRange(updateRange(event, renameSymbolRange));
      }
    }
@Override
    public void documentChanged(@NotNull DocumentEvent event)