Improve "Convert to template string" with template-strings

Fixes #44396
This commit is contained in:
Eli Barzilay
2021-06-02 17:46:41 -04:00
parent 8e01a86c01
commit bb7de99e5a
3 changed files with 40 additions and 19 deletions

View File

@@ -0,0 +1,11 @@
/// <reference path='fourslash.ts' />
////const a = /*x*/`x` + `y` + text + "z"/*y*/;
goTo.select("x", "y");
edit.applyRefactor({
refactorName: "Convert to template string",
actionName: "Convert to template string",
actionDescription: ts.Diagnostics.Convert_to_template_string.message,
newContent: "const a = `xy${text}z`;"
});

View File

@@ -0,0 +1,11 @@
/// <reference path='fourslash.ts' />
////const a = /*x*/`x` + `y` + text + `z`/*y*/;
goTo.select("x", "y");
edit.applyRefactor({
refactorName: "Convert to template string",
actionName: "Convert to template string",
actionDescription: ts.Diagnostics.Convert_to_template_string.message,
newContent: "const a = `xy${text}z`;"
});