pawelgrzybek / snippet-generator

Snippet generator for Visual Studio Code, Sublime Text and Atom
https://snippet-generator.app/
1.74k stars 202 forks source link

Can you add ultisnips? #59

Open rickalex21 opened 3 years ago

rickalex21 commented 3 years ago

I know this would be hard because of the interpolation, but you can just ignore stuff with backticks and anything that has a regex trigger. Just implement the basic stuff like this.

Snippet Generator

substitute($1,'\v^$2','$3','${4:g}')$0

VSCODE

"substitute function": {
  "prefix": "sub",
  "body": [
    "substitute($1,'\\v^$2','$3','${4:g}')$0"
  ],
  "description": "substitute function"
}

Ultisnips

snippet sub "substitute function"
substitute($1,'\v^$2','$3','$4')$0
endsnippet  
UltiRequiem commented 3 years ago

It would be cool. But you can use something like https://github.com/VincentCordobes/convert-snippets

rickalex21 commented 3 years ago

@UltiRequiem Thanks I'll check it out. Actually I was thinking about this issue yesterday. I know this may sound crazy but I was thinking one universal snippet written in yaml or json and parse it to whatever. This would be a great engine for the snippet generator. Kinda like a syntax tree similar to pandoc or tree sitter but that would probably be overkill. For now just sticking to ulitsnips and vscode but I've heard of others like vsnip.