Skip to content

Conversation

pokey
Copy link
Member

@pokey pokey commented Oct 26, 2021

See also cursorless-dev/cursorless#304

Still todo:

  • Add docs
  • Check DFA
  • Support "strict" mode for phrasal snippets

@pokey pokey marked this pull request as draft October 26, 2021 11:44
{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]:
Copy link
Member Author

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",
Copy link
Member Author

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}
Copy link
Member Author

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

@pokey pokey mentioned this pull request Dec 6, 2021
@pokey pokey force-pushed the insert-snippet branch 4 times, most recently from edfcdb5 to a91f073 Compare December 17, 2021 13:19
@pokey
Copy link
Member Author

pokey commented Jan 27, 2022

Merged into cursorless-dev/cursorless#304 as part of monorepo

@pokey pokey closed this Jan 27, 2022
@pokey pokey deleted the insert-snippet branch January 27, 2022 13:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant