ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

OOJS

by avenauche ST2/ST3

Sublime Text Plugin to generate Get/Set methods

Details

  • 2013.11.27.17.28.06
  • github.​com
  • github.​com
  • 4 years ago
  • 1 hour ago
  • 4 years ago

Installs

  • Total 201
  • Win 133
  • OS X 34
  • Linux 34
Oct 22 Oct 21 Oct 20 Oct 19 Oct 18 Oct 17 Oct 16 Oct 15 Oct 14 Oct 13 Oct 12 Oct 11 Oct 10 Oct 9 Oct 8 Oct 7 Oct 6 Oct 5 Oct 4 Oct 3 Oct 2 Oct 1 Sep 30 Sep 29 Sep 28 Sep 27 Sep 26 Sep 25 Sep 24 Sep 23 Sep 22 Sep 21 Sep 20 Sep 19 Sep 18 Sep 17 Sep 16 Sep 15 Sep 14 Sep 13 Sep 12 Sep 11 Sep 10 Sep 9 Sep 8
Windows 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
OS X 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Linux 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

Readme

Source
raw.​githubusercontent.​com

OOJS - Sublime Text plugin

Sublime Text Plugin to generate Get/Set methods

OOJS helps developers to generate Getters and Setters in Object Oriented JavaScript fashion. This plugin is an enhanced version of existing proto snippet.

Install

Install OOJS with Package Control and restart Sublime.

Getting started

Example

# example.js

var exampleNode = function(){
    this.prop1;
    this.prop2;
    this.prop3;
};

/*In this case, the generated code will look like the following*/

exampleNode.prototype.getProp1 = function(){
    return this.prop1;
};

exampleNode.prototype.setProp1(prop1){
    this.prop1 = prop1;    
};

Tips

Keyboard Shortcuts

ctrl+alt+z will generate the getter and setter for all selected properties.

ctrl+alt+g will generate the getter for all selected properties.

ctrl+alt+s will generate the setter for all selected properties.

Access using Menubar

Select the required properties and then choose

  1. Edit -> OOJS -> OOGS (Getter + Setter)
  2. Edit -> OOJS -> OOG (Getter)
  3. Edit -> OOJS -> OOS (Setter)

Access using Context Menu

Select the required properties and then right click and choose

  1. OO Getter Setter
  2. OO Getter
  3. OO Setter

Access using Sidebar Menu

Select the required properties and then right click on the filename in the sidebar and choose

  1. OO Getter Setter
  2. OO Getter
  3. OO Setter

License

MIT License • © Avinash Jayakumar