Gruntfuggly / auto-snippet

A vscode extension to automatically insert a predefined snippet when a file is created, or an empty file is opened.
Other
14 stars 1 forks source link

add support to run a command after snippet is added #1

Closed ctf0 closed 5 years ago

ctf0 commented 5 years ago

is that possible ?

Gruntfuggly commented 5 years ago

What sort of command - do you mean a vscode command?

Running a command without arguments is possible. Can you give me an example so I have the right idea.

ctf0 commented 5 years ago

for example using php, i was thinking of running a command to generate the namespace to the file once its created

Gruntfuggly commented 5 years ago

OK - shouldn't be a problem.

Gruntfuggly commented 5 years ago

Implemented in the latest version. There is an example of usage in the README.md.

ctf0 commented 5 years ago

awesome, many thanx

ctf0 commented 5 years ago

btw instead of using , for commands, we can make it as an array which is easier to read, i can make a PR for it you want.

Gruntfuggly commented 5 years ago

I was going to make it an array, but I changed it to a string so that it could be modified through the settings GUI. But at that point, it applied to all the globs. I then moved the setting so that it could be specified for each glob, so it can't be modified through the GUI now.

I'll change it to an array later today.

Gruntfuggly commented 5 years ago

Latest version uses an array instead of a comma separated list.