File tree 1 file changed +8
-3
lines changed
1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -93,15 +93,15 @@ def insert_named_snippet(
93
93
def insert_custom_snippet (
94
94
body : str ,
95
95
destination : CursorlessDestination ,
96
- scope_types : Optional [list [str ]] = None ,
96
+ scope_types : Optional [list [dict ]] = None ,
97
97
):
98
98
snippet = {
99
99
"type" : "custom" ,
100
100
"body" : body ,
101
101
}
102
102
103
103
if scope_types :
104
- snippet ["scopeTypes" ] = [{ "type" : scope_type } for scope_type in scope_types ]
104
+ snippet ["scopeTypes" ] = scope_types
105
105
106
106
insert_snippet (snippet , destination )
107
107
@@ -142,7 +142,12 @@ def cursorless_insert_snippet(
142
142
if isinstance (scope_type , str ):
143
143
scope_type = [scope_type ]
144
144
145
- insert_custom_snippet (body , destination , scope_type )
145
+ if scope_type is not None :
146
+ scope_types = [{"type" : st } for st in scope_type ]
147
+ else :
148
+ scope_types = None
149
+
150
+ insert_custom_snippet (body , destination , scope_types )
146
151
147
152
def cursorless_wrap_with_snippet_by_name (
148
153
name : str , variable_name : str , target : CursorlessTarget
You can’t perform that action at this time.
0 commit comments