Hi everyone.
I would like to write a plugin for JS code generation in addition to standard snippets.
It is always useful to be able to form your thoughts of future software architecture into some real code. Usually I grab a pen and a paper and start drawing entities, objects, relations, etc. But since I am developer, the code preview of future architecture is also very helpful.
To explain the idea more clearly, consider the following example (simple class creation):
class Player with name:string, score:int, keys:array, enabled:bool, active = true methods someMethod, anotherMethod(a, b = 123)
and the plugin will expand it to:
function Player() {
this.name = ''
this.score = 0
this.keys =]
this.enabled = false
this.active = true
}
Player.prototype.someMethod = function() {
}
Player.prototype.anotherMethod = function(a, b) {
if (!b) {
b = 123
}
}
After reviewing generated code I might bury it, modify or edit the original line (“class Player …”) for further generations. After forming the desired application skeleton the developer should proceed with editing using standard sublime features like snippets and other plugins.
The example is very straight-forward, syntax, generation format will differ in real plugin (or not ).
Please tell me if you would like to see such kind of a plugin and if so - I’ll start working on it, taking further feature requests.
Thanks in advance.