4
4
5
5
from ..targets .target_types import (
6
6
CursorlessDestination ,
7
+ CursorlessExplicitTarget ,
7
8
CursorlessTarget ,
8
9
ImplicitDestination ,
9
10
)
48
49
"custom_action" ,
49
50
]
50
51
51
- callback_actions : dict [str , Callable [[CursorlessTarget ], None ]] = {
52
+ callback_actions : dict [str , Callable [[CursorlessExplicitTarget ], None ]] = {
52
53
"nextHomophone" : cursorless_homophones_action ,
53
54
}
54
55
@@ -88,7 +89,7 @@ def cursorless_action_or_ide_command(m) -> dict[str, str]:
88
89
89
90
@mod .action_class
90
91
class Actions :
91
- def cursorless_command (action_name : str , target : CursorlessTarget ):
92
+ def cursorless_command (action_name : str , target : CursorlessExplicitTarget ): # pyright: ignore [reportGeneralTypeIssues]
92
93
"""Perform cursorless command on target"""
93
94
if action_name in callback_actions :
94
95
callback_actions [action_name ](target )
@@ -107,28 +108,30 @@ def cursorless_command(action_name: str, target: CursorlessTarget):
107
108
action = {"name" : action_name , "target" : target }
108
109
actions .user .private_cursorless_command_and_wait (action )
109
110
110
- def cursorless_vscode_command (command_id : str , target : CursorlessTarget ):
111
+ def cursorless_vscode_command (command_id : str , target : CursorlessTarget ): # pyright: ignore [reportGeneralTypeIssues]
111
112
"""
112
113
Perform vscode command on cursorless target
113
114
114
115
Deprecated: prefer `cursorless_ide_command`
115
116
"""
116
117
return actions .user .cursorless_ide_command (command_id , target )
117
118
118
- def cursorless_ide_command (command_id : str , target : CursorlessTarget ):
119
+ def cursorless_ide_command (command_id : str , target : CursorlessTarget ): # pyright: ignore [reportGeneralTypeIssues]
119
120
"""Perform ide command on cursorless target"""
120
121
return cursorless_execute_command_action (command_id , target )
121
122
122
123
def cursorless_insert (
123
- destination : CursorlessDestination , text : Union [str , list [str ]]
124
+ destination : CursorlessDestination , # pyright: ignore [reportGeneralTypeIssues]
125
+ text : Union [str , list [str ]],
124
126
):
125
127
"""Perform text insertion on Cursorless destination"""
126
128
if isinstance (text , str ):
127
129
text = [text ]
128
130
cursorless_replace_action (destination , text )
129
131
130
132
def private_cursorless_action_or_ide_command (
131
- instruction : dict [str , str ], target : CursorlessTarget
133
+ instruction : dict [str , str ], # pyright: ignore [reportGeneralTypeIssues]
134
+ target : CursorlessTarget ,
132
135
):
133
136
"""Perform cursorless action or ide command on target (internal use only)"""
134
137
type = instruction ["type" ]
0 commit comments