2019-02-19 23:22:59 +01:00
|
|
|
/// <reference path='fourslash.ts' />
|
|
|
|
|
|
|
|
////class Foo {
|
|
|
|
//// /*a*/constructor/*b*/(t: string, s: string) { }
|
|
|
|
////}
|
|
|
|
////class Bar extends Foo { }
|
|
|
|
////var bar = new Bar("a", "b");
|
|
|
|
////var foo = new Foo("c", "d");
|
|
|
|
|
|
|
|
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-02-19 23:22:59 +01:00
|
|
|
newContent: `class Foo {
|
|
|
|
constructor({ t, s }: { t: string; s: string; }) { }
|
|
|
|
}
|
|
|
|
class Bar extends Foo { }
|
2019-03-22 23:17:50 +01:00
|
|
|
var bar = new Bar({ t: "a", s: "b" });
|
2019-02-25 19:32:28 +01:00
|
|
|
var foo = new Foo({ t: "c", s: "d" });`
|
2019-02-19 23:22:59 +01:00
|
|
|
});
|