2019-01-29 00:53:39 +01:00
|
|
|
/// <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");
|
2019-01-29 00:53:39 +01:00
|
|
|
|
|
|
|
goTo.select("a", "b");
|
|
|
|
edit.applyRefactor({
|
2019-03-14 21:41:29 +01:00
|
|
|
refactorName: "Convert parameters to destructured object",
|
|
|
|
actionName: "Convert parameters to destructured object",
|
|
|
|
actionDescription: "Convert parameters to destructured object",
|
2019-01-29 00:53:39 +01:00
|
|
|
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" });`
|
2019-01-29 00:53:39 +01:00
|
|
|
});
|