23 lines
509 B
TypeScript
23 lines
509 B
TypeScript
|
/// <reference path='fourslash.ts' />
|
||
|
// @allowJs: true
|
||
|
// @Filename: a.js
|
||
|
//// const A = {
|
||
|
//// /*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: `const A = {
|
||
|
/*RENAME*/"_a": 1,
|
||
|
get "a"() {
|
||
|
return this["_a"];
|
||
|
},
|
||
|
set "a"(value) {
|
||
|
this["_a"] = value;
|
||
|
},
|
||
|
};`,
|
||
|
});
|