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

OOJS

by avenauche ALL

Sublime Text Plugin to generate Get/Set methods

Details

  • 2013.11.27.17.28.06
  • github.​com
  • github.​com
  • 11 years ago
  • 5 days ago
  • 11 years ago

Installs

  • Total 307
  • Win 207
  • Mac 54
  • Linux 46
Apr 3 Apr 2 Apr 1 Mar 31 Mar 30 Mar 29 Mar 28 Mar 27 Mar 26 Mar 25 Mar 24 Mar 23 Mar 22 Mar 21 Mar 20 Mar 19 Mar 18 Mar 17 Mar 16 Mar 15 Mar 14 Mar 13 Mar 12 Mar 11 Mar 10 Mar 9 Mar 8 Mar 7 Mar 6 Mar 5 Mar 4 Mar 3 Mar 2 Mar 1 Feb 28 Feb 27 Feb 26 Feb 25 Feb 24 Feb 23 Feb 22 Feb 21 Feb 20 Feb 19 Feb 18
Windows 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 0 0 0 0 0 0
Mac 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
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