TypeScript/tests/cases/fourslash/refactorConvertParamsToDestructuredObject_methodCalls.ts

25 lines
686 B
TypeScript
Raw Normal View History

/// <reference path='fourslash.ts' />
////class Foo {
//// /*a*/bar/*b*/(t: string, s: string): string {
//// return s + t;
//// }
////}
////var foo = new Foo();
////foo['bar']("a", "b");
2019-01-30 01:45:52 +01:00
////foo.bar("a", "b");
goTo.select("a", "b");
edit.applyRefactor({
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;
}
}
var foo = new Foo();
2019-01-30 01:45:52 +01:00
foo['bar']({ t: "a", s: "b" });
foo.bar({ t: "a", s: "b" });`
});