提交 a374daf7 编写于 作者: J Johannes Rieken

fix #55627

上级 5455483a
......@@ -346,7 +346,7 @@ export class Transform extends Marker {
}
toTextmateString(): string {
return `/${Text.escape(this.regexp.source)}/${this.children.map(c => c.toTextmateString())}/${(this.regexp.ignoreCase ? 'i' : '') + (this.regexp.global ? 'g' : '')}`;
return `/${this.regexp.source}/${this.children.map(c => c.toTextmateString())}/${(this.regexp.ignoreCase ? 'i' : '') + (this.regexp.global ? 'g' : '')}`;
}
clone(): Transform {
......
......@@ -673,6 +673,11 @@ suite('SnippetParser', () => {
assert.equal(new FormatString(1, undefined, 'bar', 'foo').resolve('baz'), 'bar');
});
test('Snippet variable transformation doesn\'t work if regex is complicated and snippet body contains \'$$\' #55627', function () {
const snippet = new SnippetParser().parse('const fileName = "${TM_FILENAME/(.*)\\..+$/$1/}"');
assert.equal(snippet.toTextmateString(), 'const fileName = "${TM_FILENAME/(.*)\\..+$/${1}/}"');
});
test('[BUG] HTML attribute suggestions: Snippet session does not have end-position set, #33147', function () {
const { placeholders } = new SnippetParser().parse('src="$1"', true);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册