mirror of
https://github.com/Microsoft/vscode
synced 2024-10-12 22:37:41 +00:00
Fixes #107220
This commit is contained in:
parent
5497e60ed2
commit
459543baff
|
@ -782,7 +782,7 @@ export class SnippetString {
|
|||
}
|
||||
|
||||
appendChoice(values: string[], number: number = this._tabstop++): SnippetString {
|
||||
const value = SnippetString._escape(values.toString());
|
||||
const value = values.map(s => s.replace(/\$|}|\\|,/g, '\\$&')).join(',');
|
||||
|
||||
this.value += '${';
|
||||
this.value += number;
|
||||
|
|
|
@ -524,6 +524,10 @@ suite('ExtHostTypes', function () {
|
|||
string.appendChoice(['b', 'a', 'r']);
|
||||
assert.equal(string.value, '${1|b,a,r|}');
|
||||
|
||||
string = new types.SnippetString();
|
||||
string.appendChoice(['b,1', 'a,2', 'r,3']);
|
||||
assert.equal(string.value, '${1|b\\,1,a\\,2,r\\,3|}');
|
||||
|
||||
string = new types.SnippetString();
|
||||
string.appendChoice(['b', 'a', 'r'], 0);
|
||||
assert.equal(string.value, '${0|b,a,r|}');
|
||||
|
|
Loading…
Reference in a new issue