Skip to content
Advertisement

Execute function in vscode snippet

Is it possible to run a function during expansion of snippet?

javascript.json – vscode snippet file:

JavaScript

index.js – project file:

JavaScript

The obvious reason might be snippet is a json file, it’s not a javascript file so it can’t run code, just show syntax as it with cursor positions $1, $2 etc.

Or is it possible through a vscode plugin?

Advertisement

Answer

Using Hypersnips vscode extension as suggested by rioV8, I’ve a working hsnips which might help you.

all.hsnips OR javascript.hsnips:

JavaScript
User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement