private static @NotNull TextRange logicalPairToTextRange(@NotNull Editor editor,
                                                           @NotNull Pair<LogicalPosition, LogicalPosition> logicalPair) {
    return TextRange.create(editor.logicalPositionToOffset(logicalPair.first),
                            editor.logicalPositionToOffset(logicalPair.second));
  }
private static @NotNull TextRange logicalPairToTextRange(@NotNull Editor editor,
                                                           @NotNull Pair<LogicalPosition, LogicalPosition> logicalPair)