Skip to content

Commit 226b432

Browse files
Remove deprecated Cursorless snippets (#3151)
1 parent f9d1038 commit 226b432

File tree

6 files changed

+1
-136
lines changed

6 files changed

+1
-136
lines changed

src/actions/generate_snippet.py

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import glob
22
from pathlib import Path
33

4-
from talon import Module, actions, registry, settings
4+
from talon import Module, actions, settings
55

66
from ..targets.target_types import CursorlessExplicitTarget
77

@@ -10,22 +10,6 @@
1010

1111
@mod.action_class
1212
class Actions:
13-
def private_cursorless_migrate_snippets():
14-
"""Migrate snippets from Cursorless to community format"""
15-
actions.user.private_cursorless_run_rpc_command_no_wait(
16-
"cursorless.migrateSnippets",
17-
str(get_directory_path()),
18-
{
19-
"insertion": registry.lists[
20-
"user.cursorless_insertion_snippet_no_phrase"
21-
][-1],
22-
"insertionWithPhrase": registry.lists[
23-
"user.cursorless_insertion_snippet_single_phrase"
24-
][-1],
25-
"wrapper": registry.lists["user.cursorless_wrapper_snippet"][-1],
26-
},
27-
)
28-
2913
def private_cursorless_generate_snippet_action(target: CursorlessExplicitTarget): # pyright: ignore [reportGeneralTypeIssues]
3014
"""Generate a snippet from the given target"""
3115
actions.user.private_cursorless_command_no_wait(

src/actions/wrap.py

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -26,35 +26,3 @@ def private_cursorless_wrap_with_paired_delimiter(
2626
"target": target,
2727
}
2828
)
29-
30-
def private_cursorless_wrap_with_snippet(
31-
action_name: str, # pyright: ignore [reportGeneralTypeIssues]
32-
target: CursorlessTarget,
33-
snippet_location: str,
34-
):
35-
"""Execute Cursorless wrap with snippet action"""
36-
if action_name == "wrapWithPairedDelimiter":
37-
action_name = "wrapWithSnippet"
38-
elif action_name == "rewrap":
39-
raise Exception("Rewrapping with snippet not supported")
40-
41-
snippet_name, variable_name = parse_snippet_location(snippet_location)
42-
43-
actions.user.private_cursorless_command_and_wait(
44-
{
45-
"name": action_name,
46-
"snippetDescription": {
47-
"type": "named",
48-
"name": snippet_name,
49-
"variableName": variable_name,
50-
},
51-
"target": target,
52-
}
53-
)
54-
55-
56-
def parse_snippet_location(snippet_location: str) -> tuple[str, str]:
57-
[snippet_name, variable_name] = snippet_location.split(".")
58-
if snippet_name is None or variable_name is None:
59-
raise Exception("Snippet location missing '.'")
60-
return (snippet_name, variable_name)

src/cursorless.talon

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,3 @@ tutorial resume: user.private_cursorless_tutorial_resume()
5353
tutorial (list | close): user.private_cursorless_tutorial_list()
5454
tutorial <number_small>:
5555
user.private_cursorless_tutorial_start_by_number(number_small)
56-
57-
{user.cursorless_homophone} migrate snippets:
58-
user.private_cursorless_migrate_snippets()

src/snippets/snippets_deprecated.py

Lines changed: 0 additions & 54 deletions
This file was deleted.

src/spoken_forms.json

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -235,12 +235,6 @@
235235
"from": "experimental.setInstanceReference"
236236
}
237237
},
238-
"experimental/wrapper_snippets.csv": {},
239-
"experimental/insertion_snippets.csv": {},
240-
"experimental/insertion_snippets_single_phrase.csv": {},
241-
"experimental/miscellaneous.csv": {
242-
"phrase_terminator": { "over": "phraseTerminator" }
243-
},
244238
"experimental/actions_custom.csv": {},
245239
"experimental/regex_scope_types.csv": {},
246240
"hat_styles.csv": {

src/spoken_forms.py

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -165,30 +165,6 @@ def handle_new_values(csv_name: str, values: list[SpokenFormEntry]):
165165
],
166166
default_list_name="scope_type",
167167
),
168-
# DEPRECATED @ 2025-02-01
169-
handle_csv(
170-
"experimental/wrapper_snippets.csv",
171-
deprecated=True,
172-
allow_unknown_values=True,
173-
default_list_name="wrapper_snippet",
174-
),
175-
handle_csv(
176-
"experimental/insertion_snippets.csv",
177-
deprecated=True,
178-
allow_unknown_values=True,
179-
default_list_name="insertion_snippet_no_phrase",
180-
),
181-
handle_csv(
182-
"experimental/insertion_snippets_single_phrase.csv",
183-
deprecated=True,
184-
allow_unknown_values=True,
185-
default_list_name="insertion_snippet_single_phrase",
186-
),
187-
handle_csv(
188-
"experimental/miscellaneous.csv",
189-
deprecated=True,
190-
),
191-
# ---
192168
handle_csv(
193169
"experimental/actions_custom.csv",
194170
headers=[SPOKEN_FORM_HEADER, "VSCode command"],

0 commit comments

Comments
 (0)