def METHOD_NAME(
    completion_context: ICompletionContext,
    select_range: Range,
) -> Iterable[CodeActionTypedDict]:
    doc: IRobotDocument = completion_context.doc
    line = select_range.start.line
    col = select_range.start.character
    endline = select_range.end.line
    endcol = select_range.end.character
    if line == endline and col != endcol:
        contents = doc.get_range(line, col, endline, endcol)
        token_info = completion_context.get_current_token()
        if token_info:
            curr_node_line_0_based = token_info.node.lineno - 1
            from robotframework_ls.robot_config import get_arguments_separator
            from robotframework_ls.robot_config import (
                create_convert_keyword_format_func,
            )
            import re
            format_name = create_convert_keyword_format_func(completion_context.config)
            set_var_name = format_name("Set Variable")
            indent = "    "
            line_contents = completion_context.doc.get_line(curr_node_line_0_based)
            found = re.match("[\s]+", line_contents)
            if found:
                indent = found.group()
            sep = get_arguments_separator(completion_context)
            tok: IRobotToken = token_info.token
            changes: List[TextEditTypedDict] = [
                {
                    "range": {
                        "start": {"line": curr_node_line_0_based, "character": 0},
                        "end": {"line": curr_node_line_0_based, "character": 0},
                    },
                    "newText": "%s${${0:variable}}=%s%s%s%s\n"
                    % (indent, sep, set_var_name, sep, contents),
                },
                {
                    "range": {
                        "start": {"line": tok.lineno - 1, "character": col},
                        "end": {
                            "line": tok.lineno - 1,
                            "character": endcol,
                        },
                    },
                    "newText": "${${0:variable}}",
                },
            ]
            yield wrap_edits_in_snippet(
                completion_context,
                "Extract local variable",
                changes,
                "refactor.extract",
            )