ace-rails-ap 4.2 → 4.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (331) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +2 -2
  3. data/ace-rails-ap.gemspec +0 -2
  4. data/lib/ace/rails/version.rb +1 -1
  5. data/update.sh +1 -1
  6. data/vendor/assets/javascripts/ace/ace.js +1297 -1274
  7. data/vendor/assets/javascripts/ace/ext-beautify.js +6 -2
  8. data/vendor/assets/javascripts/ace/ext-code_lens.js +238 -0
  9. data/vendor/assets/javascripts/ace/ext-emmet.js +340 -236
  10. data/vendor/assets/javascripts/ace/ext-keybinding_menu.js +37 -32
  11. data/vendor/assets/javascripts/ace/ext-language_tools.js +415 -263
  12. data/vendor/assets/javascripts/ace/ext-linking.js +1 -1
  13. data/vendor/assets/javascripts/ace/ext-modelist.js +15 -5
  14. data/vendor/assets/javascripts/ace/ext-options.js +88 -50
  15. data/vendor/assets/javascripts/ace/ext-prompt.js +2783 -0
  16. data/vendor/assets/javascripts/ace/ext-rtl.js +1 -3
  17. data/vendor/assets/javascripts/ace/ext-settings_menu.js +92 -54
  18. data/vendor/assets/javascripts/ace/ext-spellcheck.js +0 -1
  19. data/vendor/assets/javascripts/ace/ext-statusbar.js +2 -2
  20. data/vendor/assets/javascripts/ace/ext-themelist.js +2 -1
  21. data/vendor/assets/javascripts/ace/ext-whitespace.js +4 -0
  22. data/vendor/assets/javascripts/ace/keybinding-emacs.js +22 -22
  23. data/vendor/assets/javascripts/ace/keybinding-sublime.js +2 -5
  24. data/vendor/assets/javascripts/ace/keybinding-vim.js +336 -70
  25. data/vendor/assets/javascripts/ace/keybinding-vscode.js +262 -0
  26. data/vendor/assets/javascripts/ace/mode-abc.js +3 -0
  27. data/vendor/assets/javascripts/ace/mode-actionscript.js +1 -0
  28. data/vendor/assets/javascripts/ace/mode-alda.js +311 -0
  29. data/vendor/assets/javascripts/ace/mode-aql.js +102 -0
  30. data/vendor/assets/javascripts/ace/mode-asl.js +17 -16
  31. data/vendor/assets/javascripts/ace/mode-autohotkey.js +3 -1
  32. data/vendor/assets/javascripts/ace/mode-c_cpp.js +1 -0
  33. data/vendor/assets/javascripts/ace/mode-cirru.js +2 -2
  34. data/vendor/assets/javascripts/ace/mode-clojure.js +1 -0
  35. data/vendor/assets/javascripts/ace/mode-coffee.js +1 -0
  36. data/vendor/assets/javascripts/ace/mode-coldfusion.js +3 -0
  37. data/vendor/assets/javascripts/ace/mode-crystal.js +642 -0
  38. data/vendor/assets/javascripts/ace/mode-csound_document.js +82 -34
  39. data/vendor/assets/javascripts/ace/mode-csound_orchestra.js +72 -30
  40. data/vendor/assets/javascripts/ace/mode-csound_score.js +30 -21
  41. data/vendor/assets/javascripts/ace/mode-css.js +1 -0
  42. data/vendor/assets/javascripts/ace/mode-curly.js +3 -0
  43. data/vendor/assets/javascripts/ace/mode-d.js +1 -1
  44. data/vendor/assets/javascripts/ace/mode-dart.js +2 -0
  45. data/vendor/assets/javascripts/ace/mode-diff.js +1 -0
  46. data/vendor/assets/javascripts/ace/mode-django.js +4 -0
  47. data/vendor/assets/javascripts/ace/mode-dockerfile.js +1 -0
  48. data/vendor/assets/javascripts/ace/mode-drools.js +1 -0
  49. data/vendor/assets/javascripts/ace/mode-edifact.js +1 -0
  50. data/vendor/assets/javascripts/ace/mode-ejs.js +673 -165
  51. data/vendor/assets/javascripts/ace/mode-erlang.js +1 -0
  52. data/vendor/assets/javascripts/ace/mode-fsharp.js +2 -2
  53. data/vendor/assets/javascripts/ace/mode-fsl.js +1 -0
  54. data/vendor/assets/javascripts/ace/mode-gherkin.js +0 -2
  55. data/vendor/assets/javascripts/ace/mode-glsl.js +1 -0
  56. data/vendor/assets/javascripts/ace/mode-gobstones.js +254 -94
  57. data/vendor/assets/javascripts/ace/mode-graphqlschema.js +1 -0
  58. data/vendor/assets/javascripts/ace/mode-groovy.js +1 -0
  59. data/vendor/assets/javascripts/ace/mode-haml.js +419 -104
  60. data/vendor/assets/javascripts/ace/mode-handlebars.js +3 -0
  61. data/vendor/assets/javascripts/ace/mode-haskell.js +1 -0
  62. data/vendor/assets/javascripts/ace/mode-html.js +3 -0
  63. data/vendor/assets/javascripts/ace/mode-html_elixir.js +3 -0
  64. data/vendor/assets/javascripts/ace/mode-html_ruby.js +673 -165
  65. data/vendor/assets/javascripts/ace/mode-io.js +2 -7
  66. data/vendor/assets/javascripts/ace/mode-jade.js +1 -1
  67. data/vendor/assets/javascripts/ace/mode-java.js +2 -0
  68. data/vendor/assets/javascripts/ace/mode-javascript.js +1 -0
  69. data/vendor/assets/javascripts/ace/mode-json.js +3 -0
  70. data/vendor/assets/javascripts/ace/mode-json5.js +360 -0
  71. data/vendor/assets/javascripts/ace/mode-jsoniq.js +1 -0
  72. data/vendor/assets/javascripts/ace/mode-jsp.js +1 -0
  73. data/vendor/assets/javascripts/ace/mode-kotlin.js +2 -0
  74. data/vendor/assets/javascripts/ace/mode-liquid.js +4 -0
  75. data/vendor/assets/javascripts/ace/mode-lsl.js +1 -0
  76. data/vendor/assets/javascripts/ace/mode-lua.js +31 -10
  77. data/vendor/assets/javascripts/ace/mode-luapage.js +34 -10
  78. data/vendor/assets/javascripts/ace/mode-lucene.js +77 -9
  79. data/vendor/assets/javascripts/ace/mode-makefile.js +1 -0
  80. data/vendor/assets/javascripts/ace/mode-markdown.js +7 -1
  81. data/vendor/assets/javascripts/ace/mode-mask.js +1 -1
  82. data/vendor/assets/javascripts/ace/mode-maze.js +1 -0
  83. data/vendor/assets/javascripts/ace/mode-mediawiki.js +592 -0
  84. data/vendor/assets/javascripts/ace/mode-nginx.js +298 -0
  85. data/vendor/assets/javascripts/ace/mode-nim.js +363 -0
  86. data/vendor/assets/javascripts/ace/mode-nix.js +1 -0
  87. data/vendor/assets/javascripts/ace/mode-nsis.js +1 -1
  88. data/vendor/assets/javascripts/ace/mode-nunjucks.js +2698 -0
  89. data/vendor/assets/javascripts/ace/mode-pascal.js +84 -66
  90. data/vendor/assets/javascripts/ace/mode-perl.js +1 -0
  91. data/vendor/assets/javascripts/ace/mode-pgsql.js +2 -2
  92. data/vendor/assets/javascripts/ace/mode-php.js +5 -1
  93. data/vendor/assets/javascripts/ace/mode-php_laravel_blade.js +5 -1
  94. data/vendor/assets/javascripts/ace/mode-prisma.js +489 -0
  95. data/vendor/assets/javascripts/ace/mode-protobuf.js +1 -0
  96. data/vendor/assets/javascripts/ace/mode-puppet.js +8 -9
  97. data/vendor/assets/javascripts/ace/mode-python.js +3 -2
  98. data/vendor/assets/javascripts/ace/mode-qml.js +381 -0
  99. data/vendor/assets/javascripts/ace/mode-r.js +1 -0
  100. data/vendor/assets/javascripts/ace/mode-razor.js +4 -0
  101. data/vendor/assets/javascripts/ace/mode-rhtml.js +3 -0
  102. data/vendor/assets/javascripts/ace/mode-rst.js +1 -0
  103. data/vendor/assets/javascripts/ace/mode-ruby.js +670 -165
  104. data/vendor/assets/javascripts/ace/mode-rust.js +1 -1
  105. data/vendor/assets/javascripts/ace/mode-scala.js +1 -0
  106. data/vendor/assets/javascripts/ace/mode-sh.js +1 -0
  107. data/vendor/assets/javascripts/ace/mode-sjs.js +1 -0
  108. data/vendor/assets/javascripts/ace/mode-slim.js +710 -111
  109. data/vendor/assets/javascripts/ace/mode-smarty.js +3 -0
  110. data/vendor/assets/javascripts/ace/mode-snippets.js +1 -0
  111. data/vendor/assets/javascripts/ace/mode-soy_template.js +3 -0
  112. data/vendor/assets/javascripts/ace/mode-sql.js +1 -0
  113. data/vendor/assets/javascripts/ace/mode-sqlserver.js +2 -1
  114. data/vendor/assets/javascripts/ace/mode-svg.js +1 -0
  115. data/vendor/assets/javascripts/ace/mode-swift.js +6 -0
  116. data/vendor/assets/javascripts/ace/mode-tcl.js +4 -0
  117. data/vendor/assets/javascripts/ace/mode-terraform.js +14 -11
  118. data/vendor/assets/javascripts/ace/mode-tex.js +1 -0
  119. data/vendor/assets/javascripts/ace/mode-textile.js +1 -0
  120. data/vendor/assets/javascripts/ace/mode-tsx.js +1 -0
  121. data/vendor/assets/javascripts/ace/mode-twig.js +3 -0
  122. data/vendor/assets/javascripts/ace/mode-typescript.js +1 -0
  123. data/vendor/assets/javascripts/ace/mode-vala.js +1 -0
  124. data/vendor/assets/javascripts/ace/mode-vbscript.js +444 -15
  125. data/vendor/assets/javascripts/ace/mode-velocity.js +4 -0
  126. data/vendor/assets/javascripts/ace/mode-vhdl.js +5 -6
  127. data/vendor/assets/javascripts/ace/mode-visualforce.js +3 -0
  128. data/vendor/assets/javascripts/ace/mode-wollok.js +2 -0
  129. data/vendor/assets/javascripts/ace/mode-xquery.js +1 -0
  130. data/vendor/assets/javascripts/ace/mode-yaml.js +44 -13
  131. data/vendor/assets/javascripts/ace/mode-zeek.js +539 -0
  132. data/vendor/assets/javascripts/ace/snippets/abap.js +8 -6
  133. data/vendor/assets/javascripts/ace/snippets/abc.js +8 -1
  134. data/vendor/assets/javascripts/ace/snippets/actionscript.js +8 -1
  135. data/vendor/assets/javascripts/ace/snippets/ada.js +8 -6
  136. data/vendor/assets/javascripts/ace/snippets/alda.js +9 -0
  137. data/vendor/assets/javascripts/ace/snippets/apache_conf.js +8 -6
  138. data/vendor/assets/javascripts/ace/snippets/apex.js +9 -0
  139. data/vendor/assets/javascripts/ace/snippets/applescript.js +8 -6
  140. data/vendor/assets/javascripts/ace/snippets/aql.js +9 -0
  141. data/vendor/assets/javascripts/ace/snippets/asciidoc.js +8 -6
  142. data/vendor/assets/javascripts/ace/snippets/asl.js +9 -0
  143. data/vendor/assets/javascripts/ace/snippets/assembly_x86.js +8 -6
  144. data/vendor/assets/javascripts/ace/snippets/autohotkey.js +8 -6
  145. data/vendor/assets/javascripts/ace/snippets/batchfile.js +8 -6
  146. data/vendor/assets/javascripts/ace/snippets/c9search.js +8 -6
  147. data/vendor/assets/javascripts/ace/snippets/c_cpp.js +8 -1
  148. data/vendor/assets/javascripts/ace/snippets/cirru.js +8 -6
  149. data/vendor/assets/javascripts/ace/snippets/clojure.js +8 -1
  150. data/vendor/assets/javascripts/ace/snippets/cobol.js +8 -6
  151. data/vendor/assets/javascripts/ace/snippets/coffee.js +8 -1
  152. data/vendor/assets/javascripts/ace/snippets/coldfusion.js +8 -6
  153. data/vendor/assets/javascripts/ace/snippets/crystal.js +9 -0
  154. data/vendor/assets/javascripts/ace/snippets/csharp.js +8 -6
  155. data/vendor/assets/javascripts/ace/snippets/csound_document.js +24 -0
  156. data/vendor/assets/javascripts/ace/snippets/csound_orchestra.js +61 -0
  157. data/vendor/assets/javascripts/ace/snippets/csound_score.js +9 -0
  158. data/vendor/assets/javascripts/ace/snippets/csp.js +9 -0
  159. data/vendor/assets/javascripts/ace/snippets/css.js +8 -1
  160. data/vendor/assets/javascripts/ace/snippets/curly.js +8 -6
  161. data/vendor/assets/javascripts/ace/snippets/d.js +8 -6
  162. data/vendor/assets/javascripts/ace/snippets/dart.js +8 -1
  163. data/vendor/assets/javascripts/ace/snippets/diff.js +8 -1
  164. data/vendor/assets/javascripts/ace/snippets/django.js +8 -1
  165. data/vendor/assets/javascripts/ace/snippets/dockerfile.js +8 -6
  166. data/vendor/assets/javascripts/ace/snippets/dot.js +8 -6
  167. data/vendor/assets/javascripts/ace/snippets/drools.js +8 -1
  168. data/vendor/assets/javascripts/ace/snippets/edifact.js +254 -0
  169. data/vendor/assets/javascripts/ace/snippets/eiffel.js +8 -6
  170. data/vendor/assets/javascripts/ace/snippets/ejs.js +8 -6
  171. data/vendor/assets/javascripts/ace/snippets/elixir.js +8 -6
  172. data/vendor/assets/javascripts/ace/snippets/elm.js +8 -6
  173. data/vendor/assets/javascripts/ace/snippets/erlang.js +8 -1
  174. data/vendor/assets/javascripts/ace/snippets/forth.js +8 -6
  175. data/vendor/assets/javascripts/ace/snippets/fortran.js +8 -6
  176. data/vendor/assets/javascripts/ace/snippets/fsharp.js +9 -0
  177. data/vendor/assets/javascripts/ace/snippets/fsl.js +14 -0
  178. data/vendor/assets/javascripts/ace/snippets/ftl.js +8 -6
  179. data/vendor/assets/javascripts/ace/snippets/gcode.js +8 -6
  180. data/vendor/assets/javascripts/ace/snippets/gherkin.js +8 -6
  181. data/vendor/assets/javascripts/ace/snippets/gitignore.js +8 -6
  182. data/vendor/assets/javascripts/ace/snippets/glsl.js +8 -6
  183. data/vendor/assets/javascripts/ace/snippets/gobstones.js +1701 -24
  184. data/vendor/assets/javascripts/ace/snippets/golang.js +8 -6
  185. data/vendor/assets/javascripts/ace/snippets/graphqlschema.js +8 -1
  186. data/vendor/assets/javascripts/ace/snippets/groovy.js +8 -6
  187. data/vendor/assets/javascripts/ace/snippets/haml.js +8 -1
  188. data/vendor/assets/javascripts/ace/snippets/handlebars.js +8 -6
  189. data/vendor/assets/javascripts/ace/snippets/haskell.js +8 -1
  190. data/vendor/assets/javascripts/ace/snippets/haskell_cabal.js +8 -6
  191. data/vendor/assets/javascripts/ace/snippets/haxe.js +8 -6
  192. data/vendor/assets/javascripts/ace/snippets/hjson.js +8 -6
  193. data/vendor/assets/javascripts/ace/snippets/html.js +36 -2
  194. data/vendor/assets/javascripts/ace/snippets/html_elixir.js +8 -6
  195. data/vendor/assets/javascripts/ace/snippets/html_ruby.js +8 -6
  196. data/vendor/assets/javascripts/ace/snippets/ini.js +8 -6
  197. data/vendor/assets/javascripts/ace/snippets/io.js +8 -1
  198. data/vendor/assets/javascripts/ace/snippets/jack.js +8 -6
  199. data/vendor/assets/javascripts/ace/snippets/jade.js +8 -6
  200. data/vendor/assets/javascripts/ace/snippets/java.js +8 -1
  201. data/vendor/assets/javascripts/ace/snippets/javascript.js +8 -1
  202. data/vendor/assets/javascripts/ace/snippets/json.js +8 -6
  203. data/vendor/assets/javascripts/ace/snippets/json5.js +9 -0
  204. data/vendor/assets/javascripts/ace/snippets/jsoniq.js +8 -1
  205. data/vendor/assets/javascripts/ace/snippets/jsp.js +8 -1
  206. data/vendor/assets/javascripts/ace/snippets/jssm.js +9 -0
  207. data/vendor/assets/javascripts/ace/snippets/jsx.js +8 -6
  208. data/vendor/assets/javascripts/ace/snippets/julia.js +8 -6
  209. data/vendor/assets/javascripts/ace/snippets/kotlin.js +8 -6
  210. data/vendor/assets/javascripts/ace/snippets/latex.js +8 -6
  211. data/vendor/assets/javascripts/ace/snippets/less.js +8 -6
  212. data/vendor/assets/javascripts/ace/snippets/liquid.js +890 -2
  213. data/vendor/assets/javascripts/ace/snippets/lisp.js +8 -6
  214. data/vendor/assets/javascripts/ace/snippets/livescript.js +8 -6
  215. data/vendor/assets/javascripts/ace/snippets/logiql.js +8 -6
  216. data/vendor/assets/javascripts/ace/snippets/logtalk.js +9 -0
  217. data/vendor/assets/javascripts/ace/snippets/lsl.js +8 -1
  218. data/vendor/assets/javascripts/ace/snippets/lua.js +8 -1
  219. data/vendor/assets/javascripts/ace/snippets/luapage.js +8 -6
  220. data/vendor/assets/javascripts/ace/snippets/lucene.js +8 -6
  221. data/vendor/assets/javascripts/ace/snippets/makefile.js +8 -1
  222. data/vendor/assets/javascripts/ace/snippets/markdown.js +8 -1
  223. data/vendor/assets/javascripts/ace/snippets/mask.js +8 -6
  224. data/vendor/assets/javascripts/ace/snippets/matlab.js +8 -6
  225. data/vendor/assets/javascripts/ace/snippets/maze.js +8 -1
  226. data/vendor/assets/javascripts/ace/snippets/mediawiki.js +9 -0
  227. data/vendor/assets/javascripts/ace/snippets/mel.js +8 -6
  228. data/vendor/assets/javascripts/ace/snippets/mixal.js +9 -0
  229. data/vendor/assets/javascripts/ace/snippets/mushcode.js +8 -6
  230. data/vendor/assets/javascripts/ace/snippets/mysql.js +8 -6
  231. data/vendor/assets/javascripts/ace/snippets/nginx.js +9 -0
  232. data/vendor/assets/javascripts/ace/snippets/nim.js +9 -0
  233. data/vendor/assets/javascripts/ace/snippets/nix.js +8 -6
  234. data/vendor/assets/javascripts/ace/snippets/nsis.js +8 -6
  235. data/vendor/assets/javascripts/ace/snippets/nunjucks.js +9 -0
  236. data/vendor/assets/javascripts/ace/snippets/objectivec.js +8 -6
  237. data/vendor/assets/javascripts/ace/snippets/ocaml.js +8 -6
  238. data/vendor/assets/javascripts/ace/snippets/pascal.js +8 -6
  239. data/vendor/assets/javascripts/ace/snippets/perl.js +8 -1
  240. data/vendor/assets/javascripts/ace/snippets/perl6.js +9 -0
  241. data/vendor/assets/javascripts/ace/snippets/pgsql.js +8 -6
  242. data/vendor/assets/javascripts/ace/snippets/php.js +49 -36
  243. data/vendor/assets/javascripts/ace/snippets/php_laravel_blade.js +9 -0
  244. data/vendor/assets/javascripts/ace/snippets/pig.js +8 -6
  245. data/vendor/assets/javascripts/ace/snippets/plain_text.js +8 -6
  246. data/vendor/assets/javascripts/ace/snippets/powershell.js +8 -6
  247. data/vendor/assets/javascripts/ace/snippets/praat.js +8 -6
  248. data/vendor/assets/javascripts/ace/snippets/prisma.js +9 -0
  249. data/vendor/assets/javascripts/ace/snippets/prolog.js +8 -6
  250. data/vendor/assets/javascripts/ace/snippets/properties.js +8 -6
  251. data/vendor/assets/javascripts/ace/snippets/protobuf.js +8 -6
  252. data/vendor/assets/javascripts/ace/snippets/puppet.js +9 -0
  253. data/vendor/assets/javascripts/ace/snippets/python.js +8 -1
  254. data/vendor/assets/javascripts/ace/snippets/qml.js +9 -0
  255. data/vendor/assets/javascripts/ace/snippets/r.js +8 -1
  256. data/vendor/assets/javascripts/ace/snippets/razor.js +8 -1
  257. data/vendor/assets/javascripts/ace/snippets/rdoc.js +8 -6
  258. data/vendor/assets/javascripts/ace/snippets/red.js +9 -0
  259. data/vendor/assets/javascripts/ace/snippets/redshift.js +9 -0
  260. data/vendor/assets/javascripts/ace/snippets/rhtml.js +8 -6
  261. data/vendor/assets/javascripts/ace/snippets/rst.js +8 -1
  262. data/vendor/assets/javascripts/ace/snippets/ruby.js +8 -1
  263. data/vendor/assets/javascripts/ace/snippets/rust.js +8 -6
  264. data/vendor/assets/javascripts/ace/snippets/sass.js +8 -6
  265. data/vendor/assets/javascripts/ace/snippets/scad.js +8 -6
  266. data/vendor/assets/javascripts/ace/snippets/scala.js +8 -6
  267. data/vendor/assets/javascripts/ace/snippets/scheme.js +8 -6
  268. data/vendor/assets/javascripts/ace/snippets/scss.js +8 -6
  269. data/vendor/assets/javascripts/ace/snippets/sh.js +8 -1
  270. data/vendor/assets/javascripts/ace/snippets/sjs.js +8 -6
  271. data/vendor/assets/javascripts/ace/snippets/slim.js +9 -0
  272. data/vendor/assets/javascripts/ace/snippets/smarty.js +8 -6
  273. data/vendor/assets/javascripts/ace/snippets/snippets.js +8 -1
  274. data/vendor/assets/javascripts/ace/snippets/soy_template.js +8 -6
  275. data/vendor/assets/javascripts/ace/snippets/space.js +8 -6
  276. data/vendor/assets/javascripts/ace/snippets/sparql.js +8 -6
  277. data/vendor/assets/javascripts/ace/snippets/sql.js +8 -1
  278. data/vendor/assets/javascripts/ace/snippets/sqlserver.js +8 -1
  279. data/vendor/assets/javascripts/ace/snippets/stylus.js +8 -6
  280. data/vendor/assets/javascripts/ace/snippets/svg.js +8 -6
  281. data/vendor/assets/javascripts/ace/snippets/swift.js +8 -6
  282. data/vendor/assets/javascripts/ace/snippets/tcl.js +8 -1
  283. data/vendor/assets/javascripts/ace/snippets/terraform.js +9 -0
  284. data/vendor/assets/javascripts/ace/snippets/tex.js +8 -1
  285. data/vendor/assets/javascripts/ace/snippets/text.js +8 -6
  286. data/vendor/assets/javascripts/ace/snippets/textile.js +8 -1
  287. data/vendor/assets/javascripts/ace/snippets/toml.js +8 -6
  288. data/vendor/assets/javascripts/ace/snippets/tsx.js +8 -6
  289. data/vendor/assets/javascripts/ace/snippets/turtle.js +8 -6
  290. data/vendor/assets/javascripts/ace/snippets/twig.js +8 -6
  291. data/vendor/assets/javascripts/ace/snippets/typescript.js +8 -6
  292. data/vendor/assets/javascripts/ace/snippets/vala.js +8 -1
  293. data/vendor/assets/javascripts/ace/snippets/vbscript.js +8 -6
  294. data/vendor/assets/javascripts/ace/snippets/velocity.js +8 -1
  295. data/vendor/assets/javascripts/ace/snippets/verilog.js +8 -6
  296. data/vendor/assets/javascripts/ace/snippets/vhdl.js +8 -6
  297. data/vendor/assets/javascripts/ace/snippets/visualforce.js +9 -0
  298. data/vendor/assets/javascripts/ace/snippets/wollok.js +8 -1
  299. data/vendor/assets/javascripts/ace/snippets/xml.js +8 -6
  300. data/vendor/assets/javascripts/ace/snippets/xquery.js +8 -1
  301. data/vendor/assets/javascripts/ace/snippets/yaml.js +8 -6
  302. data/vendor/assets/javascripts/ace/snippets/zeek.js +9 -0
  303. data/vendor/assets/javascripts/ace/theme-ambiance.js +3 -2
  304. data/vendor/assets/javascripts/ace/theme-chaos.js +1 -1
  305. data/vendor/assets/javascripts/ace/theme-nord_dark.js +102 -0
  306. data/vendor/assets/javascripts/ace/worker-base.js +1421 -0
  307. data/vendor/assets/javascripts/ace/worker-coffee.js +17 -703
  308. data/vendor/assets/javascripts/ace/worker-css.js +24 -704
  309. data/vendor/assets/javascripts/ace/worker-html.js +17 -703
  310. data/vendor/assets/javascripts/ace/worker-javascript.js +7833 -5352
  311. data/vendor/assets/javascripts/ace/worker-json.js +17 -703
  312. data/vendor/assets/javascripts/ace/worker-lua.js +17 -703
  313. data/vendor/assets/javascripts/ace/worker-php.js +859 -1477
  314. data/vendor/assets/javascripts/ace/worker-xml.js +26 -707
  315. data/vendor/assets/javascripts/ace/worker-xquery.js +17 -703
  316. metadata +50 -18
  317. data/vendor/assets/javascripts/ace/ext-chromevox.js +0 -540
  318. data/vendor/assets/javascripts/ace/ext-old_ie.js +0 -502
  319. data/vendor/assets/javascripts/ace/mode-bash.js +0 -247
  320. data/vendor/assets/javascripts/ace/mode-bro.js +0 -334
  321. data/vendor/assets/javascripts/ace/mode-lean.js +0 -281
  322. data/vendor/assets/javascripts/ace/mode-live_script.js +0 -481
  323. data/vendor/assets/javascripts/ace/mode-mips_assembler.js +0 -235
  324. data/vendor/assets/javascripts/ace/mode-mipsassembler.js +0 -196
  325. data/vendor/assets/javascripts/ace/mode-swig.js +0 -1099
  326. data/vendor/assets/javascripts/ace/snippets/bro.js +0 -7
  327. data/vendor/assets/javascripts/ace/snippets/lean.js +0 -7
  328. data/vendor/assets/javascripts/ace/snippets/live_script.js +0 -7
  329. data/vendor/assets/javascripts/ace/snippets/mips_assembler.js +0 -7
  330. data/vendor/assets/javascripts/ace/snippets/mipsassembler.js +0 -7
  331. data/vendor/assets/javascripts/ace/snippets/swig.js +0 -7
@@ -1,13 +1,88 @@
1
- define("ace/snippets",["require","exports","module","ace/lib/oop","ace/lib/event_emitter","ace/lib/lang","ace/range","ace/anchor","ace/keyboard/hash_handler","ace/tokenizer","ace/lib/dom","ace/editor"], function(require, exports, module) {
1
+ define("ace/snippets",["require","exports","module","ace/lib/oop","ace/lib/event_emitter","ace/lib/lang","ace/range","ace/range_list","ace/keyboard/hash_handler","ace/tokenizer","ace/clipboard","ace/lib/dom","ace/editor"], function(require, exports, module) {
2
2
  "use strict";
3
3
  var oop = require("./lib/oop");
4
4
  var EventEmitter = require("./lib/event_emitter").EventEmitter;
5
5
  var lang = require("./lib/lang");
6
6
  var Range = require("./range").Range;
7
- var Anchor = require("./anchor").Anchor;
7
+ var RangeList = require("./range_list").RangeList;
8
8
  var HashHandler = require("./keyboard/hash_handler").HashHandler;
9
9
  var Tokenizer = require("./tokenizer").Tokenizer;
10
- var comparePoints = Range.comparePoints;
10
+ var clipboard = require("./clipboard");
11
+
12
+ var VARIABLES = {
13
+ CURRENT_WORD: function(editor) {
14
+ return editor.session.getTextRange(editor.session.getWordRange());
15
+ },
16
+ SELECTION: function(editor, name, indentation) {
17
+ var text = editor.session.getTextRange();
18
+ if (indentation)
19
+ return text.replace(/\n\r?([ \t]*\S)/g, "\n" + indentation + "$1");
20
+ return text;
21
+ },
22
+ CURRENT_LINE: function(editor) {
23
+ return editor.session.getLine(editor.getCursorPosition().row);
24
+ },
25
+ PREV_LINE: function(editor) {
26
+ return editor.session.getLine(editor.getCursorPosition().row - 1);
27
+ },
28
+ LINE_INDEX: function(editor) {
29
+ return editor.getCursorPosition().row;
30
+ },
31
+ LINE_NUMBER: function(editor) {
32
+ return editor.getCursorPosition().row + 1;
33
+ },
34
+ SOFT_TABS: function(editor) {
35
+ return editor.session.getUseSoftTabs() ? "YES" : "NO";
36
+ },
37
+ TAB_SIZE: function(editor) {
38
+ return editor.session.getTabSize();
39
+ },
40
+ CLIPBOARD: function(editor) {
41
+ return clipboard.getText && clipboard.getText();
42
+ },
43
+ FILENAME: function(editor) {
44
+ return /[^/\\]*$/.exec(this.FILEPATH(editor))[0];
45
+ },
46
+ FILENAME_BASE: function(editor) {
47
+ return /[^/\\]*$/.exec(this.FILEPATH(editor))[0].replace(/\.[^.]*$/, "");
48
+ },
49
+ DIRECTORY: function(editor) {
50
+ return this.FILEPATH(editor).replace(/[^/\\]*$/, "");
51
+ },
52
+ FILEPATH: function(editor) { return "/not implemented.txt"; },
53
+ WORKSPACE_NAME: function() { return "Unknown"; },
54
+ FULLNAME: function() { return "Unknown"; },
55
+ BLOCK_COMMENT_START: function(editor) {
56
+ var mode = editor.session.$mode || {};
57
+ return mode.blockComment && mode.blockComment.start || "";
58
+ },
59
+ BLOCK_COMMENT_END: function(editor) {
60
+ var mode = editor.session.$mode || {};
61
+ return mode.blockComment && mode.blockComment.end || "";
62
+ },
63
+ LINE_COMMENT: function(editor) {
64
+ var mode = editor.session.$mode || {};
65
+ return mode.lineCommentStart || "";
66
+ },
67
+ CURRENT_YEAR: date.bind(null, {year: "numeric"}),
68
+ CURRENT_YEAR_SHORT: date.bind(null, {year: "2-digit"}),
69
+ CURRENT_MONTH: date.bind(null, {month: "numeric"}),
70
+ CURRENT_MONTH_NAME: date.bind(null, {month: "long"}),
71
+ CURRENT_MONTH_NAME_SHORT: date.bind(null, {month: "short"}),
72
+ CURRENT_DATE: date.bind(null, {day: "2-digit"}),
73
+ CURRENT_DAY_NAME: date.bind(null, {weekday: "long"}),
74
+ CURRENT_DAY_NAME_SHORT: date.bind(null, {weekday: "short"}),
75
+ CURRENT_HOUR: date.bind(null, {hour: "2-digit", hour12: false}),
76
+ CURRENT_MINUTE: date.bind(null, {minute: "2-digit"}),
77
+ CURRENT_SECOND: date.bind(null, {second: "2-digit"})
78
+ };
79
+
80
+ VARIABLES.SELECTED_TEXT = VARIABLES.SELECTION;
81
+
82
+ function date(dateFormat) {
83
+ var str = new Date().toLocaleString("en-us", dateFormat);
84
+ return str.length == 1 ? "0" + str : str;
85
+ }
11
86
 
12
87
  var SnippetManager = function() {
13
88
  this.snippetMap = {};
@@ -18,41 +93,40 @@ var SnippetManager = function() {
18
93
  oop.implement(this, EventEmitter);
19
94
 
20
95
  this.getTokenizer = function() {
21
- function TabstopToken(str, _, stack) {
96
+ return SnippetManager.$tokenizer || this.createTokenizer();
97
+ };
98
+
99
+ this.createTokenizer = function() {
100
+ function TabstopToken(str) {
22
101
  str = str.substr(1);
23
- if (/^\d+$/.test(str) && !stack.inFormatString)
102
+ if (/^\d+$/.test(str))
24
103
  return [{tabstopId: parseInt(str, 10)}];
25
104
  return [{text: str}];
26
105
  }
27
106
  function escape(ch) {
28
107
  return "(?:[^\\\\" + ch + "]|\\\\.)";
29
108
  }
109
+ var formatMatcher = {
110
+ regex: "/(" + escape("/") + "+)/",
111
+ onMatch: function(val, state, stack) {
112
+ var ts = stack[0];
113
+ ts.fmtString = true;
114
+ ts.guard = val.slice(1, -1);
115
+ ts.flag = "";
116
+ return "";
117
+ },
118
+ next: "formatString"
119
+ };
120
+
30
121
  SnippetManager.$tokenizer = new Tokenizer({
31
122
  start: [
32
- {regex: /:/, onMatch: function(val, state, stack) {
33
- if (stack.length && stack[0].expectIf) {
34
- stack[0].expectIf = false;
35
- stack[0].elseBranch = stack[0];
36
- return [stack[0]];
37
- }
38
- return ":";
39
- }},
40
123
  {regex: /\\./, onMatch: function(val, state, stack) {
41
124
  var ch = val[1];
42
125
  if (ch == "}" && stack.length) {
43
126
  val = ch;
44
- }else if ("`$\\".indexOf(ch) != -1) {
127
+ } else if ("`$\\".indexOf(ch) != -1) {
45
128
  val = ch;
46
- } else if (stack.inFormatString) {
47
- if (ch == "n")
48
- val = "\n";
49
- else if (ch == "t")
50
- val = "\n";
51
- else if ("ulULE".indexOf(ch) != -1) {
52
- val = {changeCase: ch, local: ch > "a"};
53
- }
54
129
  }
55
-
56
130
  return [val];
57
131
  }},
58
132
  {regex: /}/, onMatch: function(val, state, stack) {
@@ -60,7 +134,7 @@ var SnippetManager = function() {
60
134
  }},
61
135
  {regex: /\$(?:\d+|\w+)/, onMatch: TabstopToken},
62
136
  {regex: /\$\{[\dA-Z_a-z]+/, onMatch: function(str, state, stack) {
63
- var t = TabstopToken(str.substr(1), state, stack);
137
+ var t = TabstopToken(str.substr(1));
64
138
  stack.unshift(t[0]);
65
139
  return t;
66
140
  }, next: "snippetVar"},
@@ -68,39 +142,78 @@ var SnippetManager = function() {
68
142
  ],
69
143
  snippetVar: [
70
144
  {regex: "\\|" + escape("\\|") + "*\\|", onMatch: function(val, state, stack) {
71
- stack[0].choices = val.slice(1, -1).split(",");
72
- }, next: "start"},
73
- {regex: "/(" + escape("/") + "+)/(?:(" + escape("/") + "*)/)(\\w*):?",
74
- onMatch: function(val, state, stack) {
75
- var ts = stack[0];
76
- ts.fmtString = val;
77
-
78
- val = this.splitRegex.exec(val);
79
- ts.guard = val[1];
80
- ts.fmt = val[2];
81
- ts.flag = val[3];
82
- return "";
83
- }, next: "start"},
84
- {regex: "`" + escape("`") + "*`", onMatch: function(val, state, stack) {
85
- stack[0].code = val.splice(1, -1);
86
- return "";
87
- }, next: "start"},
88
- {regex: "\\?", onMatch: function(val, state, stack) {
89
- if (stack[0])
90
- stack[0].expectIf = true;
145
+ var choices = val.slice(1, -1).replace(/\\[,|\\]|,/g, function(operator) {
146
+ return operator.length == 2 ? operator[1] : "\x00";
147
+ }).split("\x00").map(function(value){
148
+ return {value: value};
149
+ });
150
+ stack[0].choices = choices;
151
+ return [choices[0]];
91
152
  }, next: "start"},
153
+ formatMatcher,
92
154
  {regex: "([^:}\\\\]|\\\\.)*:?", token: "", next: "start"}
93
155
  ],
94
156
  formatString: [
95
- {regex: "/(" + escape("/") + "+)/", token: "regex"},
96
- {regex: "", onMatch: function(val, state, stack) {
97
- stack.inFormatString = true;
157
+ {regex: /:/, onMatch: function(val, state, stack) {
158
+ if (stack.length && stack[0].expectElse) {
159
+ stack[0].expectElse = false;
160
+ stack[0].ifEnd = {elseEnd: stack[0]};
161
+ return [stack[0].ifEnd];
162
+ }
163
+ return ":";
164
+ }},
165
+ {regex: /\\./, onMatch: function(val, state, stack) {
166
+ var ch = val[1];
167
+ if (ch == "}" && stack.length)
168
+ val = ch;
169
+ else if ("`$\\".indexOf(ch) != -1)
170
+ val = ch;
171
+ else if (ch == "n")
172
+ val = "\n";
173
+ else if (ch == "t")
174
+ val = "\t";
175
+ else if ("ulULE".indexOf(ch) != -1)
176
+ val = {changeCase: ch, local: ch > "a"};
177
+ return [val];
178
+ }},
179
+ {regex: "/\\w*}", onMatch: function(val, state, stack) {
180
+ var next = stack.shift();
181
+ if (next)
182
+ next.flag = val.slice(1, -1);
183
+ this.next = next && next.tabstopId ? "start" : "";
184
+ return [next || val];
185
+ }, next: "start"},
186
+ {regex: /\$(?:\d+|\w+)/, onMatch: function(val, state, stack) {
187
+ return [{text: val.slice(1)}];
188
+ }},
189
+ {regex: /\${\w+/, onMatch: function(val, state, stack) {
190
+ var token = {text: val.slice(2)};
191
+ stack.unshift(token);
192
+ return [token];
193
+ }, next: "formatStringVar"},
194
+ {regex: /\n/, token: "newline", merge: false},
195
+ {regex: /}/, onMatch: function(val, state, stack) {
196
+ var next = stack.shift();
197
+ this.next = next && next.tabstopId ? "start" : "";
198
+ return [next || val];
98
199
  }, next: "start"}
200
+ ],
201
+ formatStringVar: [
202
+ {regex: /:\/\w+}/, onMatch: function(val, state, stack) {
203
+ var ts = stack[0];
204
+ ts.formatFunction = val.slice(2, -1);
205
+ return [stack.shift()];
206
+ }, next: "formatString"},
207
+ formatMatcher,
208
+ {regex: /:[\?\-+]?/, onMatch: function(val, state, stack) {
209
+ if (val[1] == "+")
210
+ stack[0].ifEnd = stack[0];
211
+ if (val[1] == "?")
212
+ stack[0].expectElse = true;
213
+ }, next: "formatString"},
214
+ {regex: "([^:}\\\\]|\\\\.)*:?", token: "", next: "formatString"}
99
215
  ]
100
216
  });
101
- SnippetManager.prototype.getTokenizer = function() {
102
- return SnippetManager.$tokenizer;
103
- };
104
217
  return SnippetManager.$tokenizer;
105
218
  };
106
219
 
@@ -109,59 +222,33 @@ var SnippetManager = function() {
109
222
  return x.value || x;
110
223
  });
111
224
  };
112
-
113
- this.$getDefaultValue = function(editor, name) {
114
- if (/^[A-Z]\d+$/.test(name)) {
115
- var i = name.substr(1);
116
- return (this.variables[name[0] + "__"] || {})[i];
117
- }
118
- if (/^\d+$/.test(name)) {
119
- return (this.variables.__ || {})[name];
120
- }
225
+
226
+ this.getVariableValue = function(editor, name, indentation) {
227
+ if (/^\d+$/.test(name))
228
+ return (this.variables.__ || {})[name] || "";
229
+ if (/^[A-Z]\d+$/.test(name))
230
+ return (this.variables[name[0] + "__"] || {})[name.substr(1)] || "";
231
+
121
232
  name = name.replace(/^TM_/, "");
122
-
123
- if (!editor)
124
- return;
125
- var s = editor.session;
126
- switch(name) {
127
- case "CURRENT_WORD":
128
- var r = s.getWordRange();
129
- case "SELECTION":
130
- case "SELECTED_TEXT":
131
- return s.getTextRange(r);
132
- case "CURRENT_LINE":
133
- return s.getLine(editor.getCursorPosition().row);
134
- case "PREV_LINE": // not possible in textmate
135
- return s.getLine(editor.getCursorPosition().row - 1);
136
- case "LINE_INDEX":
137
- return editor.getCursorPosition().column;
138
- case "LINE_NUMBER":
139
- return editor.getCursorPosition().row + 1;
140
- case "SOFT_TABS":
141
- return s.getUseSoftTabs() ? "YES" : "NO";
142
- case "TAB_SIZE":
143
- return s.getTabSize();
144
- case "FILENAME":
145
- case "FILEPATH":
146
- return "";
147
- case "FULLNAME":
148
- return "Ace";
149
- }
150
- };
151
- this.variables = {};
152
- this.getVariableValue = function(editor, varName) {
153
- if (this.variables.hasOwnProperty(varName))
154
- return this.variables[varName](editor, varName) || "";
155
- return this.$getDefaultValue(editor, varName) || "";
233
+ if (!this.variables.hasOwnProperty(name))
234
+ return "";
235
+ var value = this.variables[name];
236
+ if (typeof value == "function")
237
+ value = this.variables[name](editor, name, indentation);
238
+ return value == null ? "" : value;
156
239
  };
240
+
241
+ this.variables = VARIABLES;
157
242
  this.tmStrFormat = function(str, ch, editor) {
243
+ if (!ch.fmt) return str;
158
244
  var flag = ch.flag || "";
159
245
  var re = ch.guard;
160
- re = new RegExp(re, flag.replace(/[^gi]/, ""));
161
- var fmtTokens = this.tokenizeTmSnippet(ch.fmt, "formatString");
246
+ re = new RegExp(re, flag.replace(/[^gim]/g, ""));
247
+ var fmtTokens = typeof ch.fmt == "string" ? this.tokenizeTmSnippet(ch.fmt, "formatString") : ch.fmt;
162
248
  var _self = this;
163
249
  var formatted = str.replace(re, function() {
164
- _self.variables.__ = arguments;
250
+ var oldArgs = _self.variables.__;
251
+ _self.variables.__ = [].slice.call(arguments);
165
252
  var fmtParts = _self.resolveVariables(fmtTokens, editor);
166
253
  var gChangeCase = "E";
167
254
  for (var i = 0; i < fmtParts.length; i++) {
@@ -186,40 +273,63 @@ var SnippetManager = function() {
186
273
  fmtParts[i] = ch.toLowerCase();
187
274
  }
188
275
  }
276
+ _self.variables.__ = oldArgs;
189
277
  return fmtParts.join("");
190
278
  });
191
- this.variables.__ = null;
192
279
  return formatted;
193
280
  };
281
+
282
+ this.tmFormatFunction = function(str, ch, editor) {
283
+ if (ch.formatFunction == "upcase")
284
+ return str.toUpperCase();
285
+ if (ch.formatFunction == "downcase")
286
+ return str.toLowerCase();
287
+ return str;
288
+ };
194
289
 
195
290
  this.resolveVariables = function(snippet, editor) {
196
291
  var result = [];
292
+ var indentation = "";
293
+ var afterNewLine = true;
197
294
  for (var i = 0; i < snippet.length; i++) {
198
295
  var ch = snippet[i];
199
296
  if (typeof ch == "string") {
200
297
  result.push(ch);
201
- } else if (typeof ch != "object") {
202
- continue;
203
- } else if (ch.skip) {
204
- gotoNext(ch);
205
- } else if (ch.processed < i) {
298
+ if (ch == "\n") {
299
+ afterNewLine = true;
300
+ indentation = "";
301
+ }
302
+ else if (afterNewLine) {
303
+ indentation = /^\t*/.exec(ch)[0];
304
+ afterNewLine = /\S/.test(ch);
305
+ }
206
306
  continue;
207
- } else if (ch.text) {
208
- var value = this.getVariableValue(editor, ch.text);
209
- if (value && ch.fmtString)
210
- value = this.tmStrFormat(value, ch);
211
- ch.processed = i;
212
- if (ch.expectIf == null) {
213
- if (value) {
214
- result.push(value);
215
- gotoNext(ch);
216
- }
217
- } else {
218
- if (value) {
219
- ch.skip = ch.elseBranch;
220
- } else
221
- gotoNext(ch);
307
+ }
308
+ if (!ch) continue;
309
+ afterNewLine = false;
310
+
311
+ if (ch.fmtString) {
312
+ var j = snippet.indexOf(ch, i + 1);
313
+ if (j == -1) j = snippet.length;
314
+ ch.fmt = snippet.slice(i + 1, j);
315
+ i = j;
316
+ }
317
+
318
+ if (ch.text) {
319
+ var value = this.getVariableValue(editor, ch.text, indentation) + "";
320
+ if (ch.fmtString)
321
+ value = this.tmStrFormat(value, ch, editor);
322
+ if (ch.formatFunction)
323
+ value = this.tmFormatFunction(value, ch, editor);
324
+
325
+ if (value && !ch.ifEnd) {
326
+ result.push(value);
327
+ gotoNext(ch);
328
+ } else if (!value && ch.ifEnd) {
329
+ gotoNext(ch.ifEnd);
222
330
  }
331
+ } else if (ch.elseEnd) {
332
+ gotoNext(ch.elseEnd);
223
333
  } else if (ch.tabstopId != null) {
224
334
  result.push(ch);
225
335
  } else if (ch.changeCase != null) {
@@ -263,9 +373,12 @@ var SnippetManager = function() {
263
373
  ts = tabstops[id] = [];
264
374
  ts.index = id;
265
375
  ts.value = "";
376
+ ts.parents = {};
266
377
  }
267
378
  if (ts.indexOf(p) !== -1)
268
379
  return;
380
+ if (p.choices && !ts.choices)
381
+ ts.choices = p.choices;
269
382
  ts.push(p);
270
383
  var i1 = tokens.indexOf(p, i + 1);
271
384
  if (i1 === -1)
@@ -300,19 +413,24 @@ var SnippetManager = function() {
300
413
  if (typeof p != "object")
301
414
  continue;
302
415
  var id = p.tabstopId;
416
+ var ts = tabstops[id];
303
417
  var i1 = tokens.indexOf(p, i + 1);
304
418
  if (expanding[id]) {
305
- if (expanding[id] === p)
306
- expanding[id] = null;
419
+ if (expanding[id] === p) {
420
+ delete expanding[id];
421
+ Object.keys(expanding).forEach(function(parentId) {
422
+ ts.parents[parentId] = true;
423
+ });
424
+ }
307
425
  continue;
308
426
  }
309
-
310
- var ts = tabstops[id];
311
- var arg = typeof ts.value == "string" ? [ts.value] : copyValue(ts.value);
312
- arg.unshift(i + 1, Math.max(0, i1 - i));
313
- arg.push(p);
314
427
  expanding[id] = p;
315
- tokens.splice.apply(tokens, arg);
428
+ var value = ts.value;
429
+ if (typeof value !== "string")
430
+ value = copyValue(value);
431
+ else if (p.fmt)
432
+ value = this.tmStrFormat(value, p, editor);
433
+ tokens.splice.apply(tokens, [i + 1, Math.max(0, i1 - i)].concat(value, p));
316
434
 
317
435
  if (ts.indexOf(p) === -1)
318
436
  ts.push(p);
@@ -328,7 +446,7 @@ var SnippetManager = function() {
328
446
  } else
329
447
  column += t.length;
330
448
  text += t;
331
- } else {
449
+ } else if (t) {
332
450
  if (!t.start)
333
451
  t.start = {row: row, column: column};
334
452
  else
@@ -499,6 +617,12 @@ var SnippetManager = function() {
499
617
  }
500
618
  snippetMap[scope].push(s);
501
619
 
620
+ if (s.prefix)
621
+ s.tabTrigger = s.prefix;
622
+
623
+ if (!s.content && s.body)
624
+ s.content = Array.isArray(s.body) ? s.body.join("\n") : s.body;
625
+
502
626
  if (s.tabTrigger && !s.trigger) {
503
627
  if (!s.guard && /^\w/.test(s.tabTrigger))
504
628
  s.guard = "\\b";
@@ -515,10 +639,13 @@ var SnippetManager = function() {
515
639
  s.endTriggerRe = new RegExp(s.endTrigger);
516
640
  }
517
641
 
518
- if (snippets && snippets.content)
519
- addSnippet(snippets);
520
- else if (Array.isArray(snippets))
642
+ if (Array.isArray(snippets)) {
521
643
  snippets.forEach(addSnippet);
644
+ } else {
645
+ Object.keys(snippets).forEach(function(key) {
646
+ addSnippet(snippets[key]);
647
+ });
648
+ }
522
649
 
523
650
  this._signal("registerSnippets", {scope: scope});
524
651
  };
@@ -568,7 +695,7 @@ var SnippetManager = function() {
568
695
  snippet.tabTrigger = val.match(/^\S*/)[0];
569
696
  if (!snippet.name)
570
697
  snippet.name = val;
571
- } else {
698
+ } else if (key) {
572
699
  snippet[key] = val;
573
700
  }
574
701
  }
@@ -630,66 +757,44 @@ var TabstopManager = function(editor) {
630
757
  };
631
758
 
632
759
  this.onChange = function(delta) {
633
- var changeRange = delta;
634
760
  var isRemove = delta.action[0] == "r";
635
- var start = delta.start;
636
- var end = delta.end;
637
- var startRow = start.row;
638
- var endRow = end.row;
639
- var lineDif = endRow - startRow;
640
- var colDiff = end.column - start.column;
641
-
642
- if (isRemove) {
643
- lineDif = -lineDif;
644
- colDiff = -colDiff;
645
- }
646
- if (!this.$inChange && isRemove) {
647
- var ts = this.selectedTabstop;
648
- var changedOutside = ts && !ts.some(function(r) {
649
- return comparePoints(r.start, start) <= 0 && comparePoints(r.end, end) >= 0;
650
- });
651
- if (changedOutside)
652
- return this.detach();
653
- }
654
- var ranges = this.ranges;
655
- for (var i = 0; i < ranges.length; i++) {
656
- var r = ranges[i];
657
- if (r.end.row < start.row)
658
- continue;
659
-
660
- if (isRemove && comparePoints(start, r.start) < 0 && comparePoints(end, r.end) > 0) {
661
- this.removeRange(r);
662
- i--;
663
- continue;
761
+ var selectedTabstop = this.selectedTabstop || {};
762
+ var parents = selectedTabstop.parents || {};
763
+ var tabstops = (this.tabstops || []).slice();
764
+ for (var i = 0; i < tabstops.length; i++) {
765
+ var ts = tabstops[i];
766
+ var active = ts == selectedTabstop || parents[ts.index];
767
+ ts.rangeList.$bias = active ? 0 : 1;
768
+
769
+ if (delta.action == "remove" && ts !== selectedTabstop) {
770
+ var parentActive = ts.parents && ts.parents[selectedTabstop.index];
771
+ var startIndex = ts.rangeList.pointIndex(delta.start, parentActive);
772
+ startIndex = startIndex < 0 ? -startIndex - 1 : startIndex + 1;
773
+ var endIndex = ts.rangeList.pointIndex(delta.end, parentActive);
774
+ endIndex = endIndex < 0 ? -endIndex - 1 : endIndex - 1;
775
+ var toRemove = ts.rangeList.ranges.slice(startIndex, endIndex);
776
+ for (var j = 0; j < toRemove.length; j++)
777
+ this.removeRange(toRemove[j]);
664
778
  }
665
-
666
- if (r.start.row == startRow && r.start.column > start.column)
667
- r.start.column += colDiff;
668
- if (r.end.row == startRow && r.end.column >= start.column)
669
- r.end.column += colDiff;
670
- if (r.start.row >= startRow)
671
- r.start.row += lineDif;
672
- if (r.end.row >= startRow)
673
- r.end.row += lineDif;
674
-
675
- if (comparePoints(r.start, r.end) > 0)
676
- this.removeRange(r);
779
+ ts.rangeList.$onChange(delta);
677
780
  }
678
- if (!ranges.length)
781
+ var session = this.editor.session;
782
+ if (!this.$inChange && isRemove && session.getLength() == 1 && !session.getValue())
679
783
  this.detach();
680
784
  };
681
785
  this.updateLinkedFields = function() {
682
786
  var ts = this.selectedTabstop;
683
- if (!ts || !ts.hasLinkedRanges)
787
+ if (!ts || !ts.hasLinkedRanges || !ts.firstNonLinked)
684
788
  return;
685
789
  this.$inChange = true;
686
790
  var session = this.editor.session;
687
791
  var text = session.getTextRange(ts.firstNonLinked);
688
- for (var i = ts.length; i--;) {
792
+ for (var i = 0; i < ts.length; i++) {
689
793
  var range = ts[i];
690
794
  if (!range.linked)
691
795
  continue;
692
- var fmt = exports.snippetManager.tmStrFormat(text, range.original);
796
+ var original = range.original;
797
+ var fmt = exports.snippetManager.tmStrFormat(text, original, this.editor);
693
798
  session.replace(range, fmt);
694
799
  }
695
800
  this.$inChange = false;
@@ -704,7 +809,7 @@ var TabstopManager = function(editor) {
704
809
  var lead = this.editor.selection.lead;
705
810
  var anchor = this.editor.selection.anchor;
706
811
  var isEmpty = this.editor.selection.isEmpty();
707
- for (var i = this.ranges.length; i--;) {
812
+ for (var i = 0; i < this.ranges.length; i++) {
708
813
  if (this.ranges[i].linked)
709
814
  continue;
710
815
  var containsLead = this.ranges[i].contains(lead.row, lead.column);
@@ -738,23 +843,27 @@ var TabstopManager = function(editor) {
738
843
  return;
739
844
 
740
845
  this.selectedTabstop = ts;
741
- if (!this.editor.inVirtualSelectionMode) {
846
+ var range = ts.firstNonLinked || ts;
847
+ if (ts.choices) range.cursor = range.start;
848
+ if (!this.editor.inVirtualSelectionMode) {
742
849
  var sel = this.editor.multiSelect;
743
- sel.toSingleRange(ts.firstNonLinked.clone());
744
- for (var i = ts.length; i--;) {
850
+ sel.toSingleRange(range);
851
+ for (var i = 0; i < ts.length; i++) {
745
852
  if (ts.hasLinkedRanges && ts[i].linked)
746
853
  continue;
747
854
  sel.addRange(ts[i].clone(), true);
748
855
  }
749
- if (sel.ranges[0])
750
- sel.addRange(sel.ranges[0].clone());
751
856
  } else {
752
- this.editor.selection.setRange(ts.firstNonLinked);
857
+ this.editor.selection.fromOrientedRange(range);
753
858
  }
754
859
 
755
860
  this.editor.keyBinding.addKeyboardHandler(this.keyboardHandler);
861
+ if (this.selectedTabstop && this.selectedTabstop.choices)
862
+ this.editor.execCommand("startAutocomplete", {matches: this.selectedTabstop.choices});
756
863
  };
757
864
  this.addTabstops = function(tabstops, start, end) {
865
+ var useLink = this.useLink || !this.editor.getOption("enableMultiselect");
866
+
758
867
  if (!this.$openTabstops)
759
868
  this.$openTabstops = [];
760
869
  if (!tabstops[0]) {
@@ -770,8 +879,8 @@ var TabstopManager = function(editor) {
770
879
  var ranges = this.ranges;
771
880
  tabstops.forEach(function(ts, index) {
772
881
  var dest = this.$openTabstops[index] || ts;
773
-
774
- for (var i = ts.length; i--;) {
882
+
883
+ for (var i = 0; i < ts.length; i++) {
775
884
  var p = ts[i];
776
885
  var range = Range.fromPoints(p.start, p.end || p.start);
777
886
  movePoint(range.start, start);
@@ -783,7 +892,7 @@ var TabstopManager = function(editor) {
783
892
  dest.unshift(range);
784
893
  else
785
894
  dest[i] = range;
786
- if (p.fmtString) {
895
+ if (p.fmtString || (dest.firstNonLinked && useLink)) {
787
896
  range.linked = true;
788
897
  dest.hasLinkedRanges = true;
789
898
  } else if (!dest.firstNonLinked)
@@ -796,6 +905,9 @@ var TabstopManager = function(editor) {
796
905
  this.$openTabstops[index] = dest;
797
906
  }
798
907
  this.addTabstopMarkers(dest);
908
+ dest.rangeList = dest.rangeList || new RangeList();
909
+ dest.rangeList.$bias = 0;
910
+ dest.rangeList.addList(dest);
799
911
  }, this);
800
912
 
801
913
  if (arg.length > 2) {
@@ -821,9 +933,11 @@ var TabstopManager = function(editor) {
821
933
  };
822
934
  this.removeRange = function(range) {
823
935
  var i = range.tabstop.indexOf(range);
824
- range.tabstop.splice(i, 1);
936
+ if (i != -1) range.tabstop.splice(i, 1);
825
937
  i = this.ranges.indexOf(range);
826
- this.ranges.splice(i, 1);
938
+ if (i != -1) this.ranges.splice(i, 1);
939
+ i = range.tabstop.rangeList.ranges.indexOf(range);
940
+ if (i != -1) range.tabstop.splice(i, 1);
827
941
  this.editor.session.removeMarker(range.markerId);
828
942
  if (!range.tabstop.length) {
829
943
  i = this.tabstops.indexOf(range.tabstop);
@@ -836,39 +950,24 @@ var TabstopManager = function(editor) {
836
950
 
837
951
  this.keyboardHandler = new HashHandler();
838
952
  this.keyboardHandler.bindKeys({
839
- "Tab": function(ed) {
840
- if (exports.snippetManager && exports.snippetManager.expandWithTab(ed)) {
953
+ "Tab": function(editor) {
954
+ if (exports.snippetManager && exports.snippetManager.expandWithTab(editor))
841
955
  return;
842
- }
843
-
844
- ed.tabstopManager.tabNext(1);
845
- },
846
- "Shift-Tab": function(ed) {
847
- ed.tabstopManager.tabNext(-1);
956
+ editor.tabstopManager.tabNext(1);
957
+ editor.renderer.scrollCursorIntoView();
848
958
  },
849
- "Esc": function(ed) {
850
- ed.tabstopManager.detach();
959
+ "Shift-Tab": function(editor) {
960
+ editor.tabstopManager.tabNext(-1);
961
+ editor.renderer.scrollCursorIntoView();
851
962
  },
852
- "Return": function(ed) {
853
- return false;
963
+ "Esc": function(editor) {
964
+ editor.tabstopManager.detach();
854
965
  }
855
966
  });
856
967
  }).call(TabstopManager.prototype);
857
968
 
858
969
 
859
970
 
860
- var changeTracker = {};
861
- changeTracker.onChange = Anchor.prototype.onChange;
862
- changeTracker.setPosition = function(row, column) {
863
- this.pos.row = row;
864
- this.pos.column = column;
865
- };
866
- changeTracker.update = function(pos, delta, $insertRight) {
867
- this.$insertRight = $insertRight;
868
- this.pos = pos;
869
- this.onChange(delta);
870
- };
871
-
872
971
  var movePoint = function(point, diff) {
873
972
  if (point.row == 0)
874
973
  point.column += diff.column;
@@ -1081,6 +1180,8 @@ var AcePopup = function(parentNode) {
1081
1180
 
1082
1181
  if (data.meta)
1083
1182
  tokens.push({type: "completion-meta", value: data.meta});
1183
+ if (data.message)
1184
+ tokens.push({type: "completion-message", value: data.message});
1084
1185
 
1085
1186
  return tokens;
1086
1187
  };
@@ -1166,6 +1267,21 @@ var AcePopup = function(parentNode) {
1166
1267
  popup.isOpen = true;
1167
1268
  };
1168
1269
 
1270
+ popup.goTo = function(where) {
1271
+ var row = this.getRow();
1272
+ var max = this.session.getLength() - 1;
1273
+
1274
+ switch(where) {
1275
+ case "up": row = row <= 0 ? max : row - 1; break;
1276
+ case "down": row = row >= max ? -1 : row + 1; break;
1277
+ case "start": row = 0; break;
1278
+ case "end": row = max; break;
1279
+ }
1280
+
1281
+ this.setRow(row);
1282
+ };
1283
+
1284
+
1169
1285
  popup.getTextLeftOffset = function() {
1170
1286
  return this.$borderSize + this.renderer.$padding + this.$imageSize;
1171
1287
  };
@@ -1199,6 +1315,9 @@ dom.importCssString("\
1199
1315
  opacity: 0.5;\
1200
1316
  margin: 0.9em;\
1201
1317
  }\
1318
+ .ace_completion-message {\
1319
+ color: blue;\
1320
+ }\
1202
1321
  .ace_editor.ace_autocomplete .ace_completion-highlight{\
1203
1322
  color: #2d69c7;\
1204
1323
  }\
@@ -1224,7 +1343,7 @@ dom.importCssString("\
1224
1343
  }", "autocompletion.css");
1225
1344
 
1226
1345
  exports.AcePopup = AcePopup;
1227
-
1346
+ exports.$singleLineEditor = $singleLineEditor;
1228
1347
  });
1229
1348
 
1230
1349
  define("ace/autocomplete/util",["require","exports","module"], function(require, exports, module) {
@@ -1244,7 +1363,7 @@ exports.parForEach = function(array, fn, callback) {
1244
1363
  }
1245
1364
  };
1246
1365
 
1247
- var ID_REGEX = /[a-zA-Z_0-9\$\-\u00A2-\uFFFF]/;
1366
+ var ID_REGEX = /[a-zA-Z_0-9\$\-\u00A2-\u2000\u2070-\uFFFF]/;
1248
1367
 
1249
1368
  exports.retrievePrecedingIdentifier = function(text, pos, regex) {
1250
1369
  regex = regex || ID_REGEX;
@@ -1287,16 +1406,16 @@ exports.getCompletionPrefix = function (editor) {
1287
1406
 
1288
1407
  });
1289
1408
 
1290
- define("ace/autocomplete",["require","exports","module","ace/keyboard/hash_handler","ace/autocomplete/popup","ace/autocomplete/util","ace/lib/event","ace/lib/lang","ace/lib/dom","ace/snippets"], function(require, exports, module) {
1409
+ define("ace/autocomplete",["require","exports","module","ace/keyboard/hash_handler","ace/autocomplete/popup","ace/autocomplete/util","ace/lib/lang","ace/lib/dom","ace/snippets","ace/config"], function(require, exports, module) {
1291
1410
  "use strict";
1292
1411
 
1293
1412
  var HashHandler = require("./keyboard/hash_handler").HashHandler;
1294
1413
  var AcePopup = require("./autocomplete/popup").AcePopup;
1295
1414
  var util = require("./autocomplete/util");
1296
- var event = require("./lib/event");
1297
1415
  var lang = require("./lib/lang");
1298
1416
  var dom = require("./lib/dom");
1299
1417
  var snippetManager = require("./snippets").snippetManager;
1418
+ var config = require("./config");
1300
1419
 
1301
1420
  var Autocomplete = function() {
1302
1421
  this.autoInsert = false;
@@ -1367,6 +1486,7 @@ var Autocomplete = function() {
1367
1486
  } else if (keepPopupPosition && !prefix) {
1368
1487
  this.detach();
1369
1488
  }
1489
+ this.changeTimer.cancel();
1370
1490
  };
1371
1491
 
1372
1492
  this.detach = function() {
@@ -1420,17 +1540,7 @@ var Autocomplete = function() {
1420
1540
  };
1421
1541
 
1422
1542
  this.goTo = function(where) {
1423
- var row = this.popup.getRow();
1424
- var max = this.popup.session.getLength() - 1;
1425
-
1426
- switch(where) {
1427
- case "up": row = row <= 0 ? max : row - 1; break;
1428
- case "down": row = row >= max ? -1 : row + 1; break;
1429
- case "start": row = 0; break;
1430
- case "end": row = max; break;
1431
- }
1432
-
1433
- this.popup.setRow(row);
1543
+ this.popup.goTo(where);
1434
1544
  };
1435
1545
 
1436
1546
  this.insertMatch = function(data, options) {
@@ -1439,13 +1549,15 @@ var Autocomplete = function() {
1439
1549
  if (!data)
1440
1550
  return false;
1441
1551
 
1552
+ var completions = this.completions;
1553
+ this.editor.startOperation({command: {name: "insertMatch"}});
1442
1554
  if (data.completer && data.completer.insertMatch) {
1443
1555
  data.completer.insertMatch(this.editor, data);
1444
1556
  } else {
1445
- if (this.completions.filterText) {
1557
+ if (completions.filterText) {
1446
1558
  var ranges = this.editor.selection.getAllRanges();
1447
1559
  for (var i = 0, range; range = ranges[i]; i++) {
1448
- range.start.column -= this.completions.filterText.length;
1560
+ range.start.column -= completions.filterText.length;
1449
1561
  this.editor.session.remove(range);
1450
1562
  }
1451
1563
  }
@@ -1454,7 +1566,9 @@ var Autocomplete = function() {
1454
1566
  else
1455
1567
  this.editor.execCommand("insertstring", data.value || data);
1456
1568
  }
1457
- this.detach();
1569
+ if (this.completions == completions)
1570
+ this.detach();
1571
+ this.editor.endOperation();
1458
1572
  };
1459
1573
 
1460
1574
 
@@ -1504,7 +1618,7 @@ var Autocomplete = function() {
1504
1618
  return true;
1505
1619
  };
1506
1620
 
1507
- this.showPopup = function(editor) {
1621
+ this.showPopup = function(editor, options) {
1508
1622
  if (this.editor)
1509
1623
  this.detach();
1510
1624
 
@@ -1522,10 +1636,10 @@ var Autocomplete = function() {
1522
1636
  editor.on("mousedown", this.mousedownListener);
1523
1637
  editor.on("mousewheel", this.mousewheelListener);
1524
1638
 
1525
- this.updateCompletions();
1639
+ this.updateCompletions(false, options);
1526
1640
  };
1527
1641
 
1528
- this.updateCompletions = function(keepPopupPosition) {
1642
+ this.updateCompletions = function(keepPopupPosition, options) {
1529
1643
  if (keepPopupPosition && this.base && this.completions) {
1530
1644
  var pos = this.editor.getCursorPosition();
1531
1645
  var prefix = this.editor.session.getTextRange({start: this.base, end: pos});
@@ -1541,6 +1655,14 @@ var Autocomplete = function() {
1541
1655
  this.openPopup(this.editor, prefix, keepPopupPosition);
1542
1656
  return;
1543
1657
  }
1658
+
1659
+ if (options && options.matches) {
1660
+ var pos = this.editor.getSelectionRange().start;
1661
+ this.base = this.editor.session.doc.createAnchor(pos.row, pos.column);
1662
+ this.base.$insertRight = true;
1663
+ this.completions = new FilteredList(options.matches);
1664
+ return this.openPopup(this.editor, "", keepPopupPosition);
1665
+ }
1544
1666
  var _id = this.gatherCompletionsId;
1545
1667
  this.gatherCompletions(this.editor, function(err, results) {
1546
1668
  var detachIfFinished = function() {
@@ -1590,7 +1712,7 @@ var Autocomplete = function() {
1590
1712
  doc = completer.getDocTooltip(selected);
1591
1713
  return doc;
1592
1714
  });
1593
- if (!doc)
1715
+ if (!doc && typeof selected != "string")
1594
1716
  doc = selected;
1595
1717
 
1596
1718
  if (typeof doc == "string")
@@ -1672,17 +1794,47 @@ var Autocomplete = function() {
1672
1794
  }
1673
1795
  };
1674
1796
 
1797
+ this.destroy = function() {
1798
+ this.detach();
1799
+ if (this.popup) {
1800
+ this.popup.destroy();
1801
+ var el = this.popup.container;
1802
+ if (el && el.parentNode)
1803
+ el.parentNode.removeChild(el);
1804
+ }
1805
+ if (this.editor && this.editor.completer == this)
1806
+ this.editor.completer == null;
1807
+ this.popup = null;
1808
+ };
1809
+
1675
1810
  }).call(Autocomplete.prototype);
1676
1811
 
1812
+
1813
+ Autocomplete.for = function(editor) {
1814
+ if (editor.completer) {
1815
+ return editor.completer;
1816
+ }
1817
+ if (config.get("sharedPopups")) {
1818
+ if (!Autocomplete.$shared)
1819
+ Autocomplete.$sharedInstance = new Autocomplete();
1820
+ editor.completer = Autocomplete.$sharedInstance;
1821
+ } else {
1822
+ editor.completer = new Autocomplete();
1823
+ editor.once("destroy", function(e, editor) {
1824
+ editor.completer.destroy();
1825
+ });
1826
+ }
1827
+ return editor.completer;
1828
+ };
1829
+
1677
1830
  Autocomplete.startCommand = {
1678
1831
  name: "startAutocomplete",
1679
- exec: function(editor) {
1680
- if (!editor.completer)
1681
- editor.completer = new Autocomplete();
1682
- editor.completer.autoInsert = false;
1683
- editor.completer.autoSelect = true;
1684
- editor.completer.showPopup(editor);
1685
- editor.completer.cancelContextMenu();
1832
+ exec: function(editor, options) {
1833
+ var completer = Autocomplete.for(editor);
1834
+ completer.autoInsert = false;
1835
+ completer.autoSelect = true;
1836
+ completer.showPopup(editor, options);
1837
+ completer.cancelContextMenu();
1686
1838
  },
1687
1839
  bindKey: "Ctrl-Space|Ctrl-Shift-Space|Alt-Space"
1688
1840
  };
@@ -1704,7 +1856,7 @@ var FilteredList = function(array, filterText) {
1704
1856
  matches = this.filterCompletions(matches, this.filterText);
1705
1857
  matches = matches.sort(function(a, b) {
1706
1858
  return b.exactMatch - a.exactMatch || b.$score - a.$score
1707
- || (a.caption || a.value) < (b.caption || b.value);
1859
+ || (a.caption || a.value).localeCompare(b.caption || b.value);
1708
1860
  });
1709
1861
  var prev = null;
1710
1862
  matches = matches.filter(function(item){
@@ -1895,31 +2047,33 @@ var onChangeMode = function(e, editor) {
1895
2047
  };
1896
2048
 
1897
2049
  var loadSnippetsForMode = function(mode) {
1898
- var id = mode.$id;
2050
+ if (typeof mode == "string")
2051
+ mode = config.$modes[mode];
2052
+ if (!mode)
2053
+ return;
1899
2054
  if (!snippetManager.files)
1900
2055
  snippetManager.files = {};
1901
- loadSnippetFile(id);
2056
+
2057
+ loadSnippetFile(mode.$id, mode.snippetFileId);
1902
2058
  if (mode.modes)
1903
2059
  mode.modes.forEach(loadSnippetsForMode);
1904
2060
  };
1905
2061
 
1906
- var loadSnippetFile = function(id) {
1907
- if (!id || snippetManager.files[id])
2062
+ var loadSnippetFile = function(id, snippetFilePath) {
2063
+ if (!snippetFilePath || !id || snippetManager.files[id])
1908
2064
  return;
1909
- var snippetFilePath = id.replace("mode", "snippets");
1910
2065
  snippetManager.files[id] = {};
1911
2066
  config.loadModule(snippetFilePath, function(m) {
1912
- if (m) {
1913
- snippetManager.files[id] = m;
1914
- if (!m.snippets && m.snippetText)
1915
- m.snippets = snippetManager.parseSnippetFile(m.snippetText);
1916
- snippetManager.register(m.snippets || [], m.scope);
1917
- if (m.includeScopes) {
1918
- snippetManager.snippetMap[m.scope].includeScopes = m.includeScopes;
1919
- m.includeScopes.forEach(function(x) {
1920
- loadSnippetFile("ace/mode/" + x);
1921
- });
1922
- }
2067
+ if (!m) return;
2068
+ snippetManager.files[id] = m;
2069
+ if (!m.snippets && m.snippetText)
2070
+ m.snippets = snippetManager.parseSnippetFile(m.snippetText);
2071
+ snippetManager.register(m.snippets || [], m.scope);
2072
+ if (m.includeScopes) {
2073
+ snippetManager.snippetMap[m.scope].includeScopes = m.includeScopes;
2074
+ m.includeScopes.forEach(function(x) {
2075
+ loadSnippetsForMode("ace/mode/" + x);
2076
+ });
1923
2077
  }
1924
2078
  });
1925
2079
  };
@@ -1934,11 +2088,9 @@ var doLiveAutocomplete = function(e) {
1934
2088
  else if (e.command.name === "insertstring") {
1935
2089
  var prefix = util.getCompletionPrefix(editor);
1936
2090
  if (prefix && !hasCompleter) {
1937
- if (!editor.completer) {
1938
- editor.completer = new Autocomplete();
1939
- }
1940
- editor.completer.autoInsert = false;
1941
- editor.completer.showPopup(editor);
2091
+ var completer = Autocomplete.for(editor);
2092
+ completer.autoInsert = false;
2093
+ completer.showPopup(editor);
1942
2094
  }
1943
2095
  }
1944
2096
  };