Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>TypeScript GetSetNew to Visual Studio Code? Get it now.
TypeScript GetSet

TypeScript GetSet

z0gSh1u

|
2,798 installs
| (1) | Free
TypeScript getter / setter generator based on AST
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

vscode-ts-getset

vscode-ts-getset can generate getter and setter for a TypeScript class. It works based on AST (TypeScript Complier API) instead of Regular Expressions.

How to Start

  • Put your input cursor at the first line of class declaration.
  • Run VSCode command Generate Getter Only / Generate Setter Only / Generate Getter & Setter as you want. (Press [F1] on Windows to open VSCode command prompt.)

Features

  • Reliable class property collecting based on TSC API.
  • Generations products are inserted automatically at the end of property declarations with pretty alignment.
  • Nice error message.
  • NOTICE THAT only those class declarations at top level are supported currently.
  • Only private and protected properties are concerned. And their names should start with an underscore (_).

TODO

Contributions are strongly welcomed!

  • [ ] support local class declaration
  • [ ] use AST instead of regex to get class name

License

MIT

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft