closure project. This project brings some semblance of order to the chaotic and dangerous world of large application javascript development. However it also has some problems, the biggest of this being the fact that it is very verbose. This small set of Visual Studio 2010 snippets aims to aliviate that issue when developing in VS2010. I have been using a similar set of these snippets in production for many months (in the Mouse Eye Tracking service) and whilst not being industrial strength they are ready for you to get some efficiencies from.
Why Visual Studio?
At PicNet most of our server side code is .Net so when developing html and javascript we also use Visual Studio (saves opening up a new IDE). However the snippet template language is just XML so if you are interested in doing an XSLT into another language please get in contact with me and we can bring that into the project also.
How to install
Note: The VSI file is just a zip file with the extension renamed so if you are worried about running strange files just rename to .zip and import the snippets manually into the IDE.
Current Snippets
Shortcut | Content | Declarations |
---|---|---|
jsclass |
/** * @fileoverview $classcomments$ * */ goog.provide('$namespace$.$classname$'); goog.require('$require$'); /** * @constructor * @param {string} $param1$ A sample parameter. */ $namespace$.$classname$ = function($param1$) { $contents$ };
|
| | jsconst |
/** * @const * @type {$typename$} */ $namespace$.$constname$ = $constvalue$;
|
| | jsconstructor |
/** * @constructor * @param {string} $param1$ A sample parameter. */ $namespace$.$classname$ = function($param1$) { $contents$ };
|
| | jsenum |
/** * $enumcomments$ * @enum {string} */ $namespace$.$enumname$ = { ON: 'on', OFF: 'off' };
|
| | jsextends |
* @extends {$namespace$.$inherits$}
|
| | jsimpclass |
/** * @fileoverview $classcomments$ * */ goog.provide('$namespace$.$classname$'); goog.require('$require$'); /** * @constructor * @implements {$namespace$.$implements$} * @param {string} $param1$ A sample parameter. */ $namespace$.$classname$ = function($param1$) { $contents$ };
|
| | jsimplements |
* @implements {$namespace$.$implements$}
|
| | jsinherits |
goog.inherits($namespace$.$classname$, $namespace$.$inherits$);
|
| | jsinterface |
/** * @fileoverview $interfacecomments$ * */ goog.provide('$namespace$.$interfacename$'); goog.require('$require$'); /** * @interface */ $namespace$.$interfacename$ = function() {}; $namespace$.$interfacename$.prototype.$methodname$ = function() {};
|
| | jsparam |
/** * @param {string} $param1$ A sample parameter. */
|
| | jsparaminline |
* @param {string|number=} $param1$ A sample parameter.
|
| | jsprivate |
/** * @type {$typename$} * @private */ this.$attrname$ = $declaration$;
|
| | jsprivateinline |
* @private
| | | jsprivatevar |
/** * @type {$typename$} * @private */ var $attrname$ = $declaration$;
|
| | jsprotected |
/** * @type {$typename$} * @protected */ this.$attrname$ = $declaration$;
|
| | jsprotectedinline |
* @protected
| | | jsprotomem |
/** * @param {*=} $param1$ */ $namespace$.$classname$.prototype.$methodname$ = function($param1$) { return this.member * args; };
|
| | jsprovide |
goog.provide('$namespace$.$classname$');
|
| | jsrequire |
goog.require('$namespace$.$require$');
|
| | jsreturn |
* @return {string}
| | | jssubclass |
/** * @fileoverview $classcomments$ * */ goog.provide('$namespace$.$classname$'); goog.require('$require$'); /** * @constructor * @extends {$namespace$.$inherits$} * @param {string} $param1$ A sample parameter. */ $namespace$.$classname$ = function($param1$) { $contents$ }; goog.inherits($namespace$.$classname$, $namespace$.$inherits$);
|
| | jstypedef |
/** @typedef {$type$} */ $namespace$.$typedefname$;
|
|
License
Development
If you are interested in helping mantain the source code, let me know and we’ll organise something.
Mantaining the code is very straight forward simply:
Guido Tapia Software Development Manager PicNet Pty Ltd