mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-08 17:19:48 +01:00
fix #37562
This commit is contained in:
@@ -861,6 +861,14 @@ export class SnippetParser {
|
||||
if (this._accept(TokenType.Forwardslash)) {
|
||||
break;
|
||||
}
|
||||
|
||||
let escaped: string;
|
||||
if (escaped = this._accept(TokenType.Backslash, true)) {
|
||||
escaped = this._accept(TokenType.Forwardslash, true) || escaped;
|
||||
transform.appendChild(new Text(escaped));
|
||||
continue;
|
||||
}
|
||||
|
||||
if (this._parseFormatString(transform) || this._parseAnything(transform)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -244,6 +244,12 @@ suite('SnippetParser', () => {
|
||||
assertMarker('${TM_DIRECTORY/src\\//$1/}', Variable);
|
||||
});
|
||||
|
||||
test('No way to escape forward slash in snippet format section #37562', function () {
|
||||
assertMarker('${TM_SELECTED_TEXT/a/\\/$1/g}', Variable);
|
||||
assertMarker('${TM_SELECTED_TEXT/a/in\\/$1ner/g}', Variable);
|
||||
assertMarker('${TM_SELECTED_TEXT/a/end\\//g}', Variable);
|
||||
});
|
||||
|
||||
test('Parser, placeholder with choice', () => {
|
||||
|
||||
assertTextAndMarker('${1|one,two,three|}', 'one', Placeholder);
|
||||
|
||||
Reference in New Issue
Block a user