remove explicit escaping for placeholder opening

This commit is contained in:
BigAru committed 2019-06-30 19:32:26 +02:00
1 parent 04f96db89d
commit 3e0d34cdd8
2 files changed
+1 -19

No files matched your search

@@ -198,7 +198,7 @@ namespace ts.refactor.convertStringOrTemplateLiteral {
index++;
}
text = escapeText(text);
text = escapeString(text);
return [index, text, indexes];
}
@@ -247,10 +247,4 @@ namespace ts.refactor.convertStringOrTemplateLiteral {
}
return node;
}
function escapeText(content: string) {
return content.replace("`", "\`") // back-tick
.replace("${", "$\\{"); // placeholder alike beginning
}
}
@@ -1,12 +0,0 @@
/// <reference path='fourslash.ts' />
//// const foo = "/*x*/w/*y*/ith ${dollar}"
goTo.select("x", "y");
edit.applyRefactor({
refactorName: "Convert string concatenation or template literal",
actionName: "Convert to template literal",
actionDescription: "Convert to template literal",
newContent:
"const foo = `with $\\\\{dollar}`",
});