the-way icon indicating copy to clipboard operation
the-way copied to clipboard

are variables in code snippets supported?

Open Niedzwiedzw opened this issue 3 years ago • 3 comments

I can't find anything in the docs

Niedzwiedzw avatar Dec 05 '21 21:12 Niedzwiedzw

No, only in shell snippets. It would be difficult to support in code snippets I feel, as different languages use different syntax so would need to find something that works across all languages. Do you have an example of this behaviour from another program?

Ninjani avatar Dec 06 '21 15:12 Ninjani

https://youtu.be/xmBovJvQ3KU?t=173 this guy shows how "yasnippet" handles this in emacs. it even supports some logic in templates (simple text transformations)

Niedzwiedzw avatar Dec 06 '21 15:12 Niedzwiedzw

Interesting! I'm wondering how this would work on the command line though, since the-way is editor-agnostic. With single line shell snippets it's easy to display the whole snippet in the terminal and then list the variables to fill, this wouldn't work for the example in the video for instance.

Ninjani avatar Dec 06 '21 15:12 Ninjani