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
  • 6 years ago
  • 4 hours ago
  • 6 years ago

Installs

  • Total 251
  • Win 171
  • OS X 41
  • Linux 39
Aug 23 Aug 22 Aug 21 Aug 20 Aug 19 Aug 18 Aug 17 Aug 16 Aug 15 Aug 14 Aug 13 Aug 12 Aug 11 Aug 10 Aug 9 Aug 8 Aug 7 Aug 6 Aug 5 Aug 4 Aug 3 Aug 2 Aug 1 Jul 31 Jul 30 Jul 29 Jul 28 Jul 27 Jul 26 Jul 25 Jul 24 Jul 23 Jul 22 Jul 21 Jul 20 Jul 19 Jul 18 Jul 17 Jul 16 Jul 15 Jul 14 Jul 13 Jul 12 Jul 11 Jul 10
Windows 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
OS X 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 1 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