-
Notifications
You must be signed in to change notification settings - Fork 13k
Closed
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: Refactoringse.g. extract to constant or function, rename symbole.g. extract to constant or function, rename symbol
Milestone
Description
TypeScript Version: 3.6.2
Search Terms: VSCode generate accessors
Logged issue with VSCode repo, but they asked my to create an issue "upstream"
microsoft/vscode#81135
Steps to Reproduce:
- Create private field with readonly modifier
- Highlight line and generate accessors
- get property created without set property ( correct ), but readonly modifier removed from field
Code
// before
class MyClass {
private readonly _myField: number;
}
// after
class MyClass {
private _myField: number;
public get myField() {
return this._myField;
}
}
Expected behavior:
readonly
modifier should remain on private field.
GET accessor created
SET accessor NOT created
Actual behavior:
readonly
modifier is removed.
GET accessor created
SET accessor NOT created
Playground Link:
Related Issues:
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: Refactoringse.g. extract to constant or function, rename symbole.g. extract to constant or function, rename symbol