@Override
  public void invoke(@NotNull Project project, Editor editor, PsiFile file) throws IncorrectOperationException {
    if (editor == null) return;
    class Replacement {
      final String replacement;
      final int startOffset;
      final int endOffset;

      Replacement(int startOffset, int endOffset, String replacement) {
        this.replacement = replacement;
        this.startOffset = startOffset;
        this.endOffset = endOffset;
      }
    }
    Document document = editor.getDocument();
    Stream.of(fix.replacements)
      .map(it -> {
        int startOffset = calcOffset(document, it.line, it.column);
        int endOffset = calcOffset(document, it.endLine, it.endColumn);
        return new Replacement(startOffset, endOffset, it.replacement);
      })
      // applying replacements from right to left not to break offsets in document
      .sorted(Comparator.comparingInt(it -> -it.endOffset))
      .forEach(it -> document.replaceString(it.startOffset, it.endOffset, it.replacement));
  }
@Override
  public void invoke(@NotNull Project project, Editor editor, PsiFile file)