Merge pull request #84048 from okmttdhr/snippet-choice-builder-method

Add builder-method for snippet choice
This commit is contained in:
Johannes Rieken
2019-11-13 16:30:10 +01:00
committed by GitHub
3 changed files with 42 additions and 0 deletions

View File

@@ -740,6 +740,18 @@ export class SnippetString {
return this;
}
appendChoice(values: string[], number: number = this._tabstop++): SnippetString {
const value = SnippetString._escape(values.toString());
this.value += '${';
this.value += number;
this.value += '|';
this.value += value;
this.value += '|}';
return this;
}
appendVariable(name: string, defaultValue?: string | ((snippet: SnippetString) => any)): SnippetString {
if (typeof defaultValue === 'function') {