Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions changelog/2026-02-removeCursorlessSnippets.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
tags: [enhancement]
pullRequest: 3151
---

- Remove deprecated Cursorless snippets. Cursorless now fully relies on Talon community for snippet definitions.
18 changes: 1 addition & 17 deletions cursorless-talon/src/actions/generate_snippet.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import glob
from pathlib import Path

from talon import Module, actions, registry, settings
from talon import Module, actions, settings

from ..targets.target_types import CursorlessExplicitTarget

Expand All @@ -10,22 +10,6 @@

@mod.action_class
class Actions:
def private_cursorless_migrate_snippets():
"""Migrate snippets from Cursorless to community format"""
actions.user.private_cursorless_run_rpc_command_no_wait(
"cursorless.migrateSnippets",
str(get_directory_path()),
{
"insertion": registry.lists[
"user.cursorless_insertion_snippet_no_phrase"
][-1],
"insertionWithPhrase": registry.lists[
"user.cursorless_insertion_snippet_single_phrase"
][-1],
"wrapper": registry.lists["user.cursorless_wrapper_snippet"][-1],
},
)

def private_cursorless_generate_snippet_action(target: CursorlessExplicitTarget): # pyright: ignore [reportGeneralTypeIssues]
"""Generate a snippet from the given target"""
actions.user.private_cursorless_command_no_wait(
Expand Down
32 changes: 0 additions & 32 deletions cursorless-talon/src/actions/wrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,35 +26,3 @@ def private_cursorless_wrap_with_paired_delimiter(
"target": target,
}
)

def private_cursorless_wrap_with_snippet(
action_name: str, # pyright: ignore [reportGeneralTypeIssues]
target: CursorlessTarget,
snippet_location: str,
):
"""Execute Cursorless wrap with snippet action"""
if action_name == "wrapWithPairedDelimiter":
action_name = "wrapWithSnippet"
elif action_name == "rewrap":
raise Exception("Rewrapping with snippet not supported")

snippet_name, variable_name = parse_snippet_location(snippet_location)

actions.user.private_cursorless_command_and_wait(
{
"name": action_name,
"snippetDescription": {
"type": "named",
"name": snippet_name,
"variableName": variable_name,
},
"target": target,
}
)


def parse_snippet_location(snippet_location: str) -> tuple[str, str]:
[snippet_name, variable_name] = snippet_location.split(".")
if snippet_name is None or variable_name is None:
raise Exception("Snippet location missing '.'")
return (snippet_name, variable_name)
3 changes: 0 additions & 3 deletions cursorless-talon/src/cursorless.talon
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,3 @@ tutorial resume: user.private_cursorless_tutorial_resume()
tutorial (list | close): user.private_cursorless_tutorial_list()
tutorial <number_small>:
user.private_cursorless_tutorial_start_by_number(number_small)

{user.cursorless_homophone} migrate snippets:
user.private_cursorless_migrate_snippets()
54 changes: 0 additions & 54 deletions cursorless-talon/src/snippets/snippets_deprecated.py

This file was deleted.

6 changes: 0 additions & 6 deletions cursorless-talon/src/spoken_forms.json
Original file line number Diff line number Diff line change
Expand Up @@ -235,12 +235,6 @@
"from": "experimental.setInstanceReference"
}
},
"experimental/wrapper_snippets.csv": {},
"experimental/insertion_snippets.csv": {},
"experimental/insertion_snippets_single_phrase.csv": {},
"experimental/miscellaneous.csv": {
"phrase_terminator": { "over": "phraseTerminator" }
},
"experimental/actions_custom.csv": {},
"experimental/regex_scope_types.csv": {},
"hat_styles.csv": {
Expand Down
24 changes: 0 additions & 24 deletions cursorless-talon/src/spoken_forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,30 +165,6 @@ def handle_new_values(csv_name: str, values: list[SpokenFormEntry]):
],
default_list_name="scope_type",
),
# DEPRECATED @ 2025-02-01
handle_csv(
"experimental/wrapper_snippets.csv",
deprecated=True,
allow_unknown_values=True,
default_list_name="wrapper_snippet",
),
handle_csv(
"experimental/insertion_snippets.csv",
deprecated=True,
allow_unknown_values=True,
default_list_name="insertion_snippet_no_phrase",
),
handle_csv(
"experimental/insertion_snippets_single_phrase.csv",
deprecated=True,
allow_unknown_values=True,
default_list_name="insertion_snippet_single_phrase",
),
handle_csv(
"experimental/miscellaneous.csv",
deprecated=True,
),
# ---
handle_csv(
"experimental/actions_custom.csv",
headers=[SPOKEN_FORM_HEADER, "VSCode command"],
Expand Down

This file was deleted.

This file was deleted.

30 changes: 0 additions & 30 deletions data/fixtures/cursorless-snippets/link.cursorless-snippets

This file was deleted.

Loading
Loading