clojure.js 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. ace.define("ace/snippets/clojure",[], function(require, exports, module) {
  2. "use strict";
  3. exports.snippetText = "snippet comm\n\
  4. (comment\n\
  5. ${1}\n\
  6. )\n\
  7. snippet condp\n\
  8. (condp ${1:pred} ${2:expr}\n\
  9. ${3})\n\
  10. snippet def\n\
  11. (def ${1})\n\
  12. snippet defm\n\
  13. (defmethod ${1:multifn} \"${2:doc-string}\" ${3:dispatch-val} [${4:args}]\n\
  14. ${5})\n\
  15. snippet defmm\n\
  16. (defmulti ${1:name} \"${2:doc-string}\" ${3:dispatch-fn})\n\
  17. snippet defma\n\
  18. (defmacro ${1:name} \"${2:doc-string}\" ${3:dispatch-fn})\n\
  19. snippet defn\n\
  20. (defn ${1:name} \"${2:doc-string}\" [${3:arg-list}]\n\
  21. ${4})\n\
  22. snippet defp\n\
  23. (defprotocol ${1:name}\n\
  24. ${2})\n\
  25. snippet defr\n\
  26. (defrecord ${1:name} [${2:fields}]\n\
  27. ${3:protocol}\n\
  28. ${4})\n\
  29. snippet deft\n\
  30. (deftest ${1:name}\n\
  31. (is (= ${2:assertion})))\n\
  32. ${3})\n\
  33. snippet is\n\
  34. (is (= ${1} ${2}))\n\
  35. snippet defty\n\
  36. (deftype ${1:Name} [${2:fields}]\n\
  37. ${3:Protocol}\n\
  38. ${4})\n\
  39. snippet doseq\n\
  40. (doseq [${1:elem} ${2:coll}]\n\
  41. ${3})\n\
  42. snippet fn\n\
  43. (fn [${1:arg-list}] ${2})\n\
  44. snippet if\n\
  45. (if ${1:test-expr}\n\
  46. ${2:then-expr}\n\
  47. ${3:else-expr})\n\
  48. snippet if-let \n\
  49. (if-let [${1:result} ${2:test-expr}]\n\
  50. (${3:then-expr} $1)\n\
  51. (${4:else-expr}))\n\
  52. snippet imp\n\
  53. (:import [${1:package}])\n\
  54. & {:keys [${1:keys}] :or {${2:defaults}}}\n\
  55. snippet let\n\
  56. (let [${1:name} ${2:expr}]\n\
  57. ${3})\n\
  58. snippet letfn\n\
  59. (letfn [(${1:name) [${2:args}]\n\
  60. ${3})])\n\
  61. snippet map\n\
  62. (map ${1:func} ${2:coll})\n\
  63. snippet mapl\n\
  64. (map #(${1:lambda}) ${2:coll})\n\
  65. snippet met\n\
  66. (${1:name} [${2:this} ${3:args}]\n\
  67. ${4})\n\
  68. snippet ns\n\
  69. (ns ${1:name}\n\
  70. ${2})\n\
  71. snippet dotimes\n\
  72. (dotimes [_ 10]\n\
  73. (time\n\
  74. (dotimes [_ ${1:times}]\n\
  75. ${2})))\n\
  76. snippet pmethod\n\
  77. (${1:name} [${2:this} ${3:args}])\n\
  78. snippet refer\n\
  79. (:refer-clojure :exclude [${1}])\n\
  80. snippet require\n\
  81. (:require [${1:namespace} :as [${2}]])\n\
  82. snippet use\n\
  83. (:use [${1:namespace} :only [${2}]])\n\
  84. snippet print\n\
  85. (println ${1})\n\
  86. snippet reduce\n\
  87. (reduce ${1:(fn [p n] ${3})} ${2})\n\
  88. snippet when\n\
  89. (when ${1:test} ${2:body})\n\
  90. snippet when-let\n\
  91. (when-let [${1:result} ${2:test}]\n\
  92. ${3:body})\n\
  93. ";
  94. exports.scope = "clojure";
  95. });
  96. (function() {
  97. ace.require(["ace/snippets/clojure"], function(m) {
  98. if (typeof module == "object" && typeof exports == "object" && module) {
  99. module.exports = m;
  100. }
  101. });
  102. })();