A collection of Javascript snippets for faster developmment in Visual Studio Code Based on JsDoc. Including snippets for Sencha Ext JS.
- Access object property
- Array property
- Arrow function
- Async arrow function
- Author information
- Bind configuration
- Bind property
- Call function
- Comment code
- Console debug block
- Console methods
- Context tag
- Control variables
- Copyright Tag
- Deprecated Tag
- Equal name property and value
- Export default
- Ext JS Class definition
- Ext log
- Ext widget
- Function property
- Generic Tag
- Get property
- Justification change
- Method property
- Object property
- Property
- Property definition
- Property tag
- Set and get property
- Shorter arrow function
- String property
- Todo Tag
- Update function property
- Use strict
- Version Tag
${1:object}[${2:'${3:property}'}];
${1:name}${2|:,=|} [${3}]${4:,}
($1) => { $0 }
async ($1) => { $0 }
/*!
* @author ${1:user} <${2:email}>
* date ${CURRENT_MONTH}/${CURRENT_DATE}/${CURRENT_YEAR}
* ${3:description}
*/
$0
${1:bind}: {
${2:property}: '{${3:value}}',$0
},
${1:property}: '{${2:value}}'${3:,}
${1:function}($0);
/**
* $0
*/
//<debug>
${1}
console.${2|log,info,warn,error|}('${3:debug}', ${4:arguments}); $0
//</debug>
//<debug>
${1}
console.${2|assert,count,debug,dir,dirxml,error,group,groupCollapsed,groupEnd,info,log,profile,profileEnd,table,time,timeEnd,timeStamp,trace,warn|}(${4:arguments}); $0
//</debug>
@${1|private,protected,public|} ${2:args}
var ${1:me} = this,
${2:view} = ${1:me}.getView(),
${3:model} = ${1:me}.getViewModel(),
${4:refs} = ${1:me}.getReferences();
$0
/**
* @copyright ${1:name} ${2:year}
* $1
*/
$0
/**
* @deprecated ${CURRENT_MONTH}/${CURRENT_DATE}/${CURRENT_YEAR} $1
*/
$0
${1:property}${2|:,=|} ${3}${4:property} ${5:,}
export default $0;
/**
* @class ${1:name}
* @extends ${2:extend}
* @xtype ${4:xtype}
* ${5:description}
*/
Ext.define('${1:name}', {
extend: '${2:extend}',
xtype: '${4:xtype}',
${6://}requires: [${7}],
initComponent: function (){
var ${8:me} = this;
Ext.apply(${8:me}, {
items: [
{
$0
}
]
});
${8:me}.callParent(arguments);
}
});
${Ext}.log({
msg: '${1:debug}',
level: '${2|log,info,error,warn|}',
dump: ${3:arguments},
stack: ${4|true,false|}
});
Ext.${1|widget,create|}('${xtype}',{
$0
});
/**
* ${1:name} ${2:description}
* @${3|private,protected,public|}
*/
${1:name}${4|:,=|} function (${5}) {
$0
},
/**
* @${1:tag} $0
*/
${1:property}${2|:,=|} ${3:model}.${4:get}('${5:dataIndex}')${6:,}
/*
* ${1:user} ${CURRENT_MONTH}/${CURRENT_DATE}/${CURRENT_YEAR} ${2:justification}
*/
$0
/**
* @${1|method,function|} ${2:name} ${3:description}
* @returns {${4|String,Number,Boolean,Object,Array,Function,Date|}} ${5:property} `${6:default}` ${7:description}
* @${8|private,protected,public|}
*/
${2:name} ${9|:,=|} function (${10}) {
var ${5:property} = ${6:null};
$0
return ${5:property};
},
${1:name}${2::} {
${4:property}: ${5:''}, $0
},
${1:property}${2|:,=|} ${3:null}${4:,}
/*
* @${1|cfg,arg,argument|} {${2|String,Number,Boolean,Object,Array,Function,Date|}${3}} ${4:name} `${5:default}` ${6:description}
*/
${4:name}${7|:,=|} ${5:null}${8:,}
@${1|param,arg,argument|} {${2|String,Number,Boolean,Object,Array,Function,Date|}${3}} ${4:name} `${5:default}` ${6:description}
/**
* @param {${1:type}} ${2:name} `${3:default}` ${4:description}
* @${5|public,private,protected|}
*/
set${6:Property}${7|:,=|} function (${2:name}) {
var old${2:name} = this.${2:name};
if (${2:name} !== old${2:name}) {
$8}
this.${2:name} = ${2:name};
//this.update${6:Property}(${2:name}, old${2:name});
}
},
/**
* @returns {${1:type}} ${2:name} `${3:default}` ${4:description}
* @${5|public,private,protected|}
*/
get${6:Property}${7|:,=|} function () {
var ${2:name} = this.${2:name} || ${3:default};
${9}
return ${2:name};
},
($1) => $0
${1:property}${2|:,=|} '${3:value}'${4:,}
/**
* @todo ${1:description}
*/
$0
/**
* @${1|private,protected,public|}
*/
update${2:Property} ${3|:,=|} function (new${2:Property}, old${2:Property}) {
$0
},
'use strict';
$0
/**
* @version ${1:major}.${2:minor}.${3:patch} $1
*/
$0