snippet

Parse a snippet template and return a function that, when called, applies the snippet at the given range in the editor.

Template syntax, as upstream: ${name} (or #{name}) marks a field the user can tab through, with name as its default text; ${} is an empty field. Fields are visited in textual order unless numbered — ${1} or ${1:default}. \{ and \} are literal braces. Each new line takes the indentation of the line the snippet starts on, plus one indent unit per leading tab.

A field that appears more than once is a tab stop at its first occurrence only; its other occurrences are inserted as plain text.