2019-03-04 18:34:04 +01:00
|
|
|
/// <reference path='fourslash.ts' />
|
|
|
|
|
|
|
|
////class A {
|
|
|
|
//// /*a*/foo/*b*/(a: number, b: number) { return a + b; }
|
|
|
|
////}
|
|
|
|
////class B {
|
|
|
|
//// foo(c: number, d: number) { return c + d; }
|
|
|
|
////}
|
2019-03-22 23:17:50 +01:00
|
|
|
////declare var ab: A | B;
|
|
|
|
////ab.foo(1, 2);
|
2019-03-04 18:34:04 +01:00
|
|
|
|
|
|
|
|
|
|
|
goTo.select("a", "b");
|
|
|
|
// Refactor should not make changes
|
|
|
|
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-03-04 18:34:04 +01:00
|
|
|
newContent: `class A {
|
|
|
|
foo(a: number, b: number) { return a + b; }
|
|
|
|
}
|
|
|
|
class B {
|
|
|
|
foo(c: number, d: number) { return c + d; }
|
|
|
|
}
|
2019-03-22 23:17:50 +01:00
|
|
|
declare var ab: A | B;
|
|
|
|
ab.foo(1, 2);`
|
2019-03-04 18:34:04 +01:00
|
|
|
});
|