Skip to content
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

Snippet wrap #94

Merged
merged 18 commits into from
Oct 25, 2021
Merged

Snippet wrap #94

merged 18 commits into from
Oct 25, 2021

Conversation

pokey
Copy link
Member

@pokey pokey commented Oct 15, 2021

@pokey pokey marked this pull request as draft October 15, 2021 22:50
@pokey pokey removed the request for review from AndreasArvidsson October 15, 2021 22:50
@pokey pokey marked this pull request as ready for review October 17, 2021 17:34
src/actions/wrap.py Outdated Show resolved Hide resolved
wrapper_snippets = {
"else state": "cursorless.wrapper.ifElseStatementElseBranch",
"if else": "cursorless.wrapper.ifElseStatementIfBranch",
"if state": "cursorless.wrapper.ifStatement",
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: this term is configured independently from "if state" the scope type. Could be surprising to users but I wasn't sure of the right approach here because there are multiple ways to wrap something with an if statement and I could see people wanting to wrap differently from how they refer to scope type maybe? Also, fwiw, I have configured this to "if" for myself, because I think I can get away with shorter name than when it's used for a scope type

Comment on lines 26 to 29
"else": "ifElseStatement/alternative",
"if else": "ifElseStatement/consequence",
"if": "ifStatement/consequence",
"try": "tryCatchStatement/body",
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 the new <snippet name>/<variable name> syntax here

@pokey pokey merged commit 20471f0 into develop Oct 25, 2021
@pokey pokey deleted the snippet-wrap branch October 25, 2021 12:14
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.

2 participants