Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Class HelperNew to Visual Studio Code? Get it now.
Class Helper

Class Helper

Predrag Nikolic

|
52,327 installs
| (3) | Free
Be more productive in writing PHP, JavaScript and TypeScript code with a simple keybinding.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

NOTABLE CHANGES IN LATEST RELEASE

Added:

  • Keybinding to add private properties. Default is ctrl+alt+c.

Class Helper supports:

  • JavaScript
  • TypeScript
  • PHP (needs PHP Intelephense to work)

Add Class

What does Class Helper do?

  • Add a class if the cursor is out of the scope of another class.

Add Class

  • Add a constructor if the cursor is in scope of a class and there is no constructor.

Add Constructor

  • Add properties if the cursor is in scope of a class and if the class has a constructor. Multiline constructor is also supported.

Add Properties

  • Add methods. Public methods are always placed before the first private method.

Add Methods

  • Add getters and setters.
    • Getters and setters are placed after a constructor if the constructor exist, if not, they are placed after the last propery.
    • If the class has a missing getter or setter for a property, then the missing getter or setter will be added.
    • If the class has a getter and a setter for a property, nothing will be added.

Add Getters And Setters

How do you do all of that?

  • The keybinding to add a class, constructor and properties is alt+c.
  • The keybinding to add a private properties is ctrl+alt+c.
  • The keybinding to add a method is alt+m.
  • The keybinding to add a private method is ctrl+alt+m.
  • The keybinding to add a getter and setter is alt+m, and the cursor (not the mouse) must be above the property.

You are free to change the keybindings however you like.

Settings

PHP specific settings:

{
    // Php: default property visibility
    "class-helper.php.property.visibility": "public",
}

TypeScript specific settings:

{
    // TypeScript: prefix method and properties with public or private keywords
    "class-helper.ts.prefixVisibility": true,

    // TypeScript: default property visibility
    "class-helper.ts.property.visibility": "public",

    // TypeScript: prefix method with the type declaration
    "class-helper.ts.method.prefixType": true,
}

Idea

This extension is inspired by sublime php companion package.

Hope you like it :)

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