Add builder-method for snippet choice

This commit is contained in:
okmttdhr
2019-11-06 21:29:15 +09:00
parent abacb5fc5c
commit d0bc952781
2 changed files with 13 additions and 0 deletions

View File

@@ -740,6 +740,12 @@ export class SnippetString {
return this;
}
appendChoice(values: string[], number?: number): SnippetString {
this.appendPlaceholder(values.toString(), number)
this.value = this.value.replace(/:/g, '|').replace(/}/g, '|}')
return this;
}
appendVariable(name: string, defaultValue?: string | ((snippet: SnippetString) => any)): SnippetString {
if (typeof defaultValue === 'function') {