From 0777f4a9155bbbec7708d363f3499811d199dfa2 Mon Sep 17 00:00:00 2001 From: Gabriela Araujo Britto Date: Wed, 13 Mar 2019 16:01:16 -0700 Subject: [PATCH] rename convert to named parameters --- src/compiler/diagnosticMessages.json | 2 +- ...eters.ts => convertParamsToDestructuredObject.ts} | 6 +++--- src/services/tsconfig.json | 2 +- ...tParamsToDestructuredObject_allParamsOptional.ts} | 6 +++--- ...nvertParamsToDestructuredObject_arrowFunction.ts} | 6 +++--- ...amsToDestructuredObject_arrowFunctionWithType.ts} | 2 +- ...onvertParamsToDestructuredObject_callComments.ts} | 6 +++--- ...nvertParamsToDestructuredObject_callComments2.ts} | 6 +++--- ...ConvertParamsToDestructuredObject_chainedCall.ts} | 6 +++--- ...ToDestructuredObject_classDeclarationAliasing.ts} | 6 +++--- ...DestructuredObject_classDeclarationGoodUsages.ts} | 6 +++--- ...ertParamsToDestructuredObject_classExpression.ts} | 6 +++--- ...oDestructuredObject_classExpressionGoodUsages.ts} | 6 +++--- ...sToDestructuredObject_classExpressionHeritage.ts} | 6 +++--- ...aramsToDestructuredObject_classTypeParameters.ts} | 6 +++--- ...ConvertParamsToDestructuredObject_constructor.ts} | 6 +++--- ...onvertParamsToDestructuredObject_defaultClass.ts} | 2 +- ...torConvertParamsToDestructuredObject_function.ts} | 6 +++--- ...rtParamsToDestructuredObject_functionComments.ts} | 6 +++--- ...tParamsToDestructuredObject_functionComments1.ts} | 6 +++--- ...tParamsToDestructuredObject_functionComments2.ts} | 6 +++--- ...ParamsToDestructuredObject_functionExpression.ts} | 6 +++--- ...msToDestructuredObject_functionTypeParameters.ts} | 6 +++--- ...ramsToDestructuredObject_inheritedConstructor.ts} | 6 +++--- ...ertParamsToDestructuredObject_inheritedMethod.ts} | 6 +++--- ...ConvertParamsToDestructuredObject_initializer.ts} | 6 +++--- ...ramsToDestructuredObject_initializerInference.ts} | 6 +++--- ...actorConvertParamsToDestructuredObject_method.ts} | 6 +++--- ...ertParamsToDestructuredObject_methodCallUnion.ts} | 6 +++--- ...ConvertParamsToDestructuredObject_methodCalls.ts} | 6 +++--- ...ertParamsToDestructuredObject_methodOverrides.ts} | 12 ++++++------ ...orConvertParamsToDestructuredObject_overloads.ts} | 2 +- ...vertParamsToDestructuredObject_paramDecorator.ts} | 2 +- ...tParamsToDestructuredObject_recursiveFunction.ts} | 6 +++--- ...ParamsToDestructuredObject_restParamInference.ts} | 6 +++--- ...onvertParamsToDestructuredObject_staticMethod.ts} | 6 +++--- ...orConvertParamsToDestructuredObject_superCall.ts} | 6 +++--- ...orConvertParamsToDestructuredObject_thisParam.ts} | 6 +++--- ...vertParamsToDestructuredObject_typedRestParam.ts} | 6 +++--- ...rtParamsToDestructuredObject_varArrowFunction.ts} | 2 +- 40 files changed, 109 insertions(+), 109 deletions(-) rename src/services/refactors/{convertToNamedParameters.ts => convertParamsToDestructuredObject.ts} (97%) rename tests/cases/fourslash/{refactorConvertToNamedParameters_allParamsOptional.ts => refactorConvertParamsToDestructuredObject_allParamsOptional.ts} (58%) rename tests/cases/fourslash/{refactorConvertToNamedParameters_arrowFunction.ts => refactorConvertParamsToDestructuredObject_arrowFunction.ts} (55%) rename tests/cases/fourslash/{refactorConvertToNamedParameters_arrowFunctionWithContextualType.ts => refactorConvertParamsToDestructuredObject_arrowFunctionWithType.ts} (67%) rename tests/cases/fourslash/{refactorConvertToNamedParameters_callComments.ts => refactorConvertParamsToDestructuredObject_callComments.ts} (69%) rename tests/cases/fourslash/{refactorConvertToNamedParameters_callComments2.ts => refactorConvertParamsToDestructuredObject_callComments2.ts} (74%) rename tests/cases/fourslash/{refactorConvertToNamedParameters_chainedCall.ts => refactorConvertParamsToDestructuredObject_chainedCall.ts} (62%) rename tests/cases/fourslash/{refactorConvertToNamedParameters_classDeclarationAliasing.ts => refactorConvertParamsToDestructuredObject_classDeclarationAliasing.ts} (65%) rename tests/cases/fourslash/{refactorConvertToNamedParameters_classDeclarationGoodUsages.ts => refactorConvertParamsToDestructuredObject_classDeclarationGoodUsages.ts} (73%) rename tests/cases/fourslash/{refactorConvertToNamedParameters_classExpression.ts => refactorConvertParamsToDestructuredObject_classExpression.ts} (61%) rename tests/cases/fourslash/{refactorConvertToNamedParameters_classExpressionGoodUsages.ts => refactorConvertParamsToDestructuredObject_classExpressionGoodUsages.ts} (67%) rename tests/cases/fourslash/{refactorConvertToNamedParameters_classExpressionHeritage.ts => refactorConvertParamsToDestructuredObject_classExpressionHeritage.ts} (68%) rename tests/cases/fourslash/{refactorConvertToNamedParameters_classTypeParameters.ts => refactorConvertParamsToDestructuredObject_classTypeParameters.ts} (63%) rename tests/cases/fourslash/{refactorConvertToNamedParameters_constructor.ts => refactorConvertParamsToDestructuredObject_constructor.ts} (69%) rename tests/cases/fourslash/{refactorConvertToNamedParameters_defaultClass.ts => refactorConvertParamsToDestructuredObject_defaultClass.ts} (65%) rename tests/cases/fourslash/{refactorConvertToNamedParameters_function.ts => refactorConvertParamsToDestructuredObject_function.ts} (58%) rename tests/cases/fourslash/{refactorConvertToNamedParameters_functionComments.ts => refactorConvertParamsToDestructuredObject_functionComments.ts} (76%) rename tests/cases/fourslash/{refactorConvertToNamedParameters_functionComments1.ts => refactorConvertParamsToDestructuredObject_functionComments1.ts} (58%) rename tests/cases/fourslash/{refactorConvertToNamedParameters_functionComments2.ts => refactorConvertParamsToDestructuredObject_functionComments2.ts} (63%) rename tests/cases/fourslash/{refactorConvertToNamedParameters_functionExpression.ts => refactorConvertParamsToDestructuredObject_functionExpression.ts} (56%) rename tests/cases/fourslash/{refactorConvertToNamedParameters_functionTypeParameters.ts => refactorConvertParamsToDestructuredObject_functionTypeParameters.ts} (57%) rename tests/cases/fourslash/{refactorConvertToNamedParameters_inheritedConstructor.ts => refactorConvertParamsToDestructuredObject_inheritedConstructor.ts} (73%) rename tests/cases/fourslash/{refactorConvertToNamedParameters_inheritedMethod.ts => refactorConvertParamsToDestructuredObject_inheritedMethod.ts} (68%) rename tests/cases/fourslash/{refactorConvertToNamedParameters_initializer.ts => refactorConvertParamsToDestructuredObject_initializer.ts} (59%) rename tests/cases/fourslash/{refactorConvertToNamedParameters_initializerInference.ts => refactorConvertParamsToDestructuredObject_initializerInference.ts} (62%) rename tests/cases/fourslash/{refactorConvertToNamedParameters_method.ts => refactorConvertParamsToDestructuredObject_method.ts} (65%) rename tests/cases/fourslash/{refactorConvertToNamedParameters_methodCallUnion.ts => refactorConvertParamsToDestructuredObject_methodCallUnion.ts} (70%) rename tests/cases/fourslash/{refactorConvertToNamedParameters_methodCalls.ts => refactorConvertParamsToDestructuredObject_methodCalls.ts} (68%) rename tests/cases/fourslash/{refactorConvertToNamedParameters_methodOverrides.ts => refactorConvertParamsToDestructuredObject_methodOverrides.ts} (62%) rename tests/cases/fourslash/{refactorConvertToNamedParameters_overloads.ts => refactorConvertParamsToDestructuredObject_overloads.ts} (68%) rename tests/cases/fourslash/{refactorConvertToNamedParameters_paramDecorator.ts => refactorConvertParamsToDestructuredObject_paramDecorator.ts} (75%) rename tests/cases/fourslash/{refactorConvertToNamedParameters_recursiveFunction.ts => refactorConvertParamsToDestructuredObject_recursiveFunction.ts} (64%) rename tests/cases/fourslash/{refactorConvertToNamedParameters_restParamInference.ts => refactorConvertParamsToDestructuredObject_restParamInference.ts} (64%) rename tests/cases/fourslash/{refactorConvertToNamedParameters_staticMethod.ts => refactorConvertParamsToDestructuredObject_staticMethod.ts} (64%) rename tests/cases/fourslash/{refactorConvertToNamedParameters_superCall.ts => refactorConvertParamsToDestructuredObject_superCall.ts} (69%) rename tests/cases/fourslash/{refactorConvertToNamedParameters_thisParam.ts => refactorConvertParamsToDestructuredObject_thisParam.ts} (60%) rename tests/cases/fourslash/{refactorConvertToNamedParameters_typedRestParam.ts => refactorConvertParamsToDestructuredObject_typedRestParam.ts} (75%) rename tests/cases/fourslash/{refactorConvertToNamedParameters_varArrowFunction.ts => refactorConvertParamsToDestructuredObject_varArrowFunction.ts} (61%) diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index 5ef209b0a88da..9ae3e1ca77eae 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -4927,7 +4927,7 @@ "category": "Message", "code": 95074 }, - "Convert to named parameters": { + "Convert parameters to destructured object": { "category": "Message", "code": 95075 } diff --git a/src/services/refactors/convertToNamedParameters.ts b/src/services/refactors/convertParamsToDestructuredObject.ts similarity index 97% rename from src/services/refactors/convertToNamedParameters.ts rename to src/services/refactors/convertParamsToDestructuredObject.ts index 61e9ccf981136..f813f8ef7686b 100644 --- a/src/services/refactors/convertToNamedParameters.ts +++ b/src/services/refactors/convertParamsToDestructuredObject.ts @@ -1,6 +1,6 @@ /* @internal */ -namespace ts.refactor.convertToNamedParameters { - const refactorName = "Convert to named parameters"; +namespace ts.refactor.convertParamsToDestructuredObject { + const refactorName = "Convert parameters to destructured object"; const minimumParameterLength = 2; registerRefactor(refactorName, { getEditsForAction, getAvailableActions }); @@ -12,7 +12,7 @@ namespace ts.refactor.convertToNamedParameters { const functionDeclaration = getFunctionDeclarationAtPosition(file, startPosition, context.program.getTypeChecker()); if (!functionDeclaration) return emptyArray; - const description = getLocaleSpecificMessage(Diagnostics.Convert_to_named_parameters); + const description = getLocaleSpecificMessage(Diagnostics.Convert_parameters_to_destructured_object); return [{ name: refactorName, description, diff --git a/src/services/tsconfig.json b/src/services/tsconfig.json index 793089e62c829..e3f2358be1059 100644 --- a/src/services/tsconfig.json +++ b/src/services/tsconfig.json @@ -84,7 +84,7 @@ "refactors/generateGetAccessorAndSetAccessor.ts", "refactors/moveToNewFile.ts", "refactors/addOrRemoveBracesToArrowFunction.ts", - "refactors/convertToNamedParameters.ts", + "refactors/convertParamsToDestructuredObject.ts", "services.ts", "breakpoints.ts", "transform.ts", diff --git a/tests/cases/fourslash/refactorConvertToNamedParameters_allParamsOptional.ts b/tests/cases/fourslash/refactorConvertParamsToDestructuredObject_allParamsOptional.ts similarity index 58% rename from tests/cases/fourslash/refactorConvertToNamedParameters_allParamsOptional.ts rename to tests/cases/fourslash/refactorConvertParamsToDestructuredObject_allParamsOptional.ts index 825b34c303d96..8d8db71960859 100644 --- a/tests/cases/fourslash/refactorConvertToNamedParameters_allParamsOptional.ts +++ b/tests/cases/fourslash/refactorConvertParamsToDestructuredObject_allParamsOptional.ts @@ -7,9 +7,9 @@ goTo.select("a", "b"); edit.applyRefactor({ - refactorName: "Convert to named parameters", - actionName: "Convert to named parameters", - actionDescription: "Convert to named parameters", + refactorName: "Convert parameters to destructured object", + actionName: "Convert parameters to destructured object", + actionDescription: "Convert parameters to destructured object", newContent: `function f({ a, b = "1" }: { a?: number; b?: string; } = {}): string { return b; } diff --git a/tests/cases/fourslash/refactorConvertToNamedParameters_arrowFunction.ts b/tests/cases/fourslash/refactorConvertParamsToDestructuredObject_arrowFunction.ts similarity index 55% rename from tests/cases/fourslash/refactorConvertToNamedParameters_arrowFunction.ts rename to tests/cases/fourslash/refactorConvertParamsToDestructuredObject_arrowFunction.ts index 6a5a8e328a534..97d337d8d1aa3 100644 --- a/tests/cases/fourslash/refactorConvertToNamedParameters_arrowFunction.ts +++ b/tests/cases/fourslash/refactorConvertParamsToDestructuredObject_arrowFunction.ts @@ -5,9 +5,9 @@ goTo.select("a", "b"); edit.applyRefactor({ - refactorName: "Convert to named parameters", - actionName: "Convert to named parameters", - actionDescription: "Convert to named parameters", + refactorName: "Convert parameters to destructured object", + actionName: "Convert parameters to destructured object", + actionDescription: "Convert parameters to destructured object", newContent: `const foo = ({ a, b }: { a: number; b: number; }) => { }; foo({ a: 1, b: 2 });` }); \ No newline at end of file diff --git a/tests/cases/fourslash/refactorConvertToNamedParameters_arrowFunctionWithContextualType.ts b/tests/cases/fourslash/refactorConvertParamsToDestructuredObject_arrowFunctionWithType.ts similarity index 67% rename from tests/cases/fourslash/refactorConvertToNamedParameters_arrowFunctionWithContextualType.ts rename to tests/cases/fourslash/refactorConvertParamsToDestructuredObject_arrowFunctionWithType.ts index 05a0f6f54fa21..2539d97d04d1e 100644 --- a/tests/cases/fourslash/refactorConvertToNamedParameters_arrowFunctionWithContextualType.ts +++ b/tests/cases/fourslash/refactorConvertParamsToDestructuredObject_arrowFunctionWithType.ts @@ -4,4 +4,4 @@ ////foo(1, 2); goTo.select("a", "b"); -verify.not.refactorAvailable("Convert to named parameters"); +verify.not.refactorAvailable("Convert parameters to destructured object"); diff --git a/tests/cases/fourslash/refactorConvertToNamedParameters_callComments.ts b/tests/cases/fourslash/refactorConvertParamsToDestructuredObject_callComments.ts similarity index 69% rename from tests/cases/fourslash/refactorConvertToNamedParameters_callComments.ts rename to tests/cases/fourslash/refactorConvertParamsToDestructuredObject_callComments.ts index 6fb06fe938b75..2e30f96cd5968 100644 --- a/tests/cases/fourslash/refactorConvertToNamedParameters_callComments.ts +++ b/tests/cases/fourslash/refactorConvertParamsToDestructuredObject_callComments.ts @@ -7,9 +7,9 @@ goTo.select("a", "b"); edit.applyRefactor({ - refactorName: "Convert to named parameters", - actionName: "Convert to named parameters", - actionDescription: "Convert to named parameters", + refactorName: "Convert parameters to destructured object", + actionName: "Convert parameters to destructured object", + actionDescription: "Convert parameters to destructured object", newContent: `function foo({ a, b, rest = [] }: { a: number; b: number; rest?: number[]; }) { return a + b; } diff --git a/tests/cases/fourslash/refactorConvertToNamedParameters_callComments2.ts b/tests/cases/fourslash/refactorConvertParamsToDestructuredObject_callComments2.ts similarity index 74% rename from tests/cases/fourslash/refactorConvertToNamedParameters_callComments2.ts rename to tests/cases/fourslash/refactorConvertParamsToDestructuredObject_callComments2.ts index 96a56d7024dae..fcb50b6b8e189 100644 --- a/tests/cases/fourslash/refactorConvertToNamedParameters_callComments2.ts +++ b/tests/cases/fourslash/refactorConvertParamsToDestructuredObject_callComments2.ts @@ -16,9 +16,9 @@ goTo.select("a", "b"); /* The expected content is currently wrong. The new argument object has the wrong formatting. */ edit.applyRefactor({ - refactorName: "Convert to named parameters", - actionName: "Convert to named parameters", - actionDescription: "Convert to named parameters", + refactorName: "Convert parameters to destructured object", + actionName: "Convert parameters to destructured object", + actionDescription: "Convert parameters to destructured object", newContent: `function foo({ a, b, rest = [] }: { a: number; b: number; rest?: number[]; }) { return a + b; } diff --git a/tests/cases/fourslash/refactorConvertToNamedParameters_chainedCall.ts b/tests/cases/fourslash/refactorConvertParamsToDestructuredObject_chainedCall.ts similarity index 62% rename from tests/cases/fourslash/refactorConvertToNamedParameters_chainedCall.ts rename to tests/cases/fourslash/refactorConvertParamsToDestructuredObject_chainedCall.ts index 0fb20ec864ddd..0b033200666d0 100644 --- a/tests/cases/fourslash/refactorConvertToNamedParameters_chainedCall.ts +++ b/tests/cases/fourslash/refactorConvertParamsToDestructuredObject_chainedCall.ts @@ -7,9 +7,9 @@ goTo.select("a", "b"); edit.applyRefactor({ - refactorName: "Convert to named parameters", - actionName: "Convert to named parameters", - actionDescription: "Convert to named parameters", + refactorName: "Convert parameters to destructured object", + actionName: "Convert parameters to destructured object", + actionDescription: "Convert parameters to destructured object", newContent: `function foo({ a, b }: { a: number; b: number; }) { return { bar: () => a + b }; } diff --git a/tests/cases/fourslash/refactorConvertToNamedParameters_classDeclarationAliasing.ts b/tests/cases/fourslash/refactorConvertParamsToDestructuredObject_classDeclarationAliasing.ts similarity index 65% rename from tests/cases/fourslash/refactorConvertToNamedParameters_classDeclarationAliasing.ts rename to tests/cases/fourslash/refactorConvertParamsToDestructuredObject_classDeclarationAliasing.ts index 0914dedd57d96..9b77ecc2024fd 100644 --- a/tests/cases/fourslash/refactorConvertToNamedParameters_classDeclarationAliasing.ts +++ b/tests/cases/fourslash/refactorConvertParamsToDestructuredObject_classDeclarationAliasing.ts @@ -9,9 +9,9 @@ goTo.select("a", "b"); // Refactor should not make changes edit.applyRefactor({ - refactorName: "Convert to named parameters", - actionName: "Convert to named parameters", - actionDescription: "Convert to named parameters", + refactorName: "Convert parameters to destructured object", + actionName: "Convert parameters to destructured object", + actionDescription: "Convert parameters to destructured object", newContent: `class Foo { constructor(a: number, b: number) { } } diff --git a/tests/cases/fourslash/refactorConvertToNamedParameters_classDeclarationGoodUsages.ts b/tests/cases/fourslash/refactorConvertParamsToDestructuredObject_classDeclarationGoodUsages.ts similarity index 73% rename from tests/cases/fourslash/refactorConvertToNamedParameters_classDeclarationGoodUsages.ts rename to tests/cases/fourslash/refactorConvertParamsToDestructuredObject_classDeclarationGoodUsages.ts index 858bccd60c164..beba49c17e3ed 100644 --- a/tests/cases/fourslash/refactorConvertToNamedParameters_classDeclarationGoodUsages.ts +++ b/tests/cases/fourslash/refactorConvertParamsToDestructuredObject_classDeclarationGoodUsages.ts @@ -14,9 +14,9 @@ goTo.select("a", "b"); edit.applyRefactor({ - refactorName: "Convert to named parameters", - actionName: "Convert to named parameters", - actionDescription: "Convert to named parameters", + refactorName: "Convert parameters to destructured object", + actionName: "Convert parameters to destructured object", + actionDescription: "Convert parameters to destructured object", newContent: `class C { static a: number = 2; constructor({ a, b }: { a: number; b: number; }) { } diff --git a/tests/cases/fourslash/refactorConvertToNamedParameters_classExpression.ts b/tests/cases/fourslash/refactorConvertParamsToDestructuredObject_classExpression.ts similarity index 61% rename from tests/cases/fourslash/refactorConvertToNamedParameters_classExpression.ts rename to tests/cases/fourslash/refactorConvertParamsToDestructuredObject_classExpression.ts index ee4b6051756a2..f779170d643b8 100644 --- a/tests/cases/fourslash/refactorConvertToNamedParameters_classExpression.ts +++ b/tests/cases/fourslash/refactorConvertParamsToDestructuredObject_classExpression.ts @@ -7,9 +7,9 @@ goTo.select("a", "b"); edit.applyRefactor({ - refactorName: "Convert to named parameters", - actionName: "Convert to named parameters", - actionDescription: "Convert to named parameters", + refactorName: "Convert parameters to destructured object", + actionName: "Convert parameters to destructured object", + actionDescription: "Convert parameters to destructured object", newContent: `const c = class { constructor({ a, b = { x: 1 } }: { a: number; b?: { x: number; }; }) { } } diff --git a/tests/cases/fourslash/refactorConvertToNamedParameters_classExpressionGoodUsages.ts b/tests/cases/fourslash/refactorConvertParamsToDestructuredObject_classExpressionGoodUsages.ts similarity index 67% rename from tests/cases/fourslash/refactorConvertToNamedParameters_classExpressionGoodUsages.ts rename to tests/cases/fourslash/refactorConvertParamsToDestructuredObject_classExpressionGoodUsages.ts index f8023b9898c28..ce0054fd92a13 100644 --- a/tests/cases/fourslash/refactorConvertToNamedParameters_classExpressionGoodUsages.ts +++ b/tests/cases/fourslash/refactorConvertParamsToDestructuredObject_classExpressionGoodUsages.ts @@ -10,9 +10,9 @@ goTo.select("a", "b"); edit.applyRefactor({ - refactorName: "Convert to named parameters", - actionName: "Convert to named parameters", - actionDescription: "Convert to named parameters", + refactorName: "Convert parameters to destructured object", + actionName: "Convert parameters to destructured object", + actionDescription: "Convert parameters to destructured object", newContent: `const c = class C { static a: number = 2; constructor({ a, b }: { a: number; b: number; }) { } diff --git a/tests/cases/fourslash/refactorConvertToNamedParameters_classExpressionHeritage.ts b/tests/cases/fourslash/refactorConvertParamsToDestructuredObject_classExpressionHeritage.ts similarity index 68% rename from tests/cases/fourslash/refactorConvertToNamedParameters_classExpressionHeritage.ts rename to tests/cases/fourslash/refactorConvertParamsToDestructuredObject_classExpressionHeritage.ts index 14b9639c2ade0..5318899ffa4b0 100644 --- a/tests/cases/fourslash/refactorConvertToNamedParameters_classExpressionHeritage.ts +++ b/tests/cases/fourslash/refactorConvertParamsToDestructuredObject_classExpressionHeritage.ts @@ -12,9 +12,9 @@ goTo.select("a", "b"); // Refactor should not make changes edit.applyRefactor({ - refactorName: "Convert to named parameters", - actionName: "Convert to named parameters", - actionDescription: "Convert to named parameters", + refactorName: "Convert parameters to destructured object", + actionName: "Convert parameters to destructured object", + actionDescription: "Convert parameters to destructured object", newContent: `const foo = class Foo { constructor(a: number, b: number) { } } diff --git a/tests/cases/fourslash/refactorConvertToNamedParameters_classTypeParameters.ts b/tests/cases/fourslash/refactorConvertParamsToDestructuredObject_classTypeParameters.ts similarity index 63% rename from tests/cases/fourslash/refactorConvertToNamedParameters_classTypeParameters.ts rename to tests/cases/fourslash/refactorConvertParamsToDestructuredObject_classTypeParameters.ts index 7d62621557220..d8c884356bd81 100644 --- a/tests/cases/fourslash/refactorConvertToNamedParameters_classTypeParameters.ts +++ b/tests/cases/fourslash/refactorConvertParamsToDestructuredObject_classTypeParameters.ts @@ -10,9 +10,9 @@ goTo.select("a", "b"); edit.applyRefactor({ - refactorName: "Convert to named parameters", - actionName: "Convert to named parameters", - actionDescription: "Convert to named parameters", + refactorName: "Convert parameters to destructured object", + actionName: "Convert parameters to destructured object", + actionDescription: "Convert parameters to destructured object", newContent: `class Foo { bar({ t, s }: { t: T; s: T; }) { return s; diff --git a/tests/cases/fourslash/refactorConvertToNamedParameters_constructor.ts b/tests/cases/fourslash/refactorConvertParamsToDestructuredObject_constructor.ts similarity index 69% rename from tests/cases/fourslash/refactorConvertToNamedParameters_constructor.ts rename to tests/cases/fourslash/refactorConvertParamsToDestructuredObject_constructor.ts index 86b1f9eb610f9..1503f2fe7ebbe 100644 --- a/tests/cases/fourslash/refactorConvertToNamedParameters_constructor.ts +++ b/tests/cases/fourslash/refactorConvertParamsToDestructuredObject_constructor.ts @@ -12,9 +12,9 @@ goTo.select("a", "b"); edit.applyRefactor({ - refactorName: "Convert to named parameters", - actionName: "Convert to named parameters", - actionDescription: "Convert to named parameters", + refactorName: "Convert parameters to destructured object", + actionName: "Convert parameters to destructured object", + actionDescription: "Convert parameters to destructured object", newContent: `class Foo { t: string; s: string; diff --git a/tests/cases/fourslash/refactorConvertToNamedParameters_defaultClass.ts b/tests/cases/fourslash/refactorConvertParamsToDestructuredObject_defaultClass.ts similarity index 65% rename from tests/cases/fourslash/refactorConvertToNamedParameters_defaultClass.ts rename to tests/cases/fourslash/refactorConvertParamsToDestructuredObject_defaultClass.ts index a056a82871b5e..17c7580fc8830 100644 --- a/tests/cases/fourslash/refactorConvertToNamedParameters_defaultClass.ts +++ b/tests/cases/fourslash/refactorConvertParamsToDestructuredObject_defaultClass.ts @@ -5,4 +5,4 @@ ////} goTo.select("a", "b"); -verify.not.refactorAvailable("Convert to named parameters"); +verify.not.refactorAvailable("Convert parameters to destructured object"); diff --git a/tests/cases/fourslash/refactorConvertToNamedParameters_function.ts b/tests/cases/fourslash/refactorConvertParamsToDestructuredObject_function.ts similarity index 58% rename from tests/cases/fourslash/refactorConvertToNamedParameters_function.ts rename to tests/cases/fourslash/refactorConvertParamsToDestructuredObject_function.ts index 0834bf288fcec..d5eed686068d4 100644 --- a/tests/cases/fourslash/refactorConvertToNamedParameters_function.ts +++ b/tests/cases/fourslash/refactorConvertParamsToDestructuredObject_function.ts @@ -7,9 +7,9 @@ goTo.select("a", "b"); edit.applyRefactor({ - refactorName: "Convert to named parameters", - actionName: "Convert to named parameters", - actionDescription: "Convert to named parameters", + refactorName: "Convert parameters to destructured object", + actionName: "Convert parameters to destructured object", + actionDescription: "Convert parameters to destructured object", newContent: `function f({ a, b }: { a: number; b: string; }): string { return b; } diff --git a/tests/cases/fourslash/refactorConvertToNamedParameters_functionComments.ts b/tests/cases/fourslash/refactorConvertParamsToDestructuredObject_functionComments.ts similarity index 76% rename from tests/cases/fourslash/refactorConvertToNamedParameters_functionComments.ts rename to tests/cases/fourslash/refactorConvertParamsToDestructuredObject_functionComments.ts index 20238ac81de70..5340004a060c3 100644 --- a/tests/cases/fourslash/refactorConvertToNamedParameters_functionComments.ts +++ b/tests/cases/fourslash/refactorConvertParamsToDestructuredObject_functionComments.ts @@ -10,9 +10,9 @@ goTo.select("a", "b"); edit.applyRefactor({ - refactorName: "Convert to named parameters", - actionName: "Convert to named parameters", - actionDescription: "Convert to named parameters", + refactorName: "Convert parameters to destructured object", + actionName: "Convert parameters to destructured object", + actionDescription: "Convert parameters to destructured object", newContent: `foo({ a: 1, b: 2 }); /**a*/ /**b*/ function foo(/**this1*/ this /**this2*/: /**void1*/ void /**void2*/, { a, b = /**k*/ 1 /**l*/ }: { /**c*/ a /**d*/: /**e*/ number /**f*/; /**g*/ b /**h*/?: /**i*/ number /**j*/; }) { // m diff --git a/tests/cases/fourslash/refactorConvertToNamedParameters_functionComments1.ts b/tests/cases/fourslash/refactorConvertParamsToDestructuredObject_functionComments1.ts similarity index 58% rename from tests/cases/fourslash/refactorConvertToNamedParameters_functionComments1.ts rename to tests/cases/fourslash/refactorConvertParamsToDestructuredObject_functionComments1.ts index e0d34c8fe6531..07bc755c07677 100644 --- a/tests/cases/fourslash/refactorConvertToNamedParameters_functionComments1.ts +++ b/tests/cases/fourslash/refactorConvertParamsToDestructuredObject_functionComments1.ts @@ -6,9 +6,9 @@ goTo.select("a", "b"); edit.applyRefactor({ - refactorName: "Convert to named parameters", - actionName: "Convert to named parameters", - actionDescription: "Convert to named parameters", + refactorName: "Convert parameters to destructured object", + actionName: "Convert parameters to destructured object", + actionDescription: "Convert parameters to destructured object", newContent: `function foo({ a, b }: { a: number /** a */; b: number /** b */; }) { return a + b; }` diff --git a/tests/cases/fourslash/refactorConvertToNamedParameters_functionComments2.ts b/tests/cases/fourslash/refactorConvertParamsToDestructuredObject_functionComments2.ts similarity index 63% rename from tests/cases/fourslash/refactorConvertToNamedParameters_functionComments2.ts rename to tests/cases/fourslash/refactorConvertParamsToDestructuredObject_functionComments2.ts index 923b49b41988b..c01ddf6735c0b 100644 --- a/tests/cases/fourslash/refactorConvertToNamedParameters_functionComments2.ts +++ b/tests/cases/fourslash/refactorConvertParamsToDestructuredObject_functionComments2.ts @@ -11,9 +11,9 @@ goTo.select("a", "b"); edit.applyRefactor({ - refactorName: "Convert to named parameters", - actionName: "Convert to named parameters", - actionDescription: "Convert to named parameters", + refactorName: "Convert parameters to destructured object", + actionName: "Convert parameters to destructured object", + actionDescription: "Convert parameters to destructured object", newContent: `function foo(// comment { a, b }: { // a comment diff --git a/tests/cases/fourslash/refactorConvertToNamedParameters_functionExpression.ts b/tests/cases/fourslash/refactorConvertParamsToDestructuredObject_functionExpression.ts similarity index 56% rename from tests/cases/fourslash/refactorConvertToNamedParameters_functionExpression.ts rename to tests/cases/fourslash/refactorConvertParamsToDestructuredObject_functionExpression.ts index e8aa6a92dd831..c4e81cf79262b 100644 --- a/tests/cases/fourslash/refactorConvertToNamedParameters_functionExpression.ts +++ b/tests/cases/fourslash/refactorConvertParamsToDestructuredObject_functionExpression.ts @@ -5,9 +5,9 @@ goTo.select("a", "b"); edit.applyRefactor({ - refactorName: "Convert to named parameters", - actionName: "Convert to named parameters", - actionDescription: "Convert to named parameters", + refactorName: "Convert parameters to destructured object", + actionName: "Convert parameters to destructured object", + actionDescription: "Convert parameters to destructured object", newContent: `const foo = function({ a, b }: { a: number; b: number; }) { }; foo({ a: 1, b: 2 });` }); \ No newline at end of file diff --git a/tests/cases/fourslash/refactorConvertToNamedParameters_functionTypeParameters.ts b/tests/cases/fourslash/refactorConvertParamsToDestructuredObject_functionTypeParameters.ts similarity index 57% rename from tests/cases/fourslash/refactorConvertToNamedParameters_functionTypeParameters.ts rename to tests/cases/fourslash/refactorConvertParamsToDestructuredObject_functionTypeParameters.ts index a1597fdeed12e..9a27ae4f09ed2 100644 --- a/tests/cases/fourslash/refactorConvertToNamedParameters_functionTypeParameters.ts +++ b/tests/cases/fourslash/refactorConvertParamsToDestructuredObject_functionTypeParameters.ts @@ -7,9 +7,9 @@ goTo.select("a", "b"); edit.applyRefactor({ - refactorName: "Convert to named parameters", - actionName: "Convert to named parameters", - actionDescription: "Convert to named parameters", + refactorName: "Convert parameters to destructured object", + actionName: "Convert parameters to destructured object", + actionDescription: "Convert parameters to destructured object", newContent: `function foo({ t, s }: { t: T; s: S; }) { return s; } diff --git a/tests/cases/fourslash/refactorConvertToNamedParameters_inheritedConstructor.ts b/tests/cases/fourslash/refactorConvertParamsToDestructuredObject_inheritedConstructor.ts similarity index 73% rename from tests/cases/fourslash/refactorConvertToNamedParameters_inheritedConstructor.ts rename to tests/cases/fourslash/refactorConvertParamsToDestructuredObject_inheritedConstructor.ts index bde7839a60e07..6e27c33078a14 100644 --- a/tests/cases/fourslash/refactorConvertToNamedParameters_inheritedConstructor.ts +++ b/tests/cases/fourslash/refactorConvertParamsToDestructuredObject_inheritedConstructor.ts @@ -12,9 +12,9 @@ goTo.select("a", "b"); `new Bar("a", "b")` should be modified by the refactor to be `new Bar({ t: "a", s: "b" })` */ edit.applyRefactor({ - refactorName: "Convert to named parameters", - actionName: "Convert to named parameters", - actionDescription: "Convert to named parameters", + refactorName: "Convert parameters to destructured object", + actionName: "Convert parameters to destructured object", + actionDescription: "Convert parameters to destructured object", newContent: `class Foo { constructor({ t, s }: { t: string; s: string; }) { } } diff --git a/tests/cases/fourslash/refactorConvertToNamedParameters_inheritedMethod.ts b/tests/cases/fourslash/refactorConvertParamsToDestructuredObject_inheritedMethod.ts similarity index 68% rename from tests/cases/fourslash/refactorConvertToNamedParameters_inheritedMethod.ts rename to tests/cases/fourslash/refactorConvertParamsToDestructuredObject_inheritedMethod.ts index 3214ea4bf53af..a04560886c087 100644 --- a/tests/cases/fourslash/refactorConvertToNamedParameters_inheritedMethod.ts +++ b/tests/cases/fourslash/refactorConvertParamsToDestructuredObject_inheritedMethod.ts @@ -11,9 +11,9 @@ goTo.select("a", "b"); edit.applyRefactor({ - refactorName: "Convert to named parameters", - actionName: "Convert to named parameters", - actionDescription: "Convert to named parameters", + refactorName: "Convert parameters to destructured object", + actionName: "Convert parameters to destructured object", + actionDescription: "Convert parameters to destructured object", newContent: `class Foo { bar({ t, s }: { t: string; s: string; }): string { return s + t; diff --git a/tests/cases/fourslash/refactorConvertToNamedParameters_initializer.ts b/tests/cases/fourslash/refactorConvertParamsToDestructuredObject_initializer.ts similarity index 59% rename from tests/cases/fourslash/refactorConvertToNamedParameters_initializer.ts rename to tests/cases/fourslash/refactorConvertParamsToDestructuredObject_initializer.ts index 1e63f44fc3560..3f0da9f13a391 100644 --- a/tests/cases/fourslash/refactorConvertToNamedParameters_initializer.ts +++ b/tests/cases/fourslash/refactorConvertParamsToDestructuredObject_initializer.ts @@ -7,9 +7,9 @@ goTo.select("a", "b"); edit.applyRefactor({ - refactorName: "Convert to named parameters", - actionName: "Convert to named parameters", - actionDescription: "Convert to named parameters", + refactorName: "Convert parameters to destructured object", + actionName: "Convert parameters to destructured object", + actionDescription: "Convert parameters to destructured object", newContent: `function f({ a, b = "1" }: { a: number; b?: string; }): string { return b; } diff --git a/tests/cases/fourslash/refactorConvertToNamedParameters_initializerInference.ts b/tests/cases/fourslash/refactorConvertParamsToDestructuredObject_initializerInference.ts similarity index 62% rename from tests/cases/fourslash/refactorConvertToNamedParameters_initializerInference.ts rename to tests/cases/fourslash/refactorConvertParamsToDestructuredObject_initializerInference.ts index b6bdb7a88c2ef..f2b92fc89e718 100644 --- a/tests/cases/fourslash/refactorConvertToNamedParameters_initializerInference.ts +++ b/tests/cases/fourslash/refactorConvertParamsToDestructuredObject_initializerInference.ts @@ -7,9 +7,9 @@ goTo.select("a", "b"); edit.applyRefactor({ - refactorName: "Convert to named parameters", - actionName: "Convert to named parameters", - actionDescription: "Convert to named parameters", + refactorName: "Convert parameters to destructured object", + actionName: "Convert parameters to destructured object", + actionDescription: "Convert parameters to destructured object", newContent: `function f({ a, b = { x: 1, z: { s: true } } }: { a: number; b?: { x: number; z: { s: boolean; }; }; }) { return b; } diff --git a/tests/cases/fourslash/refactorConvertToNamedParameters_method.ts b/tests/cases/fourslash/refactorConvertParamsToDestructuredObject_method.ts similarity index 65% rename from tests/cases/fourslash/refactorConvertToNamedParameters_method.ts rename to tests/cases/fourslash/refactorConvertParamsToDestructuredObject_method.ts index d7dce948cae3e..f3f78de391e45 100644 --- a/tests/cases/fourslash/refactorConvertToNamedParameters_method.ts +++ b/tests/cases/fourslash/refactorConvertParamsToDestructuredObject_method.ts @@ -10,9 +10,9 @@ goTo.select("a", "b"); edit.applyRefactor({ - refactorName: "Convert to named parameters", - actionName: "Convert to named parameters", - actionDescription: "Convert to named parameters", + refactorName: "Convert parameters to destructured object", + actionName: "Convert parameters to destructured object", + actionDescription: "Convert parameters to destructured object", newContent: `class Foo { bar({ t, s }: { t: string; s: string; }): string { return s + t; diff --git a/tests/cases/fourslash/refactorConvertToNamedParameters_methodCallUnion.ts b/tests/cases/fourslash/refactorConvertParamsToDestructuredObject_methodCallUnion.ts similarity index 70% rename from tests/cases/fourslash/refactorConvertToNamedParameters_methodCallUnion.ts rename to tests/cases/fourslash/refactorConvertParamsToDestructuredObject_methodCallUnion.ts index e4cafbeff3e94..031b50dc45e58 100644 --- a/tests/cases/fourslash/refactorConvertToNamedParameters_methodCallUnion.ts +++ b/tests/cases/fourslash/refactorConvertParamsToDestructuredObject_methodCallUnion.ts @@ -14,9 +14,9 @@ goTo.select("a", "b"); // Refactor should not make changes edit.applyRefactor({ - refactorName: "Convert to named parameters", - actionName: "Convert to named parameters", - actionDescription: "Convert to named parameters", + refactorName: "Convert parameters to destructured object", + actionName: "Convert parameters to destructured object", + actionDescription: "Convert parameters to destructured object", newContent: `class A { foo(a: number, b: number) { return a + b; } } diff --git a/tests/cases/fourslash/refactorConvertToNamedParameters_methodCalls.ts b/tests/cases/fourslash/refactorConvertParamsToDestructuredObject_methodCalls.ts similarity index 68% rename from tests/cases/fourslash/refactorConvertToNamedParameters_methodCalls.ts rename to tests/cases/fourslash/refactorConvertParamsToDestructuredObject_methodCalls.ts index f84e0d7b02349..d1347ad877be2 100644 --- a/tests/cases/fourslash/refactorConvertToNamedParameters_methodCalls.ts +++ b/tests/cases/fourslash/refactorConvertParamsToDestructuredObject_methodCalls.ts @@ -11,9 +11,9 @@ goTo.select("a", "b"); edit.applyRefactor({ - refactorName: "Convert to named parameters", - actionName: "Convert to named parameters", - actionDescription: "Convert to named parameters", + refactorName: "Convert parameters to destructured object", + actionName: "Convert parameters to destructured object", + actionDescription: "Convert parameters to destructured object", newContent: `class Foo { bar({ t, s }: { t: string; s: string; }): string { return s + t; diff --git a/tests/cases/fourslash/refactorConvertToNamedParameters_methodOverrides.ts b/tests/cases/fourslash/refactorConvertParamsToDestructuredObject_methodOverrides.ts similarity index 62% rename from tests/cases/fourslash/refactorConvertToNamedParameters_methodOverrides.ts rename to tests/cases/fourslash/refactorConvertParamsToDestructuredObject_methodOverrides.ts index b6daac17dd494..1941c85b28e5b 100644 --- a/tests/cases/fourslash/refactorConvertToNamedParameters_methodOverrides.ts +++ b/tests/cases/fourslash/refactorConvertParamsToDestructuredObject_methodOverrides.ts @@ -13,9 +13,9 @@ goTo.select("a", "b"); edit.applyRefactor({ - refactorName: "Convert to named parameters", - actionName: "Convert to named parameters", - actionDescription: "Convert to named parameters", + refactorName: "Convert parameters to destructured object", + actionName: "Convert parameters to destructured object", + actionDescription: "Convert parameters to destructured object", newContent: `class A { foo(a: number, b: number) { } } @@ -29,9 +29,9 @@ b.foo(5, 6);` }); goTo.select("c", "d"); edit.applyRefactor({ - refactorName: "Convert to named parameters", - actionName: "Convert to named parameters", - actionDescription: "Convert to named parameters", + refactorName: "Convert parameters to destructured object", + actionName: "Convert parameters to destructured object", + actionDescription: "Convert parameters to destructured object", newContent: `class A { foo(a: number, b: number) { } } diff --git a/tests/cases/fourslash/refactorConvertToNamedParameters_overloads.ts b/tests/cases/fourslash/refactorConvertParamsToDestructuredObject_overloads.ts similarity index 68% rename from tests/cases/fourslash/refactorConvertToNamedParameters_overloads.ts rename to tests/cases/fourslash/refactorConvertParamsToDestructuredObject_overloads.ts index 772f8ea884818..3655ecc0c584a 100644 --- a/tests/cases/fourslash/refactorConvertToNamedParameters_overloads.ts +++ b/tests/cases/fourslash/refactorConvertParamsToDestructuredObject_overloads.ts @@ -7,4 +7,4 @@ ////f(2); goTo.select("a", "b"); -verify.not.refactorAvailable("Convert to named parameters"); \ No newline at end of file +verify.not.refactorAvailable("Convert parameters to destructured object"); \ No newline at end of file diff --git a/tests/cases/fourslash/refactorConvertToNamedParameters_paramDecorator.ts b/tests/cases/fourslash/refactorConvertParamsToDestructuredObject_paramDecorator.ts similarity index 75% rename from tests/cases/fourslash/refactorConvertToNamedParameters_paramDecorator.ts rename to tests/cases/fourslash/refactorConvertParamsToDestructuredObject_paramDecorator.ts index 180798af95d05..c8d7333c9f779 100644 --- a/tests/cases/fourslash/refactorConvertToNamedParameters_paramDecorator.ts +++ b/tests/cases/fourslash/refactorConvertParamsToDestructuredObject_paramDecorator.ts @@ -8,4 +8,4 @@ ////} goTo.select("a", "b"); -verify.not.refactorAvailable("Convert to named parameters"); \ No newline at end of file +verify.not.refactorAvailable("Convert parameters to destructured object"); \ No newline at end of file diff --git a/tests/cases/fourslash/refactorConvertToNamedParameters_recursiveFunction.ts b/tests/cases/fourslash/refactorConvertParamsToDestructuredObject_recursiveFunction.ts similarity index 64% rename from tests/cases/fourslash/refactorConvertToNamedParameters_recursiveFunction.ts rename to tests/cases/fourslash/refactorConvertParamsToDestructuredObject_recursiveFunction.ts index d1513cb7bf0c0..7655af0510081 100644 --- a/tests/cases/fourslash/refactorConvertToNamedParameters_recursiveFunction.ts +++ b/tests/cases/fourslash/refactorConvertParamsToDestructuredObject_recursiveFunction.ts @@ -9,9 +9,9 @@ goTo.select("a", "b"); edit.applyRefactor({ - refactorName: "Convert to named parameters", - actionName: "Convert to named parameters", - actionDescription: "Convert to named parameters", + refactorName: "Convert parameters to destructured object", + actionName: "Convert parameters to destructured object", + actionDescription: "Convert parameters to destructured object", newContent: `const f = function foo({ a, b }: { a: number; b: number; }) { foo({ a: 1, b: 2 }); } diff --git a/tests/cases/fourslash/refactorConvertToNamedParameters_restParamInference.ts b/tests/cases/fourslash/refactorConvertParamsToDestructuredObject_restParamInference.ts similarity index 64% rename from tests/cases/fourslash/refactorConvertToNamedParameters_restParamInference.ts rename to tests/cases/fourslash/refactorConvertParamsToDestructuredObject_restParamInference.ts index 36ed5084fe202..1c6350d89f57b 100644 --- a/tests/cases/fourslash/refactorConvertToNamedParameters_restParamInference.ts +++ b/tests/cases/fourslash/refactorConvertParamsToDestructuredObject_restParamInference.ts @@ -6,9 +6,9 @@ goTo.select("a", "b"); edit.applyRefactor({ - refactorName: "Convert to named parameters", - actionName: "Convert to named parameters", - actionDescription: "Convert to named parameters", + refactorName: "Convert parameters to destructured object", + actionName: "Convert parameters to destructured object", + actionDescription: "Convert parameters to destructured object", newContent: `function log({ a, b, args = [] }: { a: number; b: number; args?: any[]; }) { } let l = log({ a: -1, b: -2, args: [3, 4, 5] }); let k = log({ a: 1, b: 2 });` diff --git a/tests/cases/fourslash/refactorConvertToNamedParameters_staticMethod.ts b/tests/cases/fourslash/refactorConvertParamsToDestructuredObject_staticMethod.ts similarity index 64% rename from tests/cases/fourslash/refactorConvertToNamedParameters_staticMethod.ts rename to tests/cases/fourslash/refactorConvertParamsToDestructuredObject_staticMethod.ts index c84c1aa20d4c1..8c19582c145b9 100644 --- a/tests/cases/fourslash/refactorConvertToNamedParameters_staticMethod.ts +++ b/tests/cases/fourslash/refactorConvertParamsToDestructuredObject_staticMethod.ts @@ -9,9 +9,9 @@ goTo.select("a", "b"); edit.applyRefactor({ - refactorName: "Convert to named parameters", - actionName: "Convert to named parameters", - actionDescription: "Convert to named parameters", + refactorName: "Convert parameters to destructured object", + actionName: "Convert parameters to destructured object", + actionDescription: "Convert parameters to destructured object", newContent: `class Foo { static bar({ t, s }: { t: string; s: string; }): string { return s + t; diff --git a/tests/cases/fourslash/refactorConvertToNamedParameters_superCall.ts b/tests/cases/fourslash/refactorConvertParamsToDestructuredObject_superCall.ts similarity index 69% rename from tests/cases/fourslash/refactorConvertToNamedParameters_superCall.ts rename to tests/cases/fourslash/refactorConvertParamsToDestructuredObject_superCall.ts index c5d15903ef55b..56227a9078a25 100644 --- a/tests/cases/fourslash/refactorConvertToNamedParameters_superCall.ts +++ b/tests/cases/fourslash/refactorConvertParamsToDestructuredObject_superCall.ts @@ -11,9 +11,9 @@ goTo.select("a", "b"); edit.applyRefactor({ - refactorName: "Convert to named parameters", - actionName: "Convert to named parameters", - actionDescription: "Convert to named parameters", + refactorName: "Convert parameters to destructured object", + actionName: "Convert parameters to destructured object", + actionDescription: "Convert parameters to destructured object", newContent: `class A { constructor({ a, b }: { a: string; b: string; }) { } } diff --git a/tests/cases/fourslash/refactorConvertToNamedParameters_thisParam.ts b/tests/cases/fourslash/refactorConvertParamsToDestructuredObject_thisParam.ts similarity index 60% rename from tests/cases/fourslash/refactorConvertToNamedParameters_thisParam.ts rename to tests/cases/fourslash/refactorConvertParamsToDestructuredObject_thisParam.ts index e4a96bc7bf133..05a6620707ffd 100644 --- a/tests/cases/fourslash/refactorConvertToNamedParameters_thisParam.ts +++ b/tests/cases/fourslash/refactorConvertParamsToDestructuredObject_thisParam.ts @@ -7,9 +7,9 @@ goTo.select("a", "b"); edit.applyRefactor({ - refactorName: "Convert to named parameters", - actionName: "Convert to named parameters", - actionDescription: "Convert to named parameters", + refactorName: "Convert parameters to destructured object", + actionName: "Convert parameters to destructured object", + actionDescription: "Convert parameters to destructured object", newContent: `function foo(this: void, { t, s }: { t: string; s: string; }) { return s; } diff --git a/tests/cases/fourslash/refactorConvertToNamedParameters_typedRestParam.ts b/tests/cases/fourslash/refactorConvertParamsToDestructuredObject_typedRestParam.ts similarity index 75% rename from tests/cases/fourslash/refactorConvertToNamedParameters_typedRestParam.ts rename to tests/cases/fourslash/refactorConvertParamsToDestructuredObject_typedRestParam.ts index 34e0331f466d4..88401d83c4bc6 100644 --- a/tests/cases/fourslash/refactorConvertToNamedParameters_typedRestParam.ts +++ b/tests/cases/fourslash/refactorConvertParamsToDestructuredObject_typedRestParam.ts @@ -6,9 +6,9 @@ goTo.select("a", "b"); edit.applyRefactor({ - refactorName: "Convert to named parameters", - actionName: "Convert to named parameters", - actionDescription: "Convert to named parameters", + refactorName: "Convert parameters to destructured object", + actionName: "Convert parameters to destructured object", + actionDescription: "Convert parameters to destructured object", newContent: `function buildName({ firstName, middleName, restOfName = [] }: { firstName: string; middleName?: string; restOfName?: string[]; }) { } let employeeName = buildName({ firstName: "Joseph", middleName: "Samuel", restOfName: ["Lucas", "MacKinzie"] }); let myName = buildName({ firstName: "Joseph" });` diff --git a/tests/cases/fourslash/refactorConvertToNamedParameters_varArrowFunction.ts b/tests/cases/fourslash/refactorConvertParamsToDestructuredObject_varArrowFunction.ts similarity index 61% rename from tests/cases/fourslash/refactorConvertToNamedParameters_varArrowFunction.ts rename to tests/cases/fourslash/refactorConvertParamsToDestructuredObject_varArrowFunction.ts index ec25b50b067b8..abe870574f0ef 100644 --- a/tests/cases/fourslash/refactorConvertToNamedParameters_varArrowFunction.ts +++ b/tests/cases/fourslash/refactorConvertParamsToDestructuredObject_varArrowFunction.ts @@ -4,4 +4,4 @@ ////foo(1, 2); goTo.select("a", "b"); -verify.not.refactorAvailable("Convert to named parameters"); +verify.not.refactorAvailable("Convert parameters to destructured object");