virt2/assets/vendor_plugins/ace-builds-master/demo/kitchen-sink/docs/snippets.snippets

26 lines
428 B
Plaintext
Raw Normal View History

# Function
snippet fun
function ${1?:function_name}(${2:argument}) {
${3:// body...}
}
# Anonymous Function
regex /((=)\s*|(:)\s*|(\()|\b)/f/(\))?/
name f
function${M1?: ${1:functionName}}($2) {
${0:$TM_SELECTED_TEXT}
}${M2?;}${M3?,}${M4?)}
# Immediate function
trigger \(?f\(
endTrigger \)?
snippet f(
(function(${1}) {
${0:${TM_SELECTED_TEXT:/* code */}}
}(${1}));
# if
snippet if
if (${1:true}) {
${0}
}