You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
VSCode has support for snippets that can take a selection. We'd like to use this to enable things such as "if state wrap air", "try state wrap air", etc
Implementation plan
Extension
We propose to add a new action. Check out simple actions like ExtractVariable as a starting point.
The goal
VSCode has support for snippets that can take a selection. We'd like to use this to enable things such as "if state wrap air", "try state wrap air", etc
Implementation plan
Extension
We propose to add a new action. Check out simple actions like
ExtractVariable
as a starting point.The action will call
editor.insertSnippet
.We will keep language-specific snippets for each syntactic scope type, similar to how we do for finding containing scope; see eg https://github.com/pokey/cursorless-vscode/blob/fdebfe93c7871a3e3bf832532f51cf64b8f3c3a8/src/languages/python.ts#L46-L68 Note that the snippet will leverage
TM_SELECTED_TEXT
to refer to where the target that is wrapped will go. We can add tabstops for things like if statement guard, catch block, etcThe action will take an extra arg which is the scopetype to wrap with, eg
ifStatement
. SeeWrap
for example of taking extra argsTalon
Add a new capture like "wrap" that accepts a scope type. Something like
"<scopeType> wrap <target>"
The text was updated successfully, but these errors were encountered: