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