* recursively look for inherited constructor references * add test * remove outdated comment * add tests * move function * improve tests * minor refactor * fix convert params refactoring to deal with inherited constructor calls * simplify refactor test
21 lines
666 B
TypeScript
21 lines
666 B
TypeScript
/// <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({
|
|
refactorName: "Convert parameters to destructured object",
|
|
actionName: "Convert parameters to destructured object",
|
|
actionDescription: "Convert parameters to destructured object",
|
|
newContent: `class Foo {
|
|
constructor({ t, s }: { t: string; s: string; }) { }
|
|
}
|
|
class Bar extends Foo { }
|
|
var bar = new Bar({ t: "a", s: "b" });
|
|
var foo = new Foo({ t: "c", s: "d" });`
|
|
}); |