-
-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support insertSnippet action #96
Conversation
{user.cursorless_insert_snippet_action} <user.cursorless_insertion_snippet> <user.cursorless_target>: | ||
user.cursorless_single_target_command(cursorless_insert_snippet_action, cursorless_target, cursorless_insertion_snippet) | ||
|
||
{user.cursorless_insert_snippet_action} {user.cursorless_insertion_snippet_single_phrase} <user.text> [halt]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
users may want to anchor this. I wonder if we should let them define it themselves? Use a tag?
# NOTE: Please do not change these dicts. Use the CSVs for customization. | ||
# See https://github.com/pokey/cursorless-talon/blob/main/docs/customization.md | ||
insertion_snippets_single_phrase = { | ||
"funk": "functionDeclaration.name", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not in love with using this syntax here, but after the .
indicates which variable will get the phrase
"""Perform cursorless wrap action""" | ||
snippet_name, snippet_variable = snippet_description.split(".") | ||
actions.user.cursorless_this_command( | ||
action, snippet_name, {snippet_variable: text} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: text is formatted on VSCode side
Release 0.23.0
edfcdb5
to
a91f073
Compare
a91f073
to
dfac44c
Compare
Merged into cursorless-dev/cursorless#304 as part of monorepo |
See also cursorless-dev/cursorless#304
Still todo: