new Snippet()
When expansion
is a string the default templating language is used. When expansion
is a function, if will be executed and get passed all text following the insert position in the document. The return value of the function will then be used for the expansion, i.e. the function needs to return a string. The replacement of the function with its return value happens when expandAtCursor
of the snippet is executed. The string can contain the normal templating language. This allows to define context-aware snippets.