2019-02-11 21:03:09 +01:00
|
|
|
/// <reference path='fourslash.ts' />
|
|
|
|
|
|
|
|
////function /*a*/foo/*b*/(// comment
|
2019-02-16 00:36:11 +01:00
|
|
|
//// // a comment
|
|
|
|
//// a: number,
|
|
|
|
//// // b comment
|
|
|
|
//// b: number
|
|
|
|
////) {
|
|
|
|
//// return a + b;
|
|
|
|
////}
|
2019-02-11 21:03:09 +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-02-11 21:03:09 +01:00
|
|
|
newContent: `function foo(// comment
|
2019-02-16 00:36:11 +01:00
|
|
|
{ a, b }: {
|
|
|
|
// a comment
|
|
|
|
a: number;
|
|
|
|
// b comment
|
|
|
|
b: number;
|
|
|
|
}) {
|
|
|
|
return a + b;
|
|
|
|
}`
|
2019-02-11 21:03:09 +01:00
|
|
|
});
|