TypeScript/tests/cases/fourslash/refactorConvertParamsToDestructuredObject_superCall.ts
Gabriela Araujo Britto 84087d0e0a
Use shorthand property assignment in convert parameters to object (#30468)
* create shorthand property assignment in argument object when possible

* add shorthand property assignment test

* don't offer refactor on jsdoc comment

* add jsdoc test

* improve jsdoc test

* use crlf
2019-03-19 09:28:09 -07:00

25 lines
694 B
TypeScript

/// <reference path='fourslash.ts' />
////class A {
//// constructor(/*a*/a: string, b: string/*b*/) { }
////}
////class B extends A {
//// constructor(a: string, b: string, c: string) {
//// super(a, b);
//// }
////}
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 A {
constructor({ a, b }: { a: string; b: string; }) { }
}
class B extends A {
constructor(a: string, b: string, c: string) {
super({ a, b });
}
}`
});