9c0671d661
* add refactor of convert private field to getter and setter * fix refactor * stash * refactor accessor generate * revert merge union type * refeactor and accept baseline * add support of PropertyAssignment and StringLiteral * add support for js file * allow static modifier in js file
27 lines
584 B
TypeScript
27 lines
584 B
TypeScript
/// <reference path='fourslash.ts' />
|
|
// @allowJs: true
|
|
// @Filename: a.js
|
|
//// /** Class comment */
|
|
//// class A {
|
|
//// // Field comment
|
|
//// /*a*/a/*b*/ = 1;
|
|
//// }
|
|
|
|
goTo.select("a", "b");
|
|
edit.applyRefactor({
|
|
refactorName: "Generate 'get' and 'set' accessors",
|
|
actionName: "Generate 'get' and 'set' accessors",
|
|
actionDescription: "Generate 'get' and 'set' accessors",
|
|
newContent: `/** Class comment */
|
|
class A {
|
|
// Field comment
|
|
/*RENAME*/_a = 1;
|
|
get a() {
|
|
return this._a;
|
|
}
|
|
set a(value) {
|
|
this._a = value;
|
|
}
|
|
}`,
|
|
});
|