vala.js 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  1. ace.define("ace/snippets/vala",["require","exports","module"], function(require, exports, module) {
  2. "use strict";
  3. exports.snippets = [
  4. {
  5. "content": "case ${1:condition}:\n\t$0\n\tbreak;\n",
  6. "name": "case",
  7. "scope": "vala",
  8. "tabTrigger": "case"
  9. },
  10. {
  11. "content": "/**\n * ${6}\n */\n${1:public} class ${2:MethodName}${3: : GLib.Object} {\n\n\t/**\n\t * ${7}\n\t */\n\tpublic ${2}(${4}) {\n\t\t${5}\n\t}\n\n\t$0\n}",
  12. "name": "class",
  13. "scope": "vala",
  14. "tabTrigger": "class"
  15. },
  16. {
  17. "content": "(${1}) => {\n\t${0}\n}\n",
  18. "name": "closure",
  19. "scope": "vala",
  20. "tabTrigger": "=>"
  21. },
  22. {
  23. "content": "/*\n * $0\n */",
  24. "name": "Comment (multiline)",
  25. "scope": "vala",
  26. "tabTrigger": "/*"
  27. },
  28. {
  29. "content": "Console.WriteLine($1);\n$0",
  30. "name": "Console.WriteLine (writeline)",
  31. "scope": "vala",
  32. "tabTrigger": "writeline"
  33. },
  34. {
  35. "content": "[DBus(name = \"$0\")]",
  36. "name": "DBus annotation",
  37. "scope": "vala",
  38. "tabTrigger": "[DBus"
  39. },
  40. {
  41. "content": "delegate ${1:void} ${2:DelegateName}($0);",
  42. "name": "delegate",
  43. "scope": "vala",
  44. "tabTrigger": "delegate"
  45. },
  46. {
  47. "content": "do {\n\t$0\n} while ($1);\n",
  48. "name": "do while",
  49. "scope": "vala",
  50. "tabTrigger": "dowhile"
  51. },
  52. {
  53. "content": "/**\n * $0\n */",
  54. "name": "DocBlock",
  55. "scope": "vala",
  56. "tabTrigger": "/**"
  57. },
  58. {
  59. "content": "else if ($1) {\n\t$0\n}\n",
  60. "name": "else if (elseif)",
  61. "scope": "vala",
  62. "tabTrigger": "elseif"
  63. },
  64. {
  65. "content": "else {\n\t$0\n}",
  66. "name": "else",
  67. "scope": "vala",
  68. "tabTrigger": "else"
  69. },
  70. {
  71. "content": "enum {$1:EnumName} {\n\t$0\n}",
  72. "name": "enum",
  73. "scope": "vala",
  74. "tabTrigger": "enum"
  75. },
  76. {
  77. "content": "public errordomain ${1:Error} {\n\t$0\n}",
  78. "name": "error domain",
  79. "scope": "vala",
  80. "tabTrigger": "errordomain"
  81. },
  82. {
  83. "content": "for ($1;$2;$3) {\n\t$0\n}",
  84. "name": "for",
  85. "scope": "vala",
  86. "tabTrigger": "for"
  87. },
  88. {
  89. "content": "foreach ($1 in $2) {\n\t$0\n}",
  90. "name": "foreach",
  91. "scope": "vala",
  92. "tabTrigger": "foreach"
  93. },
  94. {
  95. "content": "Gee.ArrayList<${1:G}>($0);",
  96. "name": "Gee.ArrayList",
  97. "scope": "vala",
  98. "tabTrigger": "ArrayList"
  99. },
  100. {
  101. "content": "Gee.HashMap<${1:K},${2:V}>($0);",
  102. "name": "Gee.HashMap",
  103. "scope": "vala",
  104. "tabTrigger": "HashMap"
  105. },
  106. {
  107. "content": "Gee.HashSet<${1:G}>($0);",
  108. "name": "Gee.HashSet",
  109. "scope": "vala",
  110. "tabTrigger": "HashSet"
  111. },
  112. {
  113. "content": "if ($1) {\n\t$0\n}",
  114. "name": "if",
  115. "scope": "vala",
  116. "tabTrigger": "if"
  117. },
  118. {
  119. "content": "interface ${1:InterfaceName}{$2: : SuperInterface} {\n\t$0\n}",
  120. "name": "interface",
  121. "scope": "vala",
  122. "tabTrigger": "interface"
  123. },
  124. {
  125. "content": "public static int main(string [] argv) {\n\t${0}\n\treturn 0;\n}",
  126. "name": "Main function",
  127. "scope": "vala",
  128. "tabTrigger": "main"
  129. },
  130. {
  131. "content": "namespace $1 {\n\t$0\n}\n",
  132. "name": "namespace (ns)",
  133. "scope": "vala",
  134. "tabTrigger": "ns"
  135. },
  136. {
  137. "content": "stdout.printf($0);",
  138. "name": "printf",
  139. "scope": "vala",
  140. "tabTrigger": "printf"
  141. },
  142. {
  143. "content": "${1:public} ${2:Type} ${3:Name} {\n\tset {\n\t\t$0\n\t}\n\tget {\n\n\t}\n}",
  144. "name": "property (prop)",
  145. "scope": "vala",
  146. "tabTrigger": "prop"
  147. },
  148. {
  149. "content": "${1:public} ${2:Type} ${3:Name} {\n\tget {\n\t\t$0\n\t}\n}",
  150. "name": "read-only property (roprop)",
  151. "scope": "vala",
  152. "tabTrigger": "roprop"
  153. },
  154. {
  155. "content": "@\"${1:\\$var}\"",
  156. "name": "String template (@)",
  157. "scope": "vala",
  158. "tabTrigger": "@"
  159. },
  160. {
  161. "content": "struct ${1:StructName} {\n\t$0\n}",
  162. "name": "struct",
  163. "scope": "vala",
  164. "tabTrigger": "struct"
  165. },
  166. {
  167. "content": "switch ($1) {\n\t$0\n}",
  168. "name": "switch",
  169. "scope": "vala",
  170. "tabTrigger": "switch"
  171. },
  172. {
  173. "content": "try {\n\t$2\n} catch (${1:Error} e) {\n\t$0\n}",
  174. "name": "try/catch",
  175. "scope": "vala",
  176. "tabTrigger": "try"
  177. },
  178. {
  179. "content": "\"\"\"$0\"\"\";",
  180. "name": "Verbatim string (\"\"\")",
  181. "scope": "vala",
  182. "tabTrigger": "verbatim"
  183. },
  184. {
  185. "content": "while ($1) {\n\t$0\n}",
  186. "name": "while",
  187. "scope": "vala",
  188. "tabTrigger": "while"
  189. }
  190. ];
  191. exports.scope = "";
  192. });