I would like to programmatically and dynamically insert a snippet (such as <foo attr="$1">$2</foo>. Checking the docs it seems like the only way to use snippets is in completion item providers (returning a completion item with kind: monaco.languages.CompletionItemKind.Snippet). I've found also a SnippetString interface but the only place where it is supported is, again, in a CompletionItem.
I was also wondering that maybe I could make a CompletionItem to be triggered programmatically but I didn't find a way to do that. I tried with editor.executeEdits() where you can pass identifiers of actions, but I don't see a way to identify a CompletionItem.