2019-02-25 23:14:28 +01:00
|
|
|
/// <reference path='fourslash.ts' />
|
|
|
|
|
|
|
|
////const c = class C {
|
|
|
|
//// static a: number = 2;
|
|
|
|
//// /*a*/constructor/*b*/(a: number, b: number) { }
|
|
|
|
////}
|
|
|
|
////const a = new c(0, 1);
|
|
|
|
////const b = c.a;
|
|
|
|
////c["a"] = 3;
|
|
|
|
|
|
|
|
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-25 23:14:28 +01:00
|
|
|
newContent: `const c = class C {
|
|
|
|
static a: number = 2;
|
|
|
|
constructor({ a, b }: { a: number; b: number; }) { }
|
|
|
|
}
|
|
|
|
const a = new c({ a: 0, b: 1 });
|
|
|
|
const b = c.a;
|
|
|
|
c["a"] = 3;`
|
|
|
|
});
|