From a83775cfeb521cc51d92345b32ff5ace89c4fecb Mon Sep 17 00:00:00 2001 From: Tobias Witt Date: Fri, 1 Aug 2014 10:06:40 +0200 Subject: [PATCH] Add snippets for requirejs module definitions for coffee- and javascript The snippet that generates a require block is called `reqjs` in order to have no collision with the existing `req` snippet. --- snippets/coffee/requirejs_coffee.snippets | 11 +++++++++++ snippets/javascript/javascript-requirejs.snippets | 14 ++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 snippets/coffee/requirejs_coffee.snippets create mode 100644 snippets/javascript/javascript-requirejs.snippets diff --git a/snippets/coffee/requirejs_coffee.snippets b/snippets/coffee/requirejs_coffee.snippets new file mode 100644 index 0000000..4130b5e --- /dev/null +++ b/snippets/coffee/requirejs_coffee.snippets @@ -0,0 +1,11 @@ +snippet def + define ["${1:#dependencies1}"], (${2:#dependencies2}) -> + ${0:TARGET} + +snippet defn + define "${1:#name}", ["${2:#dependencies1}"], (${3:#dependencies2}) -> + ${0:TARGET} + +snippet reqjs + require ["${1:#dependencies1}"], (${2:#dependencies2}) -> + ${0:TARGET} diff --git a/snippets/javascript/javascript-requirejs.snippets b/snippets/javascript/javascript-requirejs.snippets new file mode 100644 index 0000000..c8aab75 --- /dev/null +++ b/snippets/javascript/javascript-requirejs.snippets @@ -0,0 +1,14 @@ +snippet def + define(["${1:#dependencies1}"], function (${2:#dependencies2}) { + return ${0:TARGET}; + }); + +snippet defn + define("${1:#name}", ["${2:#dependencies1}"], function (${3:#dependencies2}) { + return ${0:TARGET}; + }); + +snippet reqjs + require(["${1:#dependencies1}"], function (${2:#dependencies2}) { + return ${0:TARGET}; + });