Skip to content

Commit d18bce3

Browse files
Implemented strongly typed internal function to run Cursorless commands (#1113)
* Implemented strongly typed internal function to run Cursorless commands * Refactor * Clean up * clean up * Use import type * Restore backwards compatibility tests * Rename Co-authored-by: Pokey Rule <[email protected]>
1 parent 924ef9f commit d18bce3

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/command.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
mod = Module()
1313

14+
CURSORLESS_COMMAND_ID = "cursorless.command"
1415
last_phrase = None
1516

1617

@@ -72,7 +73,7 @@ def cursorless_single_target_command_get(
7273
):
7374
"""Execute single-target cursorless command and return result"""
7475
return run_rpc_command_get(
75-
"cursorless.command",
76+
CURSORLESS_COMMAND_ID,
7677
construct_cursorless_command_argument(
7778
action=action,
7879
targets=[target],
@@ -100,7 +101,7 @@ def cursorless_multiple_target_command(
100101
):
101102
"""Execute multi-target cursorless command"""
102103
run_rpc_command_and_wait(
103-
"cursorless.command",
104+
CURSORLESS_COMMAND_ID,
104105
construct_cursorless_command_argument(
105106
action=action,
106107
targets=targets,
@@ -117,7 +118,7 @@ def cursorless_multiple_target_command_no_wait(
117118
):
118119
"""Execute multi-target cursorless command"""
119120
run_rpc_command_no_wait(
120-
"cursorless.command",
121+
CURSORLESS_COMMAND_ID,
121122
construct_cursorless_command_argument(
122123
action=action,
123124
targets=targets,

0 commit comments

Comments
 (0)