From ff4fa1feb9c29d554a27657f43672362681ef7a7 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Thu, 2 Jan 2020 16:32:06 -0800 Subject: [PATCH] Cleaned up refactoring names, descriptions. --- src/compiler/diagnosticMessages.json | 6 +----- .../refactors/convertStringOrTemplateLiteral.ts | 13 +++++-------- ...tringOrTemplateLiteral_ToTemplateAsFnArgument.ts | 6 +++--- ...ertStringOrTemplateLiteral_ToTemplateBackTick.ts | 6 +++--- ...tStringOrTemplateLiteral_ToTemplateBinaryExpr.ts | 6 +++--- ...rTemplateLiteral_ToTemplateBinaryExprInEnding.ts | 6 +++--- ...vertStringOrTemplateLiteral_ToTemplateComment.ts | 6 +++--- ...emplateLiteral_ToTemplateCommentAfterOperator.ts | 6 +++--- ...ringOrTemplateLiteral_ToTemplateCommentNoExpr.ts | 6 +++--- ...ingOrTemplateLiteral_ToTemplateCommentParenth.ts | 6 +++--- ...TemplateLiteral_ToTemplateCommentTrailingExpr.ts | 6 +++--- ...rTemplateLiteral_ToTemplateCommentTrailingStr.ts | 6 +++--- ...ingOrTemplateLiteral_ToTemplateConsecutiveStr.ts | 6 +++--- ...rtStringOrTemplateLiteral_ToTemplateMultiExpr.ts | 6 +++--- ...vertStringOrTemplateLiteral_ToTemplateOneExpr.ts | 6 +++--- ...vertStringOrTemplateLiteral_ToTemplateOnlyStr.ts | 6 +++--- ...tringOrTemplateLiteral_ToTemplateOtherExprSeq.ts | 6 +++--- ...ngOrTemplateLiteral_ToTemplateParenthFromExpr.ts | 6 +++--- ...rTemplateLiteral_ToTemplateParenthFromOpening.ts | 6 +++--- ...ingOrTemplateLiteral_ToTemplateParenthFromStr.ts | 6 +++--- ...StringOrTemplateLiteral_ToTemplatePlusExprSeq.ts | 6 +++--- ...tStringOrTemplateLiteral_ToTemplatePrefixExpr.ts | 6 +++--- ...nvertStringOrTemplateLiteral_ToTemplateSimple.ts | 6 +++--- ...StringOrTemplateLiteral_ToTemplateSingleQuote.ts | 6 +++--- 24 files changed, 72 insertions(+), 79 deletions(-) diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index 5d7f57dc3db..7ad4a075df6 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -5341,14 +5341,10 @@ "category": "Message", "code": 95095 }, - "Convert string concatenation or template literal": { + "Convert to template string": { "category": "Message", "code": 95096 }, - "Convert to template literal": { - "category": "Message", - "code": 95097 - }, "No value exists in scope for the shorthand property '{0}'. Either declare one or provide an initializer.": { "category": "Error", diff --git a/src/services/refactors/convertStringOrTemplateLiteral.ts b/src/services/refactors/convertStringOrTemplateLiteral.ts index a05eab0df39..02a2afc4f48 100644 --- a/src/services/refactors/convertStringOrTemplateLiteral.ts +++ b/src/services/refactors/convertStringOrTemplateLiteral.ts @@ -1,10 +1,7 @@ /* @internal */ namespace ts.refactor.convertStringOrTemplateLiteral { - const refactorName = "Convert string concatenation or template literal"; - const toTemplateLiteralActionName = "Convert to template literal"; - - const refactorDescription = getLocaleSpecificMessage(Diagnostics.Convert_string_concatenation_or_template_literal); - const toTemplateLiteralDescription = getLocaleSpecificMessage(Diagnostics.Convert_to_template_literal); + const refactorName = "Convert to template string"; + const refactorDescription = getLocaleSpecificMessage(Diagnostics.Convert_to_template_string); registerRefactor(refactorName, { getEditsForAction, getAvailableActions }); @@ -15,7 +12,7 @@ namespace ts.refactor.convertStringOrTemplateLiteral { const refactorInfo: ApplicableRefactorInfo = { name: refactorName, description: refactorDescription, actions: [] }; if ((isBinaryExpression(maybeBinary) || isStringLiteral(maybeBinary)) && isStringConcatenationValid(maybeBinary)) { - refactorInfo.actions.push({ name: toTemplateLiteralActionName, description: toTemplateLiteralDescription }); + refactorInfo.actions.push({ name: refactorName, description: refactorDescription }); return [refactorInfo]; } return emptyArray; @@ -36,12 +33,12 @@ namespace ts.refactor.convertStringOrTemplateLiteral { return node; } - function getEditsForAction(context: RefactorContext, actionName: typeof toTemplateLiteralActionName): RefactorEditInfo | undefined { + function getEditsForAction(context: RefactorContext, actionName: string): RefactorEditInfo | undefined { const { file, startPosition } = context; const node = getNodeOrParentOfParentheses(file, startPosition); switch (actionName) { - case toTemplateLiteralActionName: + case refactorDescription: return { edits: getEditsForToTemplateLiteral(context, node) }; default: return Debug.fail("invalid action"); diff --git a/tests/cases/fourslash/refactorConvertStringOrTemplateLiteral_ToTemplateAsFnArgument.ts b/tests/cases/fourslash/refactorConvertStringOrTemplateLiteral_ToTemplateAsFnArgument.ts index a41eef34b41..a40c9e7b0bd 100644 --- a/tests/cases/fourslash/refactorConvertStringOrTemplateLiteral_ToTemplateAsFnArgument.ts +++ b/tests/cases/fourslash/refactorConvertStringOrTemplateLiteral_ToTemplateAsFnArgument.ts @@ -4,9 +4,9 @@ goTo.select("x", "y"); edit.applyRefactor({ - refactorName: "Convert string concatenation or template literal", - actionName: "Convert to template literal", - actionDescription: "Convert to template literal", + refactorName: "Convert to template string", + actionName: "Convert to template string", + actionDescription: ts.Diagnostics.Convert_to_template_string.message, newContent: `console.log(\`foobar is \${32} years old\`)`, }); diff --git a/tests/cases/fourslash/refactorConvertStringOrTemplateLiteral_ToTemplateBackTick.ts b/tests/cases/fourslash/refactorConvertStringOrTemplateLiteral_ToTemplateBackTick.ts index 205f84c19a1..fcb1998dfd0 100644 --- a/tests/cases/fourslash/refactorConvertStringOrTemplateLiteral_ToTemplateBackTick.ts +++ b/tests/cases/fourslash/refactorConvertStringOrTemplateLiteral_ToTemplateBackTick.ts @@ -4,9 +4,9 @@ goTo.select("x", "y"); edit.applyRefactor({ - refactorName: "Convert string concatenation or template literal", - actionName: "Convert to template literal", - actionDescription: "Convert to template literal", + refactorName: "Convert to template string", + actionName: "Convert to template string", + actionDescription: ts.Diagnostics.Convert_to_template_string.message, newContent: "const foo = `with back\\`tick`", }); diff --git a/tests/cases/fourslash/refactorConvertStringOrTemplateLiteral_ToTemplateBinaryExpr.ts b/tests/cases/fourslash/refactorConvertStringOrTemplateLiteral_ToTemplateBinaryExpr.ts index 2519ac34664..936ed7e4c08 100644 --- a/tests/cases/fourslash/refactorConvertStringOrTemplateLiteral_ToTemplateBinaryExpr.ts +++ b/tests/cases/fourslash/refactorConvertStringOrTemplateLiteral_ToTemplateBinaryExpr.ts @@ -4,9 +4,9 @@ goTo.select("x", "y"); edit.applyRefactor({ - refactorName: "Convert string concatenation or template literal", - actionName: "Convert to template literal", - actionDescription: "Convert to template literal", + refactorName: "Convert to template string", + actionName: "Convert to template string", + actionDescription: ts.Diagnostics.Convert_to_template_string.message, newContent: `const foo = \`foobar is \${42 + 6} years old\``, }); diff --git a/tests/cases/fourslash/refactorConvertStringOrTemplateLiteral_ToTemplateBinaryExprInEnding.ts b/tests/cases/fourslash/refactorConvertStringOrTemplateLiteral_ToTemplateBinaryExprInEnding.ts index a7ab291657b..57ce51b05f3 100644 --- a/tests/cases/fourslash/refactorConvertStringOrTemplateLiteral_ToTemplateBinaryExprInEnding.ts +++ b/tests/cases/fourslash/refactorConvertStringOrTemplateLiteral_ToTemplateBinaryExprInEnding.ts @@ -4,9 +4,9 @@ goTo.select("x", "y"); edit.applyRefactor({ - refactorName: "Convert string concatenation or template literal", - actionName: "Convert to template literal", - actionDescription: "Convert to template literal", + refactorName: "Convert to template string", + actionName: "Convert to template string", + actionDescription: ts.Diagnostics.Convert_to_template_string.message, newContent: "const foo = `foobar is \${42 + 6}`", }); diff --git a/tests/cases/fourslash/refactorConvertStringOrTemplateLiteral_ToTemplateComment.ts b/tests/cases/fourslash/refactorConvertStringOrTemplateLiteral_ToTemplateComment.ts index 18bdf4d1c7c..749c4f1de05 100644 --- a/tests/cases/fourslash/refactorConvertStringOrTemplateLiteral_ToTemplateComment.ts +++ b/tests/cases/fourslash/refactorConvertStringOrTemplateLiteral_ToTemplateComment.ts @@ -4,9 +4,9 @@ goTo.select("x", "y"); edit.applyRefactor({ - refactorName: "Convert string concatenation or template literal", - actionName: "Convert to template literal", - actionDescription: "Convert to template literal", + refactorName: "Convert to template string", + actionName: "Convert to template string", + actionDescription: ts.Diagnostics.Convert_to_template_string.message, newContent: "const foo = /* C0 */ `foo is\${ /* C1 */ /* C2 */42 /* C3 */} and bar is\${ /* C4 */ /* C5 */52 /* C6 */}`", }); diff --git a/tests/cases/fourslash/refactorConvertStringOrTemplateLiteral_ToTemplateCommentAfterOperator.ts b/tests/cases/fourslash/refactorConvertStringOrTemplateLiteral_ToTemplateCommentAfterOperator.ts index 1b18d5e71bb..8a6c3e7f557 100644 --- a/tests/cases/fourslash/refactorConvertStringOrTemplateLiteral_ToTemplateCommentAfterOperator.ts +++ b/tests/cases/fourslash/refactorConvertStringOrTemplateLiteral_ToTemplateCommentAfterOperator.ts @@ -4,9 +4,9 @@ goTo.select("x", "y"); edit.applyRefactor({ - refactorName: "Convert string concatenation or template literal", - actionName: "Convert to template literal", - actionDescription: "Convert to template literal", + refactorName: "Convert to template string", + actionName: "Convert to template string", + actionDescription: ts.Diagnostics.Convert_to_template_string.message, newContent: "const foo = /* C0 */ `foo is\${ /* C1 */ /* C2 */42 /* C3 */} and bar is\${ /* C4 */ /* C5 */52 /* C6 */}`", }); diff --git a/tests/cases/fourslash/refactorConvertStringOrTemplateLiteral_ToTemplateCommentNoExpr.ts b/tests/cases/fourslash/refactorConvertStringOrTemplateLiteral_ToTemplateCommentNoExpr.ts index fd63bd234fc..6a1532cc37f 100644 --- a/tests/cases/fourslash/refactorConvertStringOrTemplateLiteral_ToTemplateCommentNoExpr.ts +++ b/tests/cases/fourslash/refactorConvertStringOrTemplateLiteral_ToTemplateCommentNoExpr.ts @@ -4,9 +4,9 @@ goTo.select("x", "y"); edit.applyRefactor({ - refactorName: "Convert string concatenation or template literal", - actionName: "Convert to template literal", - actionDescription: "Convert to template literal", + refactorName: "Convert to template string", + actionName: "Convert to template string", + actionDescription: ts.Diagnostics.Convert_to_template_string.message, newContent: "const foo = /* C0 */ `foo is` /* C1 */ /* C2 */ /* C3 */", }); diff --git a/tests/cases/fourslash/refactorConvertStringOrTemplateLiteral_ToTemplateCommentParenth.ts b/tests/cases/fourslash/refactorConvertStringOrTemplateLiteral_ToTemplateCommentParenth.ts index 57df8e671cf..4688b8be8d3 100644 --- a/tests/cases/fourslash/refactorConvertStringOrTemplateLiteral_ToTemplateCommentParenth.ts +++ b/tests/cases/fourslash/refactorConvertStringOrTemplateLiteral_ToTemplateCommentParenth.ts @@ -4,9 +4,9 @@ goTo.select("x", "y"); edit.applyRefactor({ - refactorName: "Convert string concatenation or template literal", - actionName: "Convert to template literal", - actionDescription: "Convert to template literal", + refactorName: "Convert to template string", + actionName: "Convert to template string", + actionDescription: ts.Diagnostics.Convert_to_template_string.message, newContent: "const foo = `foobar is\${/* C1 */ 42 /* C2 */ /* C3 */} years old`", }); diff --git a/tests/cases/fourslash/refactorConvertStringOrTemplateLiteral_ToTemplateCommentTrailingExpr.ts b/tests/cases/fourslash/refactorConvertStringOrTemplateLiteral_ToTemplateCommentTrailingExpr.ts index 6b54b8b5488..4d989d8289d 100644 --- a/tests/cases/fourslash/refactorConvertStringOrTemplateLiteral_ToTemplateCommentTrailingExpr.ts +++ b/tests/cases/fourslash/refactorConvertStringOrTemplateLiteral_ToTemplateCommentTrailingExpr.ts @@ -4,9 +4,9 @@ goTo.select("x", "y"); edit.applyRefactor({ - refactorName: "Convert string concatenation or template literal", - actionName: "Convert to template literal", - actionDescription: "Convert to template literal", + refactorName: "Convert to template string", + actionName: "Convert to template string", + actionDescription: ts.Diagnostics.Convert_to_template_string.message, newContent: "const foo = /* C0 */ `foo is\${ /* C1 */ /* C2 */42 /* C3 */}`", }); diff --git a/tests/cases/fourslash/refactorConvertStringOrTemplateLiteral_ToTemplateCommentTrailingStr.ts b/tests/cases/fourslash/refactorConvertStringOrTemplateLiteral_ToTemplateCommentTrailingStr.ts index e2d3f05050c..a92c28eff6c 100644 --- a/tests/cases/fourslash/refactorConvertStringOrTemplateLiteral_ToTemplateCommentTrailingStr.ts +++ b/tests/cases/fourslash/refactorConvertStringOrTemplateLiteral_ToTemplateCommentTrailingStr.ts @@ -4,9 +4,9 @@ goTo.select("x", "y"); edit.applyRefactor({ - refactorName: "Convert string concatenation or template literal", - actionName: "Convert to template literal", - actionDescription: "Convert to template literal", + refactorName: "Convert to template string", + actionName: "Convert to template string", + actionDescription: ts.Diagnostics.Convert_to_template_string.message, newContent: "const foo = /* C0 */ `foo is\${ /* C1 */ /* C2 */42} years old` /* C3 */", }); diff --git a/tests/cases/fourslash/refactorConvertStringOrTemplateLiteral_ToTemplateConsecutiveStr.ts b/tests/cases/fourslash/refactorConvertStringOrTemplateLiteral_ToTemplateConsecutiveStr.ts index a053a6c5e3b..e95b19b80e7 100644 --- a/tests/cases/fourslash/refactorConvertStringOrTemplateLiteral_ToTemplateConsecutiveStr.ts +++ b/tests/cases/fourslash/refactorConvertStringOrTemplateLiteral_ToTemplateConsecutiveStr.ts @@ -4,9 +4,9 @@ goTo.select("x", "y"); edit.applyRefactor({ - refactorName: "Convert string concatenation or template literal", - actionName: "Convert to template literal", - actionDescription: "Convert to template literal", + refactorName: "Convert to template string", + actionName: "Convert to template string", + actionDescription: ts.Diagnostics.Convert_to_template_string.message, newContent: `const foo = \`foobar is \${42} years old and \${6} cars are missing\``, }); diff --git a/tests/cases/fourslash/refactorConvertStringOrTemplateLiteral_ToTemplateMultiExpr.ts b/tests/cases/fourslash/refactorConvertStringOrTemplateLiteral_ToTemplateMultiExpr.ts index e781bae6634..c9aa22a8ae8 100644 --- a/tests/cases/fourslash/refactorConvertStringOrTemplateLiteral_ToTemplateMultiExpr.ts +++ b/tests/cases/fourslash/refactorConvertStringOrTemplateLiteral_ToTemplateMultiExpr.ts @@ -6,9 +6,9 @@ goTo.select("x", "y"); edit.applyRefactor({ - refactorName: "Convert string concatenation or template literal", - actionName: "Convert to template literal", - actionDescription: "Convert to template literal", + refactorName: "Convert to template string", + actionName: "Convert to template string", + actionDescription: ts.Diagnostics.Convert_to_template_string.message, newContent: `const age = 22 const name = "Eddy" diff --git a/tests/cases/fourslash/refactorConvertStringOrTemplateLiteral_ToTemplateOneExpr.ts b/tests/cases/fourslash/refactorConvertStringOrTemplateLiteral_ToTemplateOneExpr.ts index a790a623aaa..368d671aa1c 100644 --- a/tests/cases/fourslash/refactorConvertStringOrTemplateLiteral_ToTemplateOneExpr.ts +++ b/tests/cases/fourslash/refactorConvertStringOrTemplateLiteral_ToTemplateOneExpr.ts @@ -5,9 +5,9 @@ goTo.select("x", "y"); edit.applyRefactor({ - refactorName: "Convert string concatenation or template literal", - actionName: "Convert to template literal", - actionDescription: "Convert to template literal", + refactorName: "Convert to template string", + actionName: "Convert to template string", + actionDescription: ts.Diagnostics.Convert_to_template_string.message, newContent: `const age = 42 const foo = \`foobar is \${age} years old\``, diff --git a/tests/cases/fourslash/refactorConvertStringOrTemplateLiteral_ToTemplateOnlyStr.ts b/tests/cases/fourslash/refactorConvertStringOrTemplateLiteral_ToTemplateOnlyStr.ts index bd1fa6009fc..28935996d05 100644 --- a/tests/cases/fourslash/refactorConvertStringOrTemplateLiteral_ToTemplateOnlyStr.ts +++ b/tests/cases/fourslash/refactorConvertStringOrTemplateLiteral_ToTemplateOnlyStr.ts @@ -4,9 +4,9 @@ goTo.select("x", "y"); edit.applyRefactor({ - refactorName: "Convert string concatenation or template literal", - actionName: "Convert to template literal", - actionDescription: "Convert to template literal", + refactorName: "Convert to template string", + actionName: "Convert to template string", + actionDescription: ts.Diagnostics.Convert_to_template_string.message, newContent: "const foo = `foobar rocks fantastically`", }); diff --git a/tests/cases/fourslash/refactorConvertStringOrTemplateLiteral_ToTemplateOtherExprSeq.ts b/tests/cases/fourslash/refactorConvertStringOrTemplateLiteral_ToTemplateOtherExprSeq.ts index 493f724a2bd..fa19f750548 100644 --- a/tests/cases/fourslash/refactorConvertStringOrTemplateLiteral_ToTemplateOtherExprSeq.ts +++ b/tests/cases/fourslash/refactorConvertStringOrTemplateLiteral_ToTemplateOtherExprSeq.ts @@ -4,9 +4,9 @@ goTo.select("x", "y"); edit.applyRefactor({ - refactorName: "Convert string concatenation or template literal", - actionName: "Convert to template literal", - actionDescription: "Convert to template literal", + refactorName: "Convert to template string", + actionName: "Convert to template string", + actionDescription: ts.Diagnostics.Convert_to_template_string.message, newContent: `const foo = \`foobar is \${42 * 6 / 4} years old\``, }); diff --git a/tests/cases/fourslash/refactorConvertStringOrTemplateLiteral_ToTemplateParenthFromExpr.ts b/tests/cases/fourslash/refactorConvertStringOrTemplateLiteral_ToTemplateParenthFromExpr.ts index 7fd5fc0424b..18e6b9296a9 100644 --- a/tests/cases/fourslash/refactorConvertStringOrTemplateLiteral_ToTemplateParenthFromExpr.ts +++ b/tests/cases/fourslash/refactorConvertStringOrTemplateLiteral_ToTemplateParenthFromExpr.ts @@ -4,9 +4,9 @@ goTo.select("x", "y"); edit.applyRefactor({ - refactorName: "Convert string concatenation or template literal", - actionName: "Convert to template literal", - actionDescription: "Convert to template literal", + refactorName: "Convert to template string", + actionName: "Convert to template string", + actionDescription: ts.Diagnostics.Convert_to_template_string.message, newContent: `const foo = \`foobar is \${42 + 6} years old\``, }); diff --git a/tests/cases/fourslash/refactorConvertStringOrTemplateLiteral_ToTemplateParenthFromOpening.ts b/tests/cases/fourslash/refactorConvertStringOrTemplateLiteral_ToTemplateParenthFromOpening.ts index 5924da73ebc..624a5eece1d 100644 --- a/tests/cases/fourslash/refactorConvertStringOrTemplateLiteral_ToTemplateParenthFromOpening.ts +++ b/tests/cases/fourslash/refactorConvertStringOrTemplateLiteral_ToTemplateParenthFromOpening.ts @@ -4,9 +4,9 @@ goTo.select("x", "y"); edit.applyRefactor({ - refactorName: "Convert string concatenation or template literal", - actionName: "Convert to template literal", - actionDescription: "Convert to template literal", + refactorName: "Convert to template string", + actionName: "Convert to template string", + actionDescription: ts.Diagnostics.Convert_to_template_string.message, newContent: `const foo = \`foobar is \${42 + 6} years old\``, }); diff --git a/tests/cases/fourslash/refactorConvertStringOrTemplateLiteral_ToTemplateParenthFromStr.ts b/tests/cases/fourslash/refactorConvertStringOrTemplateLiteral_ToTemplateParenthFromStr.ts index e3d2892aaaa..c36416351e2 100644 --- a/tests/cases/fourslash/refactorConvertStringOrTemplateLiteral_ToTemplateParenthFromStr.ts +++ b/tests/cases/fourslash/refactorConvertStringOrTemplateLiteral_ToTemplateParenthFromStr.ts @@ -4,9 +4,9 @@ goTo.select("x", "y"); edit.applyRefactor({ - refactorName: "Convert string concatenation or template literal", - actionName: "Convert to template literal", - actionDescription: "Convert to template literal", + refactorName: "Convert to template string", + actionName: "Convert to template string", + actionDescription: ts.Diagnostics.Convert_to_template_string.message, newContent: `const foo = "foobar is " + (\`\${42 + 6}str\`) + " years old"`, }); diff --git a/tests/cases/fourslash/refactorConvertStringOrTemplateLiteral_ToTemplatePlusExprSeq.ts b/tests/cases/fourslash/refactorConvertStringOrTemplateLiteral_ToTemplatePlusExprSeq.ts index aadc6068a68..795e76ce468 100644 --- a/tests/cases/fourslash/refactorConvertStringOrTemplateLiteral_ToTemplatePlusExprSeq.ts +++ b/tests/cases/fourslash/refactorConvertStringOrTemplateLiteral_ToTemplatePlusExprSeq.ts @@ -4,9 +4,9 @@ goTo.select("x", "y"); edit.applyRefactor({ - refactorName: "Convert string concatenation or template literal", - actionName: "Convert to template literal", - actionDescription: "Convert to template literal", + refactorName: "Convert to template string", + actionName: "Convert to template string", + actionDescription: ts.Diagnostics.Convert_to_template_string.message, newContent: `const foo = \`foobar is \${42}\${6} years old\``, }); diff --git a/tests/cases/fourslash/refactorConvertStringOrTemplateLiteral_ToTemplatePrefixExpr.ts b/tests/cases/fourslash/refactorConvertStringOrTemplateLiteral_ToTemplatePrefixExpr.ts index 7b8c6244114..a5e3e74b74a 100644 --- a/tests/cases/fourslash/refactorConvertStringOrTemplateLiteral_ToTemplatePrefixExpr.ts +++ b/tests/cases/fourslash/refactorConvertStringOrTemplateLiteral_ToTemplatePrefixExpr.ts @@ -4,9 +4,9 @@ goTo.select("x", "y"); edit.applyRefactor({ - refactorName: "Convert string concatenation or template literal", - actionName: "Convert to template literal", - actionDescription: "Convert to template literal", + refactorName: "Convert to template string", + actionName: "Convert to template string", + actionDescription: ts.Diagnostics.Convert_to_template_string.message, newContent: `const foo = \`\${42 - 6 * 4 + 23 / 12} years old\``, }); diff --git a/tests/cases/fourslash/refactorConvertStringOrTemplateLiteral_ToTemplateSimple.ts b/tests/cases/fourslash/refactorConvertStringOrTemplateLiteral_ToTemplateSimple.ts index 2c5663b07dc..11fee10594b 100644 --- a/tests/cases/fourslash/refactorConvertStringOrTemplateLiteral_ToTemplateSimple.ts +++ b/tests/cases/fourslash/refactorConvertStringOrTemplateLiteral_ToTemplateSimple.ts @@ -4,9 +4,9 @@ goTo.select("x", "y"); edit.applyRefactor({ - refactorName: "Convert string concatenation or template literal", - actionName: "Convert to template literal", - actionDescription: "Convert to template literal", + refactorName: "Convert to template string", + actionName: "Convert to template string", + actionDescription: ts.Diagnostics.Convert_to_template_string.message, newContent: `const foo = \`foobar rocks\``, }); diff --git a/tests/cases/fourslash/refactorConvertStringOrTemplateLiteral_ToTemplateSingleQuote.ts b/tests/cases/fourslash/refactorConvertStringOrTemplateLiteral_ToTemplateSingleQuote.ts index 4a4d2c5b26e..0b6c94dadcd 100644 --- a/tests/cases/fourslash/refactorConvertStringOrTemplateLiteral_ToTemplateSingleQuote.ts +++ b/tests/cases/fourslash/refactorConvertStringOrTemplateLiteral_ToTemplateSingleQuote.ts @@ -4,9 +4,9 @@ goTo.select("x", "y"); edit.applyRefactor({ - refactorName: "Convert string concatenation or template literal", - actionName: "Convert to template literal", - actionDescription: "Convert to template literal", + refactorName: "Convert to template string", + actionName: "Convert to template string", + actionDescription: ts.Diagnostics.Convert_to_template_string.message, newContent: `const foo = \`foobar rocks\``, });