-
-
Notifications
You must be signed in to change notification settings - Fork 89
Open
Labels
enhancementNew feature or requestNew feature or request
Description
The goal
We'd like to enhance the ability for snippets to be used to perform high-level syntactic transformations. To this end we'd like to add the following abilities:
- To indicate that a particular hole can accept a list, and indicate a snippet that should be used to wrap each element of the list before being inserted as into the snippet hole. The two primary applications of this mechanism are Add snippet wrapper support to "repack" action #444 and "bring as" syntax transformation #60
- The ability to indicate that a list valued snippet should join its elements using a particular string
- On insertion, these list-valued holes should support a workflow where you can instantiate the snippet with
n
instances of the hole snippet - These list-valued holes should support a command to insert another instance of the hole
- To indicate a transformation written in typescript that should be applied to the input to a particular hole
Some examples
- Converting an
if
-else
statement to aswitch
statement:"switch repack if state"
"bring air past bat as list"
Examples we'd like to support
- Transform a dictionary to just a list consisting of its keys
- Transform a list to a dictionary
Questions
- Could we get a lot of this stuff for free by switching to a proper templating engine like handlebars?
References
- We should take a look at https://github.com/ethan-leba/tree-edit
AndreasArvidsson
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request