Skip to content

Commit 1d7c9bd

Browse files
Migrate snippets follow up (#2789)
1. Skip snippets with fields we cannot migrate instead of just discarding those fields 2. Show a untitled markdown document with the migration results 3. Use spoken forms/phrases from Talon ## Checklist - [/] I have added [tests](https://www.cursorless.org/docs/contributing/test-case-recorder/) - [/] I have updated the [docs](https://github.com/cursorless-dev/cursorless/tree/main/docs) and [cheatsheet](https://github.com/cursorless-dev/cursorless/tree/main/cursorless-talon/src/cheatsheet) - [/] I have not broken the cheatsheet --------- Co-authored-by: Phil Cohen <[email protected]>
1 parent 11b94f0 commit 1d7c9bd

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/actions/generate_snippet.py

Lines changed: 10 additions & 1 deletion
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 Context, Module, actions, settings
4+
from talon import Context, Module, actions, registry, settings
55

66
from ..targets.target_types import CursorlessExplicitTarget
77

@@ -20,6 +20,15 @@ def private_cursorless_migrate_snippets():
2020
actions.user.private_cursorless_run_rpc_command_no_wait(
2121
"cursorless.migrateSnippets",
2222
str(get_directory_path()),
23+
{
24+
"insertion": registry.lists[
25+
"user.cursorless_insertion_snippet_no_phrase"
26+
][-1],
27+
"insertionWithPhrase": registry.lists[
28+
"user.cursorless_insertion_snippet_single_phrase"
29+
][-1],
30+
"wrapper": registry.lists["user.cursorless_wrapper_snippet"][-1],
31+
},
2332
)
2433

2534
def private_cursorless_generate_snippet_action(target: CursorlessExplicitTarget): # pyright: ignore [reportGeneralTypeIssues]

0 commit comments

Comments
 (0)