@openui5/sap.ui.codeeditor 1.132.1 → 1.134.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (452) hide show
  1. package/.reuse/dep5 +2 -9
  2. package/LICENSES/LicenseRef-Unicode-3.0.txt +39 -0
  3. package/THIRDPARTY.txt +45 -78
  4. package/package.json +2 -2
  5. package/src/sap/ui/codeeditor/.library +2 -2
  6. package/src/sap/ui/codeeditor/CodeEditor.js +4 -4
  7. package/src/sap/ui/codeeditor/js/ace/ace.js +6564 -6162
  8. package/src/sap/ui/codeeditor/js/ace/css/ace.css +55 -23
  9. package/src/sap/ui/codeeditor/js/ace/css/github_light_default-1.png +0 -0
  10. package/src/sap/ui/codeeditor/js/ace/css/github_light_default-2.png +0 -0
  11. package/src/sap/ui/codeeditor/js/ace/css/main-10.svg +4 -0
  12. package/src/sap/ui/codeeditor/js/ace/css/main-11.svg +5 -0
  13. package/src/sap/ui/codeeditor/js/ace/css/main-12.svg +4 -0
  14. package/src/sap/ui/codeeditor/js/ace/css/main-13.png +0 -0
  15. package/src/sap/ui/codeeditor/js/ace/css/main-14.png +0 -0
  16. package/src/sap/ui/codeeditor/js/ace/css/main-15.png +0 -0
  17. package/src/sap/ui/codeeditor/js/ace/css/main-16.png +0 -0
  18. package/src/sap/ui/codeeditor/js/ace/css/main-17.png +0 -0
  19. package/src/sap/ui/codeeditor/js/ace/css/main-18.png +0 -0
  20. package/src/sap/ui/codeeditor/js/ace/css/main-19.png +0 -0
  21. package/src/sap/ui/codeeditor/js/ace/css/main-20.png +0 -0
  22. package/src/sap/ui/codeeditor/js/ace/css/main-21.png +0 -0
  23. package/src/sap/ui/codeeditor/js/ace/css/main-22.png +0 -0
  24. package/src/sap/ui/codeeditor/js/ace/css/main-23.png +0 -0
  25. package/src/sap/ui/codeeditor/js/ace/css/main-24.png +0 -0
  26. package/src/sap/ui/codeeditor/js/ace/css/main-25.svg +1 -0
  27. package/src/sap/ui/codeeditor/js/ace/css/main-26.png +0 -0
  28. package/src/sap/ui/codeeditor/js/ace/css/main-6.svg +8 -6
  29. package/src/sap/ui/codeeditor/js/ace/css/main-7.svg +4 -6
  30. package/src/sap/ui/codeeditor/js/ace/css/main-8.svg +8 -3
  31. package/src/sap/ui/codeeditor/js/ace/css/main-9.svg +5 -3
  32. package/src/sap/ui/codeeditor/js/ace/css/theme/cloud_editor.css +221 -0
  33. package/src/sap/ui/codeeditor/js/ace/css/theme/cloud_editor_dark.css +224 -0
  34. package/src/sap/ui/codeeditor/js/ace/css/theme/github_light_default.css +164 -0
  35. package/src/sap/ui/codeeditor/js/ace/css/theme/solarized_dark.css +2 -2
  36. package/src/sap/ui/codeeditor/js/ace/ext-beautify.js +0 -0
  37. package/src/sap/ui/codeeditor/js/ace/ext-code_lens.js +1 -6
  38. package/src/sap/ui/codeeditor/js/ace/ext-command_bar.js +4 -2
  39. package/src/sap/ui/codeeditor/js/ace/ext-elastic_tabstops_lite.js +0 -0
  40. package/src/sap/ui/codeeditor/js/ace/ext-emmet.js +24 -6
  41. package/src/sap/ui/codeeditor/js/ace/ext-error_marker.js +0 -0
  42. package/src/sap/ui/codeeditor/js/ace/ext-inline_autocomplete.js +198 -87
  43. package/src/sap/ui/codeeditor/js/ace/ext-keybinding_menu.js +8 -5
  44. package/src/sap/ui/codeeditor/js/ace/ext-language_tools.js +180 -79
  45. package/src/sap/ui/codeeditor/js/ace/ext-linking.js +0 -0
  46. package/src/sap/ui/codeeditor/js/ace/ext-modelist.js +7 -3
  47. package/src/sap/ui/codeeditor/js/ace/ext-options.js +12 -5
  48. package/src/sap/ui/codeeditor/js/ace/ext-prompt.js +202 -116
  49. package/src/sap/ui/codeeditor/js/ace/ext-rtl.js +0 -0
  50. package/src/sap/ui/codeeditor/js/ace/ext-searchbox.js +14 -12
  51. package/src/sap/ui/codeeditor/js/ace/ext-settings_menu.js +12 -5
  52. package/src/sap/ui/codeeditor/js/ace/ext-spellcheck.js +0 -0
  53. package/src/sap/ui/codeeditor/js/ace/ext-split.js +2 -1
  54. package/src/sap/ui/codeeditor/js/ace/ext-static_highlight.js +0 -0
  55. package/src/sap/ui/codeeditor/js/ace/ext-statusbar.js +0 -0
  56. package/src/sap/ui/codeeditor/js/ace/ext-textarea.js +476 -3
  57. package/src/sap/ui/codeeditor/js/ace/ext-themelist.js +6 -2
  58. package/src/sap/ui/codeeditor/js/ace/ext-whitespace.js +0 -0
  59. package/src/sap/ui/codeeditor/js/ace/keybinding-emacs.js +13 -6
  60. package/src/sap/ui/codeeditor/js/ace/keybinding-vim.js +748 -373
  61. package/src/sap/ui/codeeditor/js/ace/mode-abap.js +0 -0
  62. package/src/sap/ui/codeeditor/js/ace/mode-abc.js +0 -0
  63. package/src/sap/ui/codeeditor/js/ace/mode-actionscript.js +0 -0
  64. package/src/sap/ui/codeeditor/js/ace/mode-ada.js +3 -3
  65. package/src/sap/ui/codeeditor/js/ace/mode-apache_conf.js +0 -0
  66. package/src/sap/ui/codeeditor/js/ace/mode-apex.js +6 -6
  67. package/src/sap/ui/codeeditor/js/ace/mode-applescript.js +3 -3
  68. package/src/sap/ui/codeeditor/js/ace/mode-aql.js +3 -3
  69. package/src/sap/ui/codeeditor/js/ace/mode-asciidoc.js +0 -0
  70. package/src/sap/ui/codeeditor/js/ace/mode-asl.js +14 -14
  71. package/src/sap/ui/codeeditor/js/ace/mode-assembly_arm32.js +185 -0
  72. package/src/sap/ui/codeeditor/js/ace/mode-assembly_x86.js +0 -0
  73. package/src/sap/ui/codeeditor/js/ace/mode-astro.js +377 -317
  74. package/src/sap/ui/codeeditor/js/ace/mode-autohotkey.js +0 -0
  75. package/src/sap/ui/codeeditor/js/ace/mode-basic.js +201 -0
  76. package/src/sap/ui/codeeditor/js/ace/mode-batchfile.js +0 -0
  77. package/src/sap/ui/codeeditor/js/ace/mode-c9search.js +1 -1
  78. package/src/sap/ui/codeeditor/js/ace/mode-c_cpp.js +13 -13
  79. package/src/sap/ui/codeeditor/js/ace/mode-cirru.js +0 -0
  80. package/src/sap/ui/codeeditor/js/ace/mode-clojure.js +13 -13
  81. package/src/sap/ui/codeeditor/js/ace/mode-cobol.js +3 -3
  82. package/src/sap/ui/codeeditor/js/ace/mode-coffee.js +0 -0
  83. package/src/sap/ui/codeeditor/js/ace/mode-coldfusion.js +377 -317
  84. package/src/sap/ui/codeeditor/js/ace/mode-crystal.js +6 -6
  85. package/src/sap/ui/codeeditor/js/ace/mode-csharp.js +9 -9
  86. package/src/sap/ui/codeeditor/js/ace/mode-csound_document.js +75 -78
  87. package/src/sap/ui/codeeditor/js/ace/mode-csound_orchestra.js +22 -22
  88. package/src/sap/ui/codeeditor/js/ace/mode-csound_score.js +0 -0
  89. package/src/sap/ui/codeeditor/js/ace/mode-csp.js +0 -0
  90. package/src/sap/ui/codeeditor/js/ace/mode-css.js +6 -3
  91. package/src/sap/ui/codeeditor/js/ace/mode-curly.js +377 -317
  92. package/src/sap/ui/codeeditor/js/ace/mode-d.js +12 -12
  93. package/src/sap/ui/codeeditor/js/ace/mode-dart.js +17 -17
  94. package/src/sap/ui/codeeditor/js/ace/mode-diff.js +0 -0
  95. package/src/sap/ui/codeeditor/js/ace/mode-django.js +377 -317
  96. package/src/sap/ui/codeeditor/js/ace/mode-dockerfile.js +3 -3
  97. package/src/sap/ui/codeeditor/js/ace/mode-dot.js +6 -6
  98. package/src/sap/ui/codeeditor/js/ace/mode-drools.js +18 -18
  99. package/src/sap/ui/codeeditor/js/ace/mode-edifact.js +4 -4
  100. package/src/sap/ui/codeeditor/js/ace/mode-eiffel.js +4 -4
  101. package/src/sap/ui/codeeditor/js/ace/mode-ejs.js +402 -342
  102. package/src/sap/ui/codeeditor/js/ace/mode-elixir.js +0 -0
  103. package/src/sap/ui/codeeditor/js/ace/mode-elm.js +0 -0
  104. package/src/sap/ui/codeeditor/js/ace/mode-erlang.js +15 -15
  105. package/src/sap/ui/codeeditor/js/ace/mode-flix.js +7 -7
  106. package/src/sap/ui/codeeditor/js/ace/mode-forth.js +0 -0
  107. package/src/sap/ui/codeeditor/js/ace/mode-fortran.js +12 -12
  108. package/src/sap/ui/codeeditor/js/ace/mode-fsharp.js +0 -0
  109. package/src/sap/ui/codeeditor/js/ace/mode-ftl.js +54 -57
  110. package/src/sap/ui/codeeditor/js/ace/mode-gcode.js +4 -4
  111. package/src/sap/ui/codeeditor/js/ace/mode-gherkin.js +3 -3
  112. package/src/sap/ui/codeeditor/js/ace/mode-gitignore.js +1 -1
  113. package/src/sap/ui/codeeditor/js/ace/mode-glsl.js +13 -13
  114. package/src/sap/ui/codeeditor/js/ace/mode-gobstones.js +371 -65
  115. package/src/sap/ui/codeeditor/js/ace/mode-golang.js +10 -10
  116. package/src/sap/ui/codeeditor/js/ace/mode-graphqlschema.js +0 -0
  117. package/src/sap/ui/codeeditor/js/ace/mode-groovy.js +381 -75
  118. package/src/sap/ui/codeeditor/js/ace/mode-haml.js +84 -87
  119. package/src/sap/ui/codeeditor/js/ace/mode-handlebars.js +379 -319
  120. package/src/sap/ui/codeeditor/js/ace/mode-haskell.js +0 -0
  121. package/src/sap/ui/codeeditor/js/ace/mode-haskell_cabal.js +1 -1
  122. package/src/sap/ui/codeeditor/js/ace/mode-haxe.js +10 -10
  123. package/src/sap/ui/codeeditor/js/ace/mode-hjson.js +0 -0
  124. package/src/sap/ui/codeeditor/js/ace/mode-html.js +377 -317
  125. package/src/sap/ui/codeeditor/js/ace/mode-html_elixir.js +472 -412
  126. package/src/sap/ui/codeeditor/js/ace/mode-html_ruby.js +484 -424
  127. package/src/sap/ui/codeeditor/js/ace/mode-ini.js +0 -0
  128. package/src/sap/ui/codeeditor/js/ace/mode-io.js +0 -0
  129. package/src/sap/ui/codeeditor/js/ace/mode-jack.js +2 -2
  130. package/src/sap/ui/codeeditor/js/ace/mode-jade.js +67 -70
  131. package/src/sap/ui/codeeditor/js/ace/mode-java.js +383 -77
  132. package/src/sap/ui/codeeditor/js/ace/mode-javascript.js +371 -65
  133. package/src/sap/ui/codeeditor/js/ace/mode-jexl.js +7 -7
  134. package/src/sap/ui/codeeditor/js/ace/mode-json.js +8 -8
  135. package/src/sap/ui/codeeditor/js/ace/mode-json5.js +8 -8
  136. package/src/sap/ui/codeeditor/js/ace/mode-jsoniq.js +4 -5
  137. package/src/sap/ui/codeeditor/js/ace/mode-jsp.js +67 -70
  138. package/src/sap/ui/codeeditor/js/ace/mode-jssm.js +0 -0
  139. package/src/sap/ui/codeeditor/js/ace/mode-jsx.js +960 -89
  140. package/src/sap/ui/codeeditor/js/ace/mode-julia.js +0 -0
  141. package/src/sap/ui/codeeditor/js/ace/mode-kotlin.js +0 -0
  142. package/src/sap/ui/codeeditor/js/ace/mode-latex.js +0 -0
  143. package/src/sap/ui/codeeditor/js/ace/mode-latte.js +381 -321
  144. package/src/sap/ui/codeeditor/js/ace/mode-less.js +12 -9
  145. package/src/sap/ui/codeeditor/js/ace/mode-liquid.js +385 -325
  146. package/src/sap/ui/codeeditor/js/ace/mode-lisp.js +2 -2
  147. package/src/sap/ui/codeeditor/js/ace/mode-livescript.js +0 -0
  148. package/src/sap/ui/codeeditor/js/ace/mode-logiql.js +0 -0
  149. package/src/sap/ui/codeeditor/js/ace/mode-logtalk.js +6 -9
  150. package/src/sap/ui/codeeditor/js/ace/mode-lsl.js +0 -0
  151. package/src/sap/ui/codeeditor/js/ace/mode-lua.js +5 -5
  152. package/src/sap/ui/codeeditor/js/ace/mode-luapage.js +382 -322
  153. package/src/sap/ui/codeeditor/js/ace/mode-lucene.js +0 -0
  154. package/src/sap/ui/codeeditor/js/ace/mode-makefile.js +3 -3
  155. package/src/sap/ui/codeeditor/js/ace/mode-markdown.js +474 -414
  156. package/src/sap/ui/codeeditor/js/ace/mode-mask.js +53 -56
  157. package/src/sap/ui/codeeditor/js/ace/mode-matlab.js +1 -1
  158. package/src/sap/ui/codeeditor/js/ace/mode-maze.js +0 -0
  159. package/src/sap/ui/codeeditor/js/ace/mode-mel.js +0 -0
  160. package/src/sap/ui/codeeditor/js/ace/mode-mips.js +1 -1
  161. package/src/sap/ui/codeeditor/js/ace/mode-mixal.js +0 -0
  162. package/src/sap/ui/codeeditor/js/ace/mode-mushcode.js +7 -7
  163. package/src/sap/ui/codeeditor/js/ace/mode-mysql.js +7 -7
  164. package/src/sap/ui/codeeditor/js/ace/mode-nix.js +16 -16
  165. package/src/sap/ui/codeeditor/js/ace/mode-nsis.js +0 -0
  166. package/src/sap/ui/codeeditor/js/ace/mode-nunjucks.js +379 -319
  167. package/src/sap/ui/codeeditor/js/ace/mode-objectivec.js +15 -15
  168. package/src/sap/ui/codeeditor/js/ace/mode-ocaml.js +7 -7
  169. package/src/sap/ui/codeeditor/js/ace/mode-odin.js +10 -10
  170. package/src/sap/ui/codeeditor/js/ace/mode-pascal.js +0 -0
  171. package/src/sap/ui/codeeditor/js/ace/mode-perl.js +6 -6
  172. package/src/sap/ui/codeeditor/js/ace/mode-pgsql.js +98 -104
  173. package/src/sap/ui/codeeditor/js/ace/mode-php.js +797 -616
  174. package/src/sap/ui/codeeditor/js/ace/mode-php_laravel_blade.js +797 -616
  175. package/src/sap/ui/codeeditor/js/ace/mode-pig.js +0 -0
  176. package/src/sap/ui/codeeditor/js/ace/mode-plain_text.js +0 -0
  177. package/src/sap/ui/codeeditor/js/ace/mode-plsql.js +3 -3
  178. package/src/sap/ui/codeeditor/js/ace/mode-powershell.js +6 -6
  179. package/src/sap/ui/codeeditor/js/ace/mode-praat.js +0 -0
  180. package/src/sap/ui/codeeditor/js/ace/mode-prolog.js +0 -0
  181. package/src/sap/ui/codeeditor/js/ace/mode-properties.js +0 -0
  182. package/src/sap/ui/codeeditor/js/ace/mode-protobuf.js +18 -18
  183. package/src/sap/ui/codeeditor/js/ace/mode-prql.js +7 -4
  184. package/src/sap/ui/codeeditor/js/ace/mode-puppet.js +0 -0
  185. package/src/sap/ui/codeeditor/js/ace/mode-python.js +17 -17
  186. package/src/sap/ui/codeeditor/js/ace/mode-qml.js +5 -5
  187. package/src/sap/ui/codeeditor/js/ace/mode-r.js +13 -13
  188. package/src/sap/ui/codeeditor/js/ace/mode-raku.js +8 -8
  189. package/src/sap/ui/codeeditor/js/ace/mode-razor.js +386 -326
  190. package/src/sap/ui/codeeditor/js/ace/mode-rdoc.js +6 -6
  191. package/src/sap/ui/codeeditor/js/ace/mode-red.js +0 -0
  192. package/src/sap/ui/codeeditor/js/ace/mode-redshift.js +32 -32
  193. package/src/sap/ui/codeeditor/js/ace/mode-rhtml.js +390 -330
  194. package/src/sap/ui/codeeditor/js/ace/mode-rst.js +0 -0
  195. package/src/sap/ui/codeeditor/js/ace/mode-ruby.js +25 -25
  196. package/src/sap/ui/codeeditor/js/ace/mode-rust.js +39 -32
  197. package/src/sap/ui/codeeditor/js/ace/mode-sac.js +13 -13
  198. package/src/sap/ui/codeeditor/js/ace/mode-sass.js +14 -11
  199. package/src/sap/ui/codeeditor/js/ace/mode-scad.js +14 -14
  200. package/src/sap/ui/codeeditor/js/ace/mode-scala.js +381 -75
  201. package/src/sap/ui/codeeditor/js/ace/mode-scheme.js +2 -2
  202. package/src/sap/ui/codeeditor/js/ace/mode-scrypt.js +10 -10
  203. package/src/sap/ui/codeeditor/js/ace/mode-scss.js +14 -11
  204. package/src/sap/ui/codeeditor/js/ace/mode-sh.js +3 -3
  205. package/src/sap/ui/codeeditor/js/ace/mode-sjs.js +371 -65
  206. package/src/sap/ui/codeeditor/js/ace/mode-slim.js +521 -461
  207. package/src/sap/ui/codeeditor/js/ace/mode-smarty.js +377 -317
  208. package/src/sap/ui/codeeditor/js/ace/mode-snippets.js +0 -0
  209. package/src/sap/ui/codeeditor/js/ace/mode-soy_template.js +377 -317
  210. package/src/sap/ui/codeeditor/js/ace/mode-space.js +0 -0
  211. package/src/sap/ui/codeeditor/js/ace/mode-sparql.js +0 -0
  212. package/src/sap/ui/codeeditor/js/ace/mode-sql.js +12 -6
  213. package/src/sap/ui/codeeditor/js/ace/mode-sqlserver.js +5 -5
  214. package/src/sap/ui/codeeditor/js/ace/mode-stylus.js +10 -7
  215. package/src/sap/ui/codeeditor/js/ace/mode-svg.js +132 -75
  216. package/src/sap/ui/codeeditor/js/ace/mode-swift.js +5 -4
  217. package/src/sap/ui/codeeditor/js/ace/mode-tcl.js +7 -7
  218. package/src/sap/ui/codeeditor/js/ace/mode-terraform.js +0 -0
  219. package/src/sap/ui/codeeditor/js/ace/mode-tex.js +6 -6
  220. package/src/sap/ui/codeeditor/js/ace/mode-text.js +0 -0
  221. package/src/sap/ui/codeeditor/js/ace/mode-textile.js +0 -0
  222. package/src/sap/ui/codeeditor/js/ace/mode-toml.js +0 -0
  223. package/src/sap/ui/codeeditor/js/ace/mode-tsx.js +492 -182
  224. package/src/sap/ui/codeeditor/js/ace/mode-turtle.js +0 -0
  225. package/src/sap/ui/codeeditor/js/ace/mode-twig.js +379 -319
  226. package/src/sap/ui/codeeditor/js/ace/mode-typescript.js +371 -65
  227. package/src/sap/ui/codeeditor/js/ace/mode-vala.js +0 -0
  228. package/src/sap/ui/codeeditor/js/ace/mode-vbscript.js +0 -0
  229. package/src/sap/ui/codeeditor/js/ace/mode-velocity.js +387 -327
  230. package/src/sap/ui/codeeditor/js/ace/mode-verilog.js +1 -1
  231. package/src/sap/ui/codeeditor/js/ace/mode-vhdl.js +4 -4
  232. package/src/sap/ui/codeeditor/js/ace/mode-visualforce.js +377 -317
  233. package/src/sap/ui/codeeditor/js/ace/mode-vue.js +3834 -0
  234. package/src/sap/ui/codeeditor/js/ace/mode-wollok.js +382 -76
  235. package/src/sap/ui/codeeditor/js/ace/mode-xml.js +18 -10
  236. package/src/sap/ui/codeeditor/js/ace/mode-xquery.js +4 -5
  237. package/src/sap/ui/codeeditor/js/ace/mode-yaml.js +5 -5
  238. package/src/sap/ui/codeeditor/js/ace/mode-zeek.js +2 -2
  239. package/src/sap/ui/codeeditor/js/ace/mode-zig.js +585 -0
  240. package/src/sap/ui/codeeditor/js/ace/snippets/abap.js +0 -0
  241. package/src/sap/ui/codeeditor/js/ace/snippets/abc.js +0 -0
  242. package/src/sap/ui/codeeditor/js/ace/snippets/actionscript.js +0 -0
  243. package/src/sap/ui/codeeditor/js/ace/snippets/ada.js +0 -0
  244. package/src/sap/ui/codeeditor/js/ace/snippets/apache_conf.js +0 -0
  245. package/src/sap/ui/codeeditor/js/ace/snippets/applescript.js +0 -0
  246. package/src/sap/ui/codeeditor/js/ace/snippets/asciidoc.js +0 -0
  247. package/src/sap/ui/codeeditor/js/ace/snippets/asl.js +0 -0
  248. package/src/sap/ui/codeeditor/js/ace/snippets/assembly_arm32.js +9 -0
  249. package/src/sap/ui/codeeditor/js/ace/snippets/assembly_x86.js +0 -0
  250. package/src/sap/ui/codeeditor/js/ace/snippets/autohotkey.js +0 -0
  251. package/src/sap/ui/codeeditor/js/ace/snippets/basic.js +9 -0
  252. package/src/sap/ui/codeeditor/js/ace/snippets/batchfile.js +0 -0
  253. package/src/sap/ui/codeeditor/js/ace/snippets/c9search.js +0 -0
  254. package/src/sap/ui/codeeditor/js/ace/snippets/c_cpp.js +0 -0
  255. package/src/sap/ui/codeeditor/js/ace/snippets/cirru.js +0 -0
  256. package/src/sap/ui/codeeditor/js/ace/snippets/clojure.js +0 -0
  257. package/src/sap/ui/codeeditor/js/ace/snippets/cobol.js +0 -0
  258. package/src/sap/ui/codeeditor/js/ace/snippets/coffee.js +0 -0
  259. package/src/sap/ui/codeeditor/js/ace/snippets/coldfusion.js +0 -0
  260. package/src/sap/ui/codeeditor/js/ace/snippets/csharp.js +0 -0
  261. package/src/sap/ui/codeeditor/js/ace/snippets/csound_document.js +0 -0
  262. package/src/sap/ui/codeeditor/js/ace/snippets/csound_orchestra.js +0 -0
  263. package/src/sap/ui/codeeditor/js/ace/snippets/csound_score.js +0 -0
  264. package/src/sap/ui/codeeditor/js/ace/snippets/csp.js +0 -0
  265. package/src/sap/ui/codeeditor/js/ace/snippets/css.js +0 -0
  266. package/src/sap/ui/codeeditor/js/ace/snippets/curly.js +0 -0
  267. package/src/sap/ui/codeeditor/js/ace/snippets/d.js +0 -0
  268. package/src/sap/ui/codeeditor/js/ace/snippets/dart.js +0 -0
  269. package/src/sap/ui/codeeditor/js/ace/snippets/diff.js +0 -0
  270. package/src/sap/ui/codeeditor/js/ace/snippets/django.js +0 -0
  271. package/src/sap/ui/codeeditor/js/ace/snippets/dockerfile.js +0 -0
  272. package/src/sap/ui/codeeditor/js/ace/snippets/dot.js +0 -0
  273. package/src/sap/ui/codeeditor/js/ace/snippets/drools.js +0 -0
  274. package/src/sap/ui/codeeditor/js/ace/snippets/edifact.js +0 -0
  275. package/src/sap/ui/codeeditor/js/ace/snippets/eiffel.js +0 -0
  276. package/src/sap/ui/codeeditor/js/ace/snippets/ejs.js +0 -0
  277. package/src/sap/ui/codeeditor/js/ace/snippets/elixir.js +0 -0
  278. package/src/sap/ui/codeeditor/js/ace/snippets/elm.js +0 -0
  279. package/src/sap/ui/codeeditor/js/ace/snippets/erlang.js +0 -0
  280. package/src/sap/ui/codeeditor/js/ace/snippets/forth.js +0 -0
  281. package/src/sap/ui/codeeditor/js/ace/snippets/fortran.js +0 -0
  282. package/src/sap/ui/codeeditor/js/ace/snippets/fsharp.js +0 -0
  283. package/src/sap/ui/codeeditor/js/ace/snippets/ftl.js +0 -0
  284. package/src/sap/ui/codeeditor/js/ace/snippets/gcode.js +0 -0
  285. package/src/sap/ui/codeeditor/js/ace/snippets/gherkin.js +0 -0
  286. package/src/sap/ui/codeeditor/js/ace/snippets/gitignore.js +0 -0
  287. package/src/sap/ui/codeeditor/js/ace/snippets/glsl.js +0 -0
  288. package/src/sap/ui/codeeditor/js/ace/snippets/gobstones.js +0 -0
  289. package/src/sap/ui/codeeditor/js/ace/snippets/golang.js +0 -0
  290. package/src/sap/ui/codeeditor/js/ace/snippets/graphqlschema.js +0 -0
  291. package/src/sap/ui/codeeditor/js/ace/snippets/groovy.js +0 -0
  292. package/src/sap/ui/codeeditor/js/ace/snippets/haml.js +0 -0
  293. package/src/sap/ui/codeeditor/js/ace/snippets/handlebars.js +0 -0
  294. package/src/sap/ui/codeeditor/js/ace/snippets/haskell.js +0 -0
  295. package/src/sap/ui/codeeditor/js/ace/snippets/haskell_cabal.js +0 -0
  296. package/src/sap/ui/codeeditor/js/ace/snippets/haxe.js +0 -0
  297. package/src/sap/ui/codeeditor/js/ace/snippets/hjson.js +0 -0
  298. package/src/sap/ui/codeeditor/js/ace/snippets/html.js +0 -0
  299. package/src/sap/ui/codeeditor/js/ace/snippets/html_elixir.js +0 -0
  300. package/src/sap/ui/codeeditor/js/ace/snippets/html_ruby.js +0 -0
  301. package/src/sap/ui/codeeditor/js/ace/snippets/ini.js +0 -0
  302. package/src/sap/ui/codeeditor/js/ace/snippets/io.js +0 -0
  303. package/src/sap/ui/codeeditor/js/ace/snippets/jack.js +0 -0
  304. package/src/sap/ui/codeeditor/js/ace/snippets/jade.js +0 -0
  305. package/src/sap/ui/codeeditor/js/ace/snippets/java.js +0 -0
  306. package/src/sap/ui/codeeditor/js/ace/snippets/javascript.js +0 -0
  307. package/src/sap/ui/codeeditor/js/ace/snippets/json.js +0 -0
  308. package/src/sap/ui/codeeditor/js/ace/snippets/jsoniq.js +0 -0
  309. package/src/sap/ui/codeeditor/js/ace/snippets/jsp.js +0 -0
  310. package/src/sap/ui/codeeditor/js/ace/snippets/jssm.js +0 -0
  311. package/src/sap/ui/codeeditor/js/ace/snippets/jsx.js +0 -0
  312. package/src/sap/ui/codeeditor/js/ace/snippets/julia.js +0 -0
  313. package/src/sap/ui/codeeditor/js/ace/snippets/kotlin.js +0 -0
  314. package/src/sap/ui/codeeditor/js/ace/snippets/latex.js +0 -0
  315. package/src/sap/ui/codeeditor/js/ace/snippets/less.js +0 -0
  316. package/src/sap/ui/codeeditor/js/ace/snippets/liquid.js +0 -0
  317. package/src/sap/ui/codeeditor/js/ace/snippets/lisp.js +0 -0
  318. package/src/sap/ui/codeeditor/js/ace/snippets/livescript.js +0 -0
  319. package/src/sap/ui/codeeditor/js/ace/snippets/logiql.js +0 -0
  320. package/src/sap/ui/codeeditor/js/ace/snippets/lsl.js +0 -0
  321. package/src/sap/ui/codeeditor/js/ace/snippets/lua.js +0 -0
  322. package/src/sap/ui/codeeditor/js/ace/snippets/luapage.js +0 -0
  323. package/src/sap/ui/codeeditor/js/ace/snippets/lucene.js +0 -0
  324. package/src/sap/ui/codeeditor/js/ace/snippets/makefile.js +0 -0
  325. package/src/sap/ui/codeeditor/js/ace/snippets/markdown.js +0 -0
  326. package/src/sap/ui/codeeditor/js/ace/snippets/mask.js +0 -0
  327. package/src/sap/ui/codeeditor/js/ace/snippets/matlab.js +0 -0
  328. package/src/sap/ui/codeeditor/js/ace/snippets/maze.js +0 -0
  329. package/src/sap/ui/codeeditor/js/ace/snippets/mel.js +0 -0
  330. package/src/sap/ui/codeeditor/js/ace/snippets/mixal.js +0 -0
  331. package/src/sap/ui/codeeditor/js/ace/snippets/mushcode.js +0 -0
  332. package/src/sap/ui/codeeditor/js/ace/snippets/mysql.js +0 -0
  333. package/src/sap/ui/codeeditor/js/ace/snippets/nix.js +0 -0
  334. package/src/sap/ui/codeeditor/js/ace/snippets/nsis.js +0 -0
  335. package/src/sap/ui/codeeditor/js/ace/snippets/objectivec.js +0 -0
  336. package/src/sap/ui/codeeditor/js/ace/snippets/ocaml.js +0 -0
  337. package/src/sap/ui/codeeditor/js/ace/snippets/pascal.js +0 -0
  338. package/src/sap/ui/codeeditor/js/ace/snippets/perl.js +0 -0
  339. package/src/sap/ui/codeeditor/js/ace/snippets/pgsql.js +0 -0
  340. package/src/sap/ui/codeeditor/js/ace/snippets/php.js +0 -0
  341. package/src/sap/ui/codeeditor/js/ace/snippets/php_laravel_blade.js +0 -0
  342. package/src/sap/ui/codeeditor/js/ace/snippets/pig.js +0 -0
  343. package/src/sap/ui/codeeditor/js/ace/snippets/plain_text.js +0 -0
  344. package/src/sap/ui/codeeditor/js/ace/snippets/powershell.js +0 -0
  345. package/src/sap/ui/codeeditor/js/ace/snippets/praat.js +0 -0
  346. package/src/sap/ui/codeeditor/js/ace/snippets/prolog.js +0 -0
  347. package/src/sap/ui/codeeditor/js/ace/snippets/properties.js +0 -0
  348. package/src/sap/ui/codeeditor/js/ace/snippets/protobuf.js +0 -0
  349. package/src/sap/ui/codeeditor/js/ace/snippets/puppet.js +0 -0
  350. package/src/sap/ui/codeeditor/js/ace/snippets/python.js +0 -0
  351. package/src/sap/ui/codeeditor/js/ace/snippets/r.js +0 -0
  352. package/src/sap/ui/codeeditor/js/ace/snippets/razor.js +0 -0
  353. package/src/sap/ui/codeeditor/js/ace/snippets/rdoc.js +0 -0
  354. package/src/sap/ui/codeeditor/js/ace/snippets/red.js +0 -0
  355. package/src/sap/ui/codeeditor/js/ace/snippets/redshift.js +0 -0
  356. package/src/sap/ui/codeeditor/js/ace/snippets/rhtml.js +0 -0
  357. package/src/sap/ui/codeeditor/js/ace/snippets/rst.js +0 -0
  358. package/src/sap/ui/codeeditor/js/ace/snippets/ruby.js +0 -0
  359. package/src/sap/ui/codeeditor/js/ace/snippets/rust.js +0 -0
  360. package/src/sap/ui/codeeditor/js/ace/snippets/sass.js +0 -0
  361. package/src/sap/ui/codeeditor/js/ace/snippets/scad.js +0 -0
  362. package/src/sap/ui/codeeditor/js/ace/snippets/scala.js +0 -0
  363. package/src/sap/ui/codeeditor/js/ace/snippets/scheme.js +0 -0
  364. package/src/sap/ui/codeeditor/js/ace/snippets/scss.js +0 -0
  365. package/src/sap/ui/codeeditor/js/ace/snippets/sh.js +0 -0
  366. package/src/sap/ui/codeeditor/js/ace/snippets/sjs.js +0 -0
  367. package/src/sap/ui/codeeditor/js/ace/snippets/slim.js +0 -0
  368. package/src/sap/ui/codeeditor/js/ace/snippets/smarty.js +0 -0
  369. package/src/sap/ui/codeeditor/js/ace/snippets/snippets.js +0 -0
  370. package/src/sap/ui/codeeditor/js/ace/snippets/soy_template.js +0 -0
  371. package/src/sap/ui/codeeditor/js/ace/snippets/space.js +0 -0
  372. package/src/sap/ui/codeeditor/js/ace/snippets/sparql.js +0 -0
  373. package/src/sap/ui/codeeditor/js/ace/snippets/sql.js +0 -0
  374. package/src/sap/ui/codeeditor/js/ace/snippets/sqlserver.js +0 -0
  375. package/src/sap/ui/codeeditor/js/ace/snippets/stylus.js +0 -0
  376. package/src/sap/ui/codeeditor/js/ace/snippets/svg.js +0 -0
  377. package/src/sap/ui/codeeditor/js/ace/snippets/swift.js +0 -0
  378. package/src/sap/ui/codeeditor/js/ace/snippets/tcl.js +0 -0
  379. package/src/sap/ui/codeeditor/js/ace/snippets/terraform.js +0 -0
  380. package/src/sap/ui/codeeditor/js/ace/snippets/tex.js +0 -0
  381. package/src/sap/ui/codeeditor/js/ace/snippets/text.js +0 -0
  382. package/src/sap/ui/codeeditor/js/ace/snippets/textile.js +0 -0
  383. package/src/sap/ui/codeeditor/js/ace/snippets/toml.js +0 -0
  384. package/src/sap/ui/codeeditor/js/ace/snippets/tsx.js +0 -0
  385. package/src/sap/ui/codeeditor/js/ace/snippets/turtle.js +0 -0
  386. package/src/sap/ui/codeeditor/js/ace/snippets/twig.js +0 -0
  387. package/src/sap/ui/codeeditor/js/ace/snippets/typescript.js +0 -0
  388. package/src/sap/ui/codeeditor/js/ace/snippets/vala.js +0 -0
  389. package/src/sap/ui/codeeditor/js/ace/snippets/vbscript.js +0 -0
  390. package/src/sap/ui/codeeditor/js/ace/snippets/velocity.js +0 -0
  391. package/src/sap/ui/codeeditor/js/ace/snippets/verilog.js +0 -0
  392. package/src/sap/ui/codeeditor/js/ace/snippets/vhdl.js +0 -0
  393. package/src/sap/ui/codeeditor/js/ace/snippets/vue.js +9 -0
  394. package/src/sap/ui/codeeditor/js/ace/snippets/wollok.js +0 -0
  395. package/src/sap/ui/codeeditor/js/ace/snippets/xml.js +0 -0
  396. package/src/sap/ui/codeeditor/js/ace/snippets/xquery.js +0 -0
  397. package/src/sap/ui/codeeditor/js/ace/snippets/yaml.js +0 -0
  398. package/src/sap/ui/codeeditor/js/ace/snippets/zig.js +9 -0
  399. package/src/sap/ui/codeeditor/js/ace/theme-ambiance.js +0 -0
  400. package/src/sap/ui/codeeditor/js/ace/theme-chaos.js +0 -0
  401. package/src/sap/ui/codeeditor/js/ace/theme-chrome.js +0 -0
  402. package/src/sap/ui/codeeditor/js/ace/theme-cloud_editor.js +18 -0
  403. package/src/sap/ui/codeeditor/js/ace/theme-cloud_editor_dark.js +18 -0
  404. package/src/sap/ui/codeeditor/js/ace/theme-clouds.js +0 -0
  405. package/src/sap/ui/codeeditor/js/ace/theme-clouds_midnight.js +0 -0
  406. package/src/sap/ui/codeeditor/js/ace/theme-cobalt.js +0 -0
  407. package/src/sap/ui/codeeditor/js/ace/theme-crimson_editor.js +0 -0
  408. package/src/sap/ui/codeeditor/js/ace/theme-dawn.js +0 -0
  409. package/src/sap/ui/codeeditor/js/ace/theme-dracula.js +0 -0
  410. package/src/sap/ui/codeeditor/js/ace/theme-dreamweaver.js +0 -0
  411. package/src/sap/ui/codeeditor/js/ace/theme-eclipse.js +0 -0
  412. package/src/sap/ui/codeeditor/js/ace/theme-github.js +0 -0
  413. package/src/sap/ui/codeeditor/js/ace/theme-github_light_default.js +18 -0
  414. package/src/sap/ui/codeeditor/js/ace/theme-gob.js +0 -0
  415. package/src/sap/ui/codeeditor/js/ace/theme-gruvbox.js +0 -0
  416. package/src/sap/ui/codeeditor/js/ace/theme-idle_fingers.js +0 -0
  417. package/src/sap/ui/codeeditor/js/ace/theme-iplastic.js +0 -0
  418. package/src/sap/ui/codeeditor/js/ace/theme-katzenmilch.js +0 -0
  419. package/src/sap/ui/codeeditor/js/ace/theme-kr_theme.js +0 -0
  420. package/src/sap/ui/codeeditor/js/ace/theme-kuroir.js +0 -0
  421. package/src/sap/ui/codeeditor/js/ace/theme-merbivore.js +0 -0
  422. package/src/sap/ui/codeeditor/js/ace/theme-merbivore_soft.js +0 -0
  423. package/src/sap/ui/codeeditor/js/ace/theme-mono_industrial.js +0 -0
  424. package/src/sap/ui/codeeditor/js/ace/theme-monokai.js +0 -0
  425. package/src/sap/ui/codeeditor/js/ace/theme-pastel_on_dark.js +0 -0
  426. package/src/sap/ui/codeeditor/js/ace/theme-solarized_dark.js +1 -1
  427. package/src/sap/ui/codeeditor/js/ace/theme-solarized_light.js +0 -0
  428. package/src/sap/ui/codeeditor/js/ace/theme-sqlserver.js +0 -0
  429. package/src/sap/ui/codeeditor/js/ace/theme-terminal.js +0 -0
  430. package/src/sap/ui/codeeditor/js/ace/theme-textmate.js +0 -0
  431. package/src/sap/ui/codeeditor/js/ace/theme-tomorrow.js +0 -0
  432. package/src/sap/ui/codeeditor/js/ace/theme-tomorrow_night.js +0 -0
  433. package/src/sap/ui/codeeditor/js/ace/theme-tomorrow_night_blue.js +0 -0
  434. package/src/sap/ui/codeeditor/js/ace/theme-tomorrow_night_bright.js +0 -0
  435. package/src/sap/ui/codeeditor/js/ace/theme-tomorrow_night_eighties.js +0 -0
  436. package/src/sap/ui/codeeditor/js/ace/theme-twilight.js +0 -0
  437. package/src/sap/ui/codeeditor/js/ace/theme-vibrant_ink.js +0 -0
  438. package/src/sap/ui/codeeditor/js/ace/theme-xcode.js +0 -0
  439. package/src/sap/ui/codeeditor/js/ace/worker-base.js +3 -13
  440. package/src/sap/ui/codeeditor/js/ace/worker-coffee.js +3 -13
  441. package/src/sap/ui/codeeditor/js/ace/worker-css.js +3 -13
  442. package/src/sap/ui/codeeditor/js/ace/worker-html.js +3 -13
  443. package/src/sap/ui/codeeditor/js/ace/worker-javascript.js +3 -13
  444. package/src/sap/ui/codeeditor/js/ace/worker-json.js +3 -13
  445. package/src/sap/ui/codeeditor/js/ace/worker-lua.js +3 -13
  446. package/src/sap/ui/codeeditor/js/ace/worker-php.js +3 -13
  447. package/src/sap/ui/codeeditor/js/ace/worker-xml.js +8 -15
  448. package/src/sap/ui/codeeditor/js/ace/worker-xquery.js +3 -13
  449. package/src/sap/ui/codeeditor/js/ace/worker-yaml.js +6 -16
  450. package/src/sap/ui/codeeditor/library.js +2 -2
  451. package/LICENSES/LicenseRef-tzdata-PublicDomain.txt +0 -5
  452. package/LICENSES/Unicode-DFS-2015.txt +0 -51
@@ -74,7 +74,7 @@ var CssHighlightRules = function () {
74
74
  + "|swash|ornaments|annotation|stylistic|styleset|character-variant)"
75
75
  }],
76
76
  "comments": [{
77
- token: "comment",
77
+ token: "comment", // multi line comment
78
78
  regex: "\\/\\*",
79
79
  push: [{
80
80
  token: "comment",
@@ -103,10 +103,10 @@ var CssHighlightRules = function () {
103
103
  token: "constant.numeric",
104
104
  regex: numRe
105
105
  }, {
106
- token: "constant.numeric",
106
+ token: "constant.numeric", // hex6 color
107
107
  regex: "#[a-f0-9]{6}"
108
108
  }, {
109
- token: "constant.numeric",
109
+ token: "constant.numeric", // hex3 color
110
110
  regex: "#[a-f0-9]{3}"
111
111
  }, {
112
112
  token: ["punctuation", "entity.other.attribute-name.pseudo-element.css"],
@@ -119,6 +119,9 @@ var CssHighlightRules = function () {
119
119
  }, {
120
120
  token: keywordMapper,
121
121
  regex: "\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*"
122
+ }, {
123
+ token: "paren.lparen",
124
+ regex: "\\{"
122
125
  }, {
123
126
  caseInsensitive: true
124
127
  }],
@@ -202,7 +205,7 @@ var JsDocCommentHighlightRules = function () {
202
205
  ]
203
206
  }, {
204
207
  token: ["rparen.doc", "text.doc", "variable.parameter.doc", "lparen.doc", "variable.parameter.doc", "rparen.doc"],
205
- regex: /(})(\s*)(?:([\w=:\/\.]+)|(?:(\[)([\w=:\/\.]+)(\])))/,
208
+ regex: /(})(\s*)(?:([\w=:\/\.]+)|(?:(\[)([\w=:\/\.\-\'\" ]+)(\])))/,
206
209
  next: "pop"
207
210
  }, {
208
211
  token: "rparen.doc",
@@ -262,7 +265,7 @@ var JsDocCommentHighlightRules = function () {
262
265
  },
263
266
  JsDocCommentHighlightRules.getTagRule(),
264
267
  {
265
- defaultToken: "comment.doc",
268
+ defaultToken: "comment.doc.body",
266
269
  caseInsensitive: true
267
270
  }
268
271
  ],
@@ -285,14 +288,14 @@ JsDocCommentHighlightRules.getTagRule = function (start) {
285
288
  };
286
289
  JsDocCommentHighlightRules.getStartRule = function (start) {
287
290
  return {
288
- token: "comment.doc",
289
- regex: "\\/\\*(?=\\*)",
291
+ token: "comment.doc", // doc comment
292
+ regex: /\/\*\*(?!\/)/,
290
293
  next: start
291
294
  };
292
295
  };
293
296
  JsDocCommentHighlightRules.getEndRule = function (start) {
294
297
  return {
295
- token: "comment.doc",
298
+ token: "comment.doc", // closing comment
296
299
  regex: "\\*\\/",
297
300
  next: start
298
301
  };
@@ -307,7 +310,7 @@ var DocCommentHighlightRules = require("./jsdoc_comment_highlight_rules").JsDocC
307
310
  var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
308
311
  var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*";
309
312
  var JavaScriptHighlightRules = function (options) {
310
- var keywordMapper = this.createKeywordMapper({
313
+ var keywords = {
311
314
  "variable.language": "Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|Symbol|" + // Constructors
312
315
  "Namespace|QName|XML|XMLList|" + // E4X
313
316
  "ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" +
@@ -317,9 +320,9 @@ var JavaScriptHighlightRules = function (options) {
317
320
  "decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|" + // Non-constructor functions
318
321
  "isNaN|parseFloat|parseInt|" +
319
322
  "JSON|Math|" + // Other
320
- "this|arguments|prototype|window|document",
323
+ "this|arguments|prototype|window|document", // Pseudo
321
324
  "keyword": "const|yield|import|get|set|async|await|" +
322
- "break|case|catch|continue|default|delete|do|else|finally|for|function|" +
325
+ "break|case|catch|continue|default|delete|do|else|finally|for|" +
323
326
  "if|in|of|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|" +
324
327
  "__parent__|__count__|escape|unescape|with|__proto__|" +
325
328
  "class|enum|extends|super|export|implements|private|public|interface|package|protected|static|constructor",
@@ -327,7 +330,8 @@ var JavaScriptHighlightRules = function (options) {
327
330
  "constant.language": "null|Infinity|NaN|undefined",
328
331
  "support.function": "alert",
329
332
  "constant.language.boolean": "true|false"
330
- }, "identifier");
333
+ };
334
+ var keywordMapper = this.createKeywordMapper(keywords, "identifier");
331
335
  var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void";
332
336
  var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex
333
337
  "u[0-9a-fA-F]{4}|" + // unicode
@@ -336,10 +340,16 @@ var JavaScriptHighlightRules = function (options) {
336
340
  "3[0-7][0-7]?|" + // oct
337
341
  "[4-7][0-7]?|" + //oct
338
342
  ".)";
343
+ var anonymousFunctionRe = "(function)(\\s*)(\\*?)";
344
+ var functionCallStartRule = {
345
+ token: ["identifier", "text", "paren.lparen"],
346
+ regex: "(\\b(?!" + Object.values(keywords).join("|") + "\\b)" + identifierRe + ")(\\s*)(\\()"
347
+ };
339
348
  this.$rules = {
340
349
  "no_regex": [
341
350
  DocCommentHighlightRules.getStartRule("doc-start"),
342
351
  comments("no_regex"),
352
+ functionCallStartRule,
343
353
  {
344
354
  token: "string",
345
355
  regex: "'(?=.)",
@@ -349,58 +359,36 @@ var JavaScriptHighlightRules = function (options) {
349
359
  regex: '"(?=.)',
350
360
  next: "qqstring"
351
361
  }, {
352
- token: "constant.numeric",
362
+ token: "constant.numeric", // hexadecimal, octal and binary
353
363
  regex: /0(?:[xX][0-9a-fA-F]+|[oO][0-7]+|[bB][01]+)\b/
354
364
  }, {
355
- token: "constant.numeric",
365
+ token: "constant.numeric", // decimal integers and floats
356
366
  regex: /(?:\d\d*(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+\b)?/
357
- }, {
358
- token: [
359
- "storage.type", "punctuation.operator", "support.function",
360
- "punctuation.operator", "entity.name.function", "text", "keyword.operator"
361
- ],
362
- regex: "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe + ")(\\s*)(=)",
363
- next: "function_arguments"
364
- }, {
365
- token: [
366
- "storage.type", "punctuation.operator", "entity.name.function", "text",
367
- "keyword.operator", "text", "storage.type", "text", "paren.lparen"
368
- ],
369
- regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(\\s*)(\\()",
370
- next: "function_arguments"
371
367
  }, {
372
368
  token: [
373
369
  "entity.name.function", "text", "keyword.operator", "text", "storage.type",
374
- "text", "paren.lparen"
375
- ],
376
- regex: "(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(\\s*)(\\()",
377
- next: "function_arguments"
378
- }, {
379
- token: [
380
- "storage.type", "punctuation.operator", "entity.name.function", "text",
381
- "keyword.operator", "text",
382
- "storage.type", "text", "entity.name.function", "text", "paren.lparen"
370
+ "text", "storage.type", "text", "paren.lparen"
383
371
  ],
384
- regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(\\s+)(\\w+)(\\s*)(\\()",
372
+ regex: "(" + identifierRe + ")(\\s*)(=)(\\s*)" + anonymousFunctionRe + "(\\s*)(\\()",
385
373
  next: "function_arguments"
386
374
  }, {
387
375
  token: [
388
- "storage.type", "text", "entity.name.function", "text", "paren.lparen"
376
+ "storage.type", "text", "storage.type", "text", "text", "entity.name.function", "text", "paren.lparen"
389
377
  ],
390
- regex: "(function\\*?)(\\s+)(" + identifierRe + ")(\\s*)(\\()",
378
+ regex: "(function)(?:(?:(\\s*)(\\*)(\\s*))|(\\s+))(" + identifierRe + ")(\\s*)(\\()",
391
379
  next: "function_arguments"
392
380
  }, {
393
381
  token: [
394
382
  "entity.name.function", "text", "punctuation.operator",
395
- "text", "storage.type", "text", "paren.lparen"
383
+ "text", "storage.type", "text", "storage.type", "text", "paren.lparen"
396
384
  ],
397
- regex: "(" + identifierRe + ")(\\s*)(:)(\\s*)(function\\*?)(\\s*)(\\()",
385
+ regex: "(" + identifierRe + ")(\\s*)(:)(\\s*)" + anonymousFunctionRe + "(\\s*)(\\()",
398
386
  next: "function_arguments"
399
387
  }, {
400
388
  token: [
401
- "text", "text", "storage.type", "text", "paren.lparen"
389
+ "text", "text", "storage.type", "text", "storage.type", "text", "paren.lparen"
402
390
  ],
403
- regex: "(:)(\\s*)(function\\*?)(\\s*)(\\()",
391
+ regex: "(:)(\\s*)" + anonymousFunctionRe + "(\\s*)(\\()",
404
392
  next: "function_arguments"
405
393
  }, {
406
394
  token: "keyword",
@@ -414,7 +402,7 @@ var JavaScriptHighlightRules = function (options) {
414
402
  regex: /that\b/
415
403
  }, {
416
404
  token: ["storage.type", "punctuation.operator", "support.function.firebug"],
417
- regex: /(console)(\.)(warn|info|log|error|time|trace|timeEnd|assert)\b/
405
+ regex: /(console)(\.)(warn|info|log|error|debug|time|trace|timeEnd|assert)\b/
418
406
  }, {
419
407
  token: keywordMapper,
420
408
  regex: identifierRe
@@ -449,17 +437,27 @@ var JavaScriptHighlightRules = function (options) {
449
437
  property: [{
450
438
  token: "text",
451
439
  regex: "\\s+"
440
+ }, {
441
+ token: "keyword.operator",
442
+ regex: /=/
443
+ }, {
444
+ token: [
445
+ "storage.type", "text", "storage.type", "text", "paren.lparen"
446
+ ],
447
+ regex: anonymousFunctionRe + "(\\s*)(\\()",
448
+ next: "function_arguments"
452
449
  }, {
453
450
  token: [
454
- "storage.type", "punctuation.operator", "entity.name.function", "text",
455
- "keyword.operator", "text",
456
- "storage.type", "text", "entity.name.function", "text", "paren.lparen"
451
+ "storage.type", "text", "storage.type", "text", "text", "entity.name.function", "text", "paren.lparen"
457
452
  ],
458
- regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(?:(\\s+)(\\w+))?(\\s*)(\\()",
453
+ regex: "(function)(?:(?:(\\s*)(\\*)(\\s*))|(\\s+))(\\w+)(\\s*)(\\()",
459
454
  next: "function_arguments"
460
455
  }, {
461
456
  token: "punctuation.operator",
462
457
  regex: /[.](?![.])/
458
+ }, {
459
+ token: "support.function",
460
+ regex: "prototype"
463
461
  }, {
464
462
  token: "support.function",
465
463
  regex: /(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|lter|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward|rEach)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/
@@ -572,10 +570,10 @@ var JavaScriptHighlightRules = function (options) {
572
570
  token: "constant.language",
573
571
  regex: "null|Infinity|NaN|undefined"
574
572
  }, {
575
- token: "constant.numeric",
573
+ token: "constant.numeric", // hexadecimal, octal and binary
576
574
  regex: /0(?:[xX][0-9a-fA-F]+|[oO][0-7]+|[bB][01]+)\b/
577
575
  }, {
578
- token: "constant.numeric",
576
+ token: "constant.numeric", // decimal integers and floats
579
577
  regex: /(?:\d\d*(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+\b)?/
580
578
  }, {
581
579
  token: "punctuation.operator",
@@ -684,7 +682,7 @@ var JavaScriptHighlightRules = function (options) {
684
682
  regex: "(" + identifierRe + ")(\\s*)(?=\\=>)"
685
683
  }, {
686
684
  token: "paren.lparen",
687
- regex: "(\\()(?=.+\\s*=>)",
685
+ regex: "(\\()(?=[^\\(]+\\s*=>)",
688
686
  next: "function_arguments"
689
687
  }, {
690
688
  token: "variable.language",
@@ -742,7 +740,7 @@ function JSX() {
742
740
  value: val.substr(offset)
743
741
  }];
744
742
  },
745
- regex: "</?" + tagRegex + "",
743
+ regex: "</?(?:" + tagRegex + "|(?=>))",
746
744
  next: "jsxAttributes",
747
745
  nextState: "jsx"
748
746
  };
@@ -755,8 +753,7 @@ function JSX() {
755
753
  this.$rules.jsx = [
756
754
  jsxJsRule,
757
755
  jsxTag,
758
- { include: "reference" },
759
- { defaultToken: "string" }
756
+ { include: "reference" }, { defaultToken: "string.xml" }
760
757
  ];
761
758
  this.$rules.jsxAttributes = [{
762
759
  token: "meta.tag.punctuation.tag-close.xml",
@@ -816,7 +813,7 @@ function JSX() {
816
813
  function comments(next) {
817
814
  return [
818
815
  {
819
- token: "comment",
816
+ token: "comment", // multi line comment
820
817
  regex: /\/\*/,
821
818
  next: [
822
819
  DocCommentHighlightRules.getTagRule(),
@@ -1096,23 +1093,23 @@ ace.define("ace/mode/ruby_highlight_rules",["require","exports","module","ace/li
1096
1093
  var oop = require("../lib/oop");
1097
1094
  var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
1098
1095
  var constantOtherSymbol = exports.constantOtherSymbol = {
1099
- token: "constant.other.symbol.ruby",
1096
+ token: "constant.other.symbol.ruby", // symbol
1100
1097
  regex: "[:](?:[A-Za-z_]|[@$](?=[a-zA-Z0-9_]))[a-zA-Z0-9_]*[!=?]?"
1101
1098
  };
1102
1099
  exports.qString = {
1103
- token: "string",
1100
+ token: "string", // single line
1104
1101
  regex: "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
1105
1102
  };
1106
1103
  exports.qqString = {
1107
- token: "string",
1104
+ token: "string", // single line
1108
1105
  regex: '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
1109
1106
  };
1110
1107
  exports.tString = {
1111
- token: "string",
1108
+ token: "string", // backtick string
1112
1109
  regex: "[`](?:(?:\\\\.)|(?:[^'\\\\]))*?[`]"
1113
1110
  };
1114
1111
  var constantNumericHex = exports.constantNumericHex = {
1115
- token: "constant.numeric",
1112
+ token: "constant.numeric", // hex
1116
1113
  regex: "0[xX][0-9a-fA-F](?:[0-9a-fA-F]|_(?=[0-9a-fA-F]))*\\b"
1117
1114
  };
1118
1115
  var constantNumericBinary = exports.constantNumericBinary = {
@@ -1123,24 +1120,24 @@ var constantNumericDecimal = exports.constantNumericDecimal = {
1123
1120
  token: "constant.numeric",
1124
1121
  regex: /\b(0[dD](?:[1-9](?:[\d]|_(?=[\d]))*|0))\b/
1125
1122
  };
1126
- var constantNumericOctal = exports.constantNumericDecimal = {
1123
+ var constantNumericOctal = exports.constantNumericOctal = {
1127
1124
  token: "constant.numeric",
1128
1125
  regex: /\b(0[oO]?(?:[1-7](?:[0-7]|_(?=[0-7]))*|0))\b/
1129
1126
  };
1130
1127
  var constantNumericRational = exports.constantNumericRational = {
1131
- token: "constant.numeric",
1128
+ token: "constant.numeric", //rational + complex
1132
1129
  regex: /\b([\d]+(?:[./][\d]+)?ri?)\b/
1133
1130
  };
1134
1131
  var constantNumericComplex = exports.constantNumericComplex = {
1135
- token: "constant.numeric",
1132
+ token: "constant.numeric", //simple complex numbers
1136
1133
  regex: /\b([\d]i)\b/
1137
1134
  };
1138
1135
  var constantNumericFloat = exports.constantNumericFloat = {
1139
- token: "constant.numeric",
1136
+ token: "constant.numeric", // float + complex
1140
1137
  regex: "[+-]?\\d(?:\\d|_(?=\\d))*(?:(?:\\.\\d(?:\\d|_(?=\\d))*)?(?:[eE][+-]?\\d+)?)?i?\\b"
1141
1138
  };
1142
1139
  var instanceVariable = exports.instanceVariable = {
1143
- token: "variable.instance",
1140
+ token: "variable.instance", // instance variable
1144
1141
  regex: "@{1,2}[a-zA-Z_\\d]+"
1145
1142
  };
1146
1143
  var RubyHighlightRules = function () {
@@ -1205,7 +1202,7 @@ var RubyHighlightRules = function () {
1205
1202
  token: "comment",
1206
1203
  regex: "#.*$"
1207
1204
  }, {
1208
- token: "comment.multiline",
1205
+ token: "comment.multiline", // multi line comment
1209
1206
  regex: "^=begin(?=$|\\s.*$)",
1210
1207
  next: "comment"
1211
1208
  }, {
@@ -1261,7 +1258,7 @@ var RubyHighlightRules = function () {
1261
1258
  defaultToken: "string"
1262
1259
  }]
1263
1260
  }, {
1264
- token: "string.start",
1261
+ token: "string.start", //doesn't see any differences between strings and array of strings in highlighting
1265
1262
  regex: /%[qwx]([(\[<{^|%])/, onMatch: function (val, state, stack) {
1266
1263
  if (stack.length)
1267
1264
  stack = [];
@@ -1271,7 +1268,7 @@ var RubyHighlightRules = function () {
1271
1268
  return this.token;
1272
1269
  }
1273
1270
  }, {
1274
- token: "string.start",
1271
+ token: "string.start", //doesn't see any differences between strings and array of strings in highlighting
1275
1272
  regex: /%[QWX]?([(\[<{^|%])/, onMatch: function (val, state, stack) {
1276
1273
  if (stack.length)
1277
1274
  stack = [];
@@ -1281,7 +1278,7 @@ var RubyHighlightRules = function () {
1281
1278
  return this.token;
1282
1279
  }
1283
1280
  }, {
1284
- token: "constant.other.symbol.ruby",
1281
+ token: "constant.other.symbol.ruby", //doesn't see any differences between symbols and array of symbols in highlighting
1285
1282
  regex: /%[si]([(\[<{^|%])/, onMatch: function (val, state, stack) {
1286
1283
  if (stack.length)
1287
1284
  stack = [];
@@ -1291,7 +1288,7 @@ var RubyHighlightRules = function () {
1291
1288
  return this.token;
1292
1289
  }
1293
1290
  }, {
1294
- token: "constant.other.symbol.ruby",
1291
+ token: "constant.other.symbol.ruby", //doesn't see any differences between symbols and array of symbols in highlighting
1295
1292
  regex: /%[SI]([(\[<{^|%])/, onMatch: function (val, state, stack) {
1296
1293
  if (stack.length)
1297
1294
  stack = [];
@@ -1312,15 +1309,15 @@ var RubyHighlightRules = function () {
1312
1309
  }
1313
1310
  }],
1314
1311
  {
1315
- token: "punctuation",
1312
+ token: "punctuation", // namespaces aren't symbols
1316
1313
  regex: "::"
1317
1314
  },
1318
1315
  instanceVariable,
1319
1316
  {
1320
- token: "variable.global",
1317
+ token: "variable.global", // global variable
1321
1318
  regex: "[$][a-zA-Z_\\d]+"
1322
1319
  }, {
1323
- token: "support.class",
1320
+ token: "support.class", // class name
1324
1321
  regex: "[A-Z][a-zA-Z_\\d]*"
1325
1322
  }, {
1326
1323
  token: ["punctuation.operator", "support.function"],
@@ -1434,16 +1431,16 @@ var RubyHighlightRules = function () {
1434
1431
  ],
1435
1432
  "comment": [
1436
1433
  {
1437
- token: "comment.multiline",
1434
+ token: "comment.multiline", // closing comment
1438
1435
  regex: "^=end(?=$|\\s.*$)",
1439
1436
  next: "start"
1440
1437
  }, {
1441
- token: "comment",
1438
+ token: "comment", // comment spanning whole line
1442
1439
  regex: ".+"
1443
1440
  }
1444
1441
  ],
1445
1442
  "qStateWithInterpolation": [{
1446
- token: "string.start",
1443
+ token: "string.start", // excluded nested |^% due to difficulty in realization
1447
1444
  regex: /[(\[<{]/, onMatch: function (val, state, stack) {
1448
1445
  if (stack.length && val === stack[0]) {
1449
1446
  stack.unshift(val, state);
@@ -1476,7 +1473,7 @@ var RubyHighlightRules = function () {
1476
1473
  defaultToken: "string"
1477
1474
  }],
1478
1475
  "qStateWithoutInterpolation": [{
1479
- token: "string.start",
1476
+ token: "string.start", // excluded nested |^% due to difficulty in realization
1480
1477
  regex: /[(\[<{]/, onMatch: function (val, state, stack) {
1481
1478
  if (stack.length && val === stack[0]) {
1482
1479
  stack.unshift(val, state);
@@ -1505,7 +1502,7 @@ var RubyHighlightRules = function () {
1505
1502
  defaultToken: "string"
1506
1503
  }],
1507
1504
  "sStateWithoutInterpolation": [{
1508
- token: "constant.other.symbol.ruby",
1505
+ token: "constant.other.symbol.ruby", // excluded nested |^% due to difficulty in realization
1509
1506
  regex: /[(\[<{]/, onMatch: function (val, state, stack) {
1510
1507
  if (stack.length && val === stack[0]) {
1511
1508
  stack.unshift(val, state);
@@ -1528,7 +1525,7 @@ var RubyHighlightRules = function () {
1528
1525
  defaultToken: "constant.other.symbol.ruby"
1529
1526
  }],
1530
1527
  "sStateWithInterpolation": [{
1531
- token: "constant.other.symbol.ruby",
1528
+ token: "constant.other.symbol.ruby", // excluded nested |^% due to difficulty in realization
1532
1529
  regex: /[(\[<{]/, onMatch: function (val, state, stack) {
1533
1530
  if (stack.length && val === stack[0]) {
1534
1531
  stack.unshift(val, state);
@@ -1561,7 +1558,7 @@ var RubyHighlightRules = function () {
1561
1558
  defaultToken: "constant.other.symbol.ruby"
1562
1559
  }],
1563
1560
  "rState": [{
1564
- token: "string.regexp",
1561
+ token: "string.regexp", // excluded nested |^% due to difficulty in realization
1565
1562
  regex: /[(\[<{]/, onMatch: function (val, state, stack) {
1566
1563
  if (stack.length && val === stack[0]) {
1567
1564
  stack.unshift(val, state);
@@ -1739,98 +1736,385 @@ exports.MatchingBraceOutdent = MatchingBraceOutdent;
1739
1736
 
1740
1737
  });
1741
1738
 
1742
- ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
1739
+ ace.define("ace/mode/behaviour/xml",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator"], function(require, exports, module){"use strict";
1743
1740
  var oop = require("../../lib/oop");
1744
- var Range = require("../../range").Range;
1745
- var BaseFoldMode = require("./fold_mode").FoldMode;
1746
- var FoldMode = exports.FoldMode = function (commentRegex) {
1747
- if (commentRegex) {
1748
- this.foldingStartMarker = new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start));
1749
- this.foldingStopMarker = new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end));
1750
- }
1751
- };
1752
- oop.inherits(FoldMode, BaseFoldMode);
1753
- (function () {
1754
- this.foldingStartMarker = /([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/;
1755
- this.foldingStopMarker = /^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/;
1756
- this.singleLineBlockCommentRe = /^\s*(\/\*).*\*\/\s*$/;
1757
- this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/;
1758
- this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/;
1759
- this._getFoldWidgetBase = this.getFoldWidget;
1760
- this.getFoldWidget = function (session, foldStyle, row) {
1761
- var line = session.getLine(row);
1762
- if (this.singleLineBlockCommentRe.test(line)) {
1763
- if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line))
1764
- return "";
1765
- }
1766
- var fw = this._getFoldWidgetBase(session, foldStyle, row);
1767
- if (!fw && this.startRegionRe.test(line))
1768
- return "start"; // lineCommentRegionStart
1769
- return fw;
1770
- };
1771
- this.getFoldWidgetRange = function (session, foldStyle, row, forceMultiline) {
1772
- var line = session.getLine(row);
1773
- if (this.startRegionRe.test(line))
1774
- return this.getCommentRegionBlock(session, line, row);
1775
- var match = line.match(this.foldingStartMarker);
1776
- if (match) {
1777
- var i = match.index;
1778
- if (match[1])
1779
- return this.openingBracketBlock(session, match[1], row, i);
1780
- var range = session.getCommentFoldRange(row, i + match[0].length, 1);
1781
- if (range && !range.isMultiLine()) {
1782
- if (forceMultiline) {
1783
- range = this.getSectionRange(session, row);
1784
- }
1785
- else if (foldStyle != "all")
1786
- range = null;
1741
+ var Behaviour = require("../behaviour").Behaviour;
1742
+ var TokenIterator = require("../../token_iterator").TokenIterator;
1743
+ function is(token, type) {
1744
+ return token && token.type.lastIndexOf(type + ".xml") > -1;
1745
+ }
1746
+ var XmlBehaviour = function () {
1747
+ this.add("string_dquotes", "insertion", function (state, action, editor, session, text) {
1748
+ if (text == '"' || text == "'") {
1749
+ var quote = text;
1750
+ var selected = session.doc.getTextRange(editor.getSelectionRange());
1751
+ if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) {
1752
+ return {
1753
+ text: quote + selected + quote,
1754
+ selection: false
1755
+ };
1756
+ }
1757
+ var cursor = editor.getCursorPosition();
1758
+ var line = session.doc.getLine(cursor.row);
1759
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
1760
+ var iterator = new TokenIterator(session, cursor.row, cursor.column);
1761
+ var token = iterator.getCurrentToken();
1762
+ if (rightChar == quote && (is(token, "attribute-value") || is(token, "string"))) {
1763
+ return {
1764
+ text: "",
1765
+ selection: [1, 1]
1766
+ };
1767
+ }
1768
+ if (!token)
1769
+ token = iterator.stepBackward();
1770
+ if (!token)
1771
+ return;
1772
+ while (is(token, "tag-whitespace") || is(token, "whitespace")) {
1773
+ token = iterator.stepBackward();
1774
+ }
1775
+ var rightSpace = !rightChar || rightChar.match(/\s/);
1776
+ if (is(token, "attribute-equals") && (rightSpace || rightChar == '>') || (is(token, "decl-attribute-equals") && (rightSpace || rightChar == '?'))) {
1777
+ return {
1778
+ text: quote + quote,
1779
+ selection: [1, 1]
1780
+ };
1787
1781
  }
1788
- return range;
1789
1782
  }
1790
- if (foldStyle === "markbegin")
1791
- return;
1792
- var match = line.match(this.foldingStopMarker);
1793
- if (match) {
1794
- var i = match.index + match[0].length;
1795
- if (match[1])
1796
- return this.closingBracketBlock(session, match[1], row, i);
1797
- return session.getCommentFoldRange(row, i, -1);
1783
+ });
1784
+ this.add("string_dquotes", "deletion", function (state, action, editor, session, range) {
1785
+ var selected = session.doc.getTextRange(range);
1786
+ if (!range.isMultiLine() && (selected == '"' || selected == "'")) {
1787
+ var line = session.doc.getLine(range.start.row);
1788
+ var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
1789
+ if (rightChar == selected) {
1790
+ range.end.column++;
1791
+ return range;
1792
+ }
1798
1793
  }
1799
- };
1800
- this.getSectionRange = function (session, row) {
1801
- var line = session.getLine(row);
1802
- var startIndent = line.search(/\S/);
1803
- var startRow = row;
1804
- var startColumn = line.length;
1805
- row = row + 1;
1806
- var endRow = row;
1807
- var maxRow = session.getLength();
1808
- while (++row < maxRow) {
1809
- line = session.getLine(row);
1810
- var indent = line.search(/\S/);
1811
- if (indent === -1)
1812
- continue;
1813
- if (startIndent > indent)
1814
- break;
1815
- var subRange = this.getFoldWidgetRange(session, "all", row);
1816
- if (subRange) {
1817
- if (subRange.start.row <= startRow) {
1794
+ });
1795
+ this.add("autoclosing", "insertion", function (state, action, editor, session, text) {
1796
+ if (text == '>') {
1797
+ var position = editor.getSelectionRange().start;
1798
+ var iterator = new TokenIterator(session, position.row, position.column);
1799
+ var token = iterator.getCurrentToken() || iterator.stepBackward();
1800
+ if (!token || !(is(token, "tag-name") || is(token, "tag-whitespace") || is(token, "attribute-name") || is(token, "attribute-equals") || is(token, "attribute-value")))
1801
+ return;
1802
+ if (is(token, "reference.attribute-value"))
1803
+ return;
1804
+ if (is(token, "attribute-value")) {
1805
+ var tokenEndColumn = iterator.getCurrentTokenColumn() + token.value.length;
1806
+ if (position.column < tokenEndColumn)
1807
+ return;
1808
+ if (position.column == tokenEndColumn) {
1809
+ var nextToken = iterator.stepForward();
1810
+ if (nextToken && is(nextToken, "attribute-value"))
1811
+ return;
1812
+ iterator.stepBackward();
1813
+ }
1814
+ }
1815
+ if (/^\s*>/.test(session.getLine(position.row).slice(position.column)))
1816
+ return;
1817
+ while (!is(token, "tag-name")) {
1818
+ token = iterator.stepBackward();
1819
+ if (token.value == "<") {
1820
+ token = iterator.stepForward();
1818
1821
  break;
1819
1822
  }
1820
- else if (subRange.isMultiLine()) {
1821
- row = subRange.end.row;
1823
+ }
1824
+ var tokenRow = iterator.getCurrentTokenRow();
1825
+ var tokenColumn = iterator.getCurrentTokenColumn();
1826
+ if (is(iterator.stepBackward(), "end-tag-open"))
1827
+ return;
1828
+ var element = token.value;
1829
+ if (tokenRow == position.row)
1830
+ element = element.substring(0, position.column - tokenColumn);
1831
+ if (this.voidElements && this.voidElements.hasOwnProperty(element.toLowerCase()))
1832
+ return;
1833
+ return {
1834
+ text: ">" + "</" + element + ">",
1835
+ selection: [1, 1]
1836
+ };
1837
+ }
1838
+ });
1839
+ this.add("autoindent", "insertion", function (state, action, editor, session, text) {
1840
+ if (text == "\n") {
1841
+ var cursor = editor.getCursorPosition();
1842
+ var line = session.getLine(cursor.row);
1843
+ var iterator = new TokenIterator(session, cursor.row, cursor.column);
1844
+ var token = iterator.getCurrentToken();
1845
+ if (is(token, "") && token.type.indexOf("tag-close") !== -1) {
1846
+ if (token.value == "/>")
1847
+ return;
1848
+ while (token && token.type.indexOf("tag-name") === -1) {
1849
+ token = iterator.stepBackward();
1822
1850
  }
1823
- else if (startIndent == indent) {
1824
- break;
1851
+ if (!token) {
1852
+ return;
1853
+ }
1854
+ var tag = token.value;
1855
+ var row = iterator.getCurrentTokenRow();
1856
+ token = iterator.stepBackward();
1857
+ if (!token || token.type.indexOf("end-tag") !== -1) {
1858
+ return;
1859
+ }
1860
+ if (this.voidElements && !this.voidElements[tag] || !this.voidElements) {
1861
+ var nextToken = session.getTokenAt(cursor.row, cursor.column + 1);
1862
+ var line = session.getLine(row);
1863
+ var nextIndent = this.$getIndent(line);
1864
+ var indent = nextIndent + session.getTabString();
1865
+ if (nextToken && nextToken.value === "</") {
1866
+ return {
1867
+ text: "\n" + indent + "\n" + nextIndent,
1868
+ selection: [1, indent.length, 1, indent.length]
1869
+ };
1870
+ }
1871
+ else {
1872
+ return {
1873
+ text: "\n" + indent
1874
+ };
1875
+ }
1825
1876
  }
1826
1877
  }
1827
- endRow = row;
1828
1878
  }
1829
- return new Range(startRow, startColumn, endRow, session.getLine(endRow).length);
1830
- };
1831
- this.getCommentRegionBlock = function (session, line, row) {
1832
- var startColumn = line.search(/\s*$/);
1833
- var maxRow = session.getLength();
1879
+ });
1880
+ };
1881
+ oop.inherits(XmlBehaviour, Behaviour);
1882
+ exports.XmlBehaviour = XmlBehaviour;
1883
+
1884
+ });
1885
+
1886
+ ace.define("ace/mode/behaviour/javascript",["require","exports","module","ace/lib/oop","ace/token_iterator","ace/mode/behaviour/cstyle","ace/mode/behaviour/xml"], function(require, exports, module){"use strict";
1887
+ var oop = require("../../lib/oop");
1888
+ var TokenIterator = require("../../token_iterator").TokenIterator;
1889
+ var CstyleBehaviour = require("../behaviour/cstyle").CstyleBehaviour;
1890
+ var XmlBehaviour = require("../behaviour/xml").XmlBehaviour;
1891
+ var JavaScriptBehaviour = function () {
1892
+ var xmlBehaviours = new XmlBehaviour({ closeCurlyBraces: true }).getBehaviours();
1893
+ this.addBehaviours(xmlBehaviours);
1894
+ this.inherit(CstyleBehaviour);
1895
+ this.add("autoclosing-fragment", "insertion", function (state, action, editor, session, text) {
1896
+ if (text == '>') {
1897
+ var position = editor.getSelectionRange().start;
1898
+ var iterator = new TokenIterator(session, position.row, position.column);
1899
+ var token = iterator.getCurrentToken() || iterator.stepBackward();
1900
+ if (!token)
1901
+ return;
1902
+ if (token.value == '<') {
1903
+ return {
1904
+ text: "></>",
1905
+ selection: [1, 1]
1906
+ };
1907
+ }
1908
+ }
1909
+ });
1910
+ };
1911
+ oop.inherits(JavaScriptBehaviour, CstyleBehaviour);
1912
+ exports.JavaScriptBehaviour = JavaScriptBehaviour;
1913
+
1914
+ });
1915
+
1916
+ ace.define("ace/mode/folding/xml",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
1917
+ var oop = require("../../lib/oop");
1918
+ var Range = require("../../range").Range;
1919
+ var BaseFoldMode = require("./fold_mode").FoldMode;
1920
+ var FoldMode = exports.FoldMode = function (voidElements, optionalEndTags) {
1921
+ BaseFoldMode.call(this);
1922
+ this.voidElements = voidElements || {};
1923
+ this.optionalEndTags = oop.mixin({}, this.voidElements);
1924
+ if (optionalEndTags)
1925
+ oop.mixin(this.optionalEndTags, optionalEndTags);
1926
+ };
1927
+ oop.inherits(FoldMode, BaseFoldMode);
1928
+ var Tag = function () {
1929
+ this.tagName = "";
1930
+ this.closing = false;
1931
+ this.selfClosing = false;
1932
+ this.start = { row: 0, column: 0 };
1933
+ this.end = { row: 0, column: 0 };
1934
+ };
1935
+ function is(token, type) {
1936
+ return token.type.lastIndexOf(type + ".xml") > -1;
1937
+ }
1938
+ (function () {
1939
+ this.getFoldWidget = function (session, foldStyle, row) {
1940
+ var tag = this._getFirstTagInLine(session, row);
1941
+ if (!tag)
1942
+ return this.getCommentFoldWidget(session, row);
1943
+ if (tag.closing || (!tag.tagName && tag.selfClosing))
1944
+ return foldStyle === "markbeginend" ? "end" : "";
1945
+ if (!tag.tagName || tag.selfClosing || this.voidElements.hasOwnProperty(tag.tagName.toLowerCase()))
1946
+ return "";
1947
+ if (this._findEndTagInLine(session, row, tag.tagName, tag.end.column))
1948
+ return "";
1949
+ return "start";
1950
+ };
1951
+ this.getCommentFoldWidget = function (session, row) {
1952
+ if (/comment/.test(session.getState(row)) && /<!-/.test(session.getLine(row)))
1953
+ return "start";
1954
+ return "";
1955
+ };
1956
+ this._getFirstTagInLine = function (session, row) {
1957
+ var tokens = session.getTokens(row);
1958
+ var tag = new Tag();
1959
+ for (var i = 0; i < tokens.length; i++) {
1960
+ var token = tokens[i];
1961
+ if (is(token, "tag-open")) {
1962
+ tag.end.column = tag.start.column + token.value.length;
1963
+ tag.closing = is(token, "end-tag-open");
1964
+ token = tokens[++i];
1965
+ if (!token)
1966
+ return null;
1967
+ tag.tagName = token.value;
1968
+ if (token.value === "") { //skip empty tag name token for fragment
1969
+ token = tokens[++i];
1970
+ if (!token)
1971
+ return null;
1972
+ tag.tagName = token.value;
1973
+ }
1974
+ tag.end.column += token.value.length;
1975
+ for (i++; i < tokens.length; i++) {
1976
+ token = tokens[i];
1977
+ tag.end.column += token.value.length;
1978
+ if (is(token, "tag-close")) {
1979
+ tag.selfClosing = token.value == '/>';
1980
+ break;
1981
+ }
1982
+ }
1983
+ return tag;
1984
+ }
1985
+ else if (is(token, "tag-close")) {
1986
+ tag.selfClosing = token.value == '/>';
1987
+ return tag;
1988
+ }
1989
+ tag.start.column += token.value.length;
1990
+ }
1991
+ return null;
1992
+ };
1993
+ this._findEndTagInLine = function (session, row, tagName, startColumn) {
1994
+ var tokens = session.getTokens(row);
1995
+ var column = 0;
1996
+ for (var i = 0; i < tokens.length; i++) {
1997
+ var token = tokens[i];
1998
+ column += token.value.length;
1999
+ if (column < startColumn - 1)
2000
+ continue;
2001
+ if (is(token, "end-tag-open")) {
2002
+ token = tokens[i + 1];
2003
+ if (is(token, "tag-name") && token.value === "") {
2004
+ token = tokens[i + 2];
2005
+ }
2006
+ if (token && token.value == tagName)
2007
+ return true;
2008
+ }
2009
+ }
2010
+ return false;
2011
+ };
2012
+ this.getFoldWidgetRange = function (session, foldStyle, row) {
2013
+ var firstTag = this._getFirstTagInLine(session, row);
2014
+ if (!firstTag) {
2015
+ return this.getCommentFoldWidget(session, row) && session.getCommentFoldRange(row, session.getLine(row).length);
2016
+ }
2017
+ var tags = session.getMatchingTags({ row: row, column: 0 });
2018
+ if (tags) {
2019
+ return new Range(tags.openTag.end.row, tags.openTag.end.column, tags.closeTag.start.row, tags.closeTag.start.column);
2020
+ }
2021
+ };
2022
+ }).call(FoldMode.prototype);
2023
+
2024
+ });
2025
+
2026
+ ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
2027
+ var oop = require("../../lib/oop");
2028
+ var Range = require("../../range").Range;
2029
+ var BaseFoldMode = require("./fold_mode").FoldMode;
2030
+ var FoldMode = exports.FoldMode = function (commentRegex) {
2031
+ if (commentRegex) {
2032
+ this.foldingStartMarker = new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start));
2033
+ this.foldingStopMarker = new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end));
2034
+ }
2035
+ };
2036
+ oop.inherits(FoldMode, BaseFoldMode);
2037
+ (function () {
2038
+ this.foldingStartMarker = /([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/;
2039
+ this.foldingStopMarker = /^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/;
2040
+ this.singleLineBlockCommentRe = /^\s*(\/\*).*\*\/\s*$/;
2041
+ this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/;
2042
+ this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/;
2043
+ this._getFoldWidgetBase = this.getFoldWidget;
2044
+ this.getFoldWidget = function (session, foldStyle, row) {
2045
+ var line = session.getLine(row);
2046
+ if (this.singleLineBlockCommentRe.test(line)) {
2047
+ if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line))
2048
+ return "";
2049
+ }
2050
+ var fw = this._getFoldWidgetBase(session, foldStyle, row);
2051
+ if (!fw && this.startRegionRe.test(line))
2052
+ return "start"; // lineCommentRegionStart
2053
+ return fw;
2054
+ };
2055
+ this.getFoldWidgetRange = function (session, foldStyle, row, forceMultiline) {
2056
+ var line = session.getLine(row);
2057
+ if (this.startRegionRe.test(line))
2058
+ return this.getCommentRegionBlock(session, line, row);
2059
+ var match = line.match(this.foldingStartMarker);
2060
+ if (match) {
2061
+ var i = match.index;
2062
+ if (match[1])
2063
+ return this.openingBracketBlock(session, match[1], row, i);
2064
+ var range = session.getCommentFoldRange(row, i + match[0].length, 1);
2065
+ if (range && !range.isMultiLine()) {
2066
+ if (forceMultiline) {
2067
+ range = this.getSectionRange(session, row);
2068
+ }
2069
+ else if (foldStyle != "all")
2070
+ range = null;
2071
+ }
2072
+ return range;
2073
+ }
2074
+ if (foldStyle === "markbegin")
2075
+ return;
2076
+ var match = line.match(this.foldingStopMarker);
2077
+ if (match) {
2078
+ var i = match.index + match[0].length;
2079
+ if (match[1])
2080
+ return this.closingBracketBlock(session, match[1], row, i);
2081
+ return session.getCommentFoldRange(row, i, -1);
2082
+ }
2083
+ };
2084
+ this.getSectionRange = function (session, row) {
2085
+ var line = session.getLine(row);
2086
+ var startIndent = line.search(/\S/);
2087
+ var startRow = row;
2088
+ var startColumn = line.length;
2089
+ row = row + 1;
2090
+ var endRow = row;
2091
+ var maxRow = session.getLength();
2092
+ while (++row < maxRow) {
2093
+ line = session.getLine(row);
2094
+ var indent = line.search(/\S/);
2095
+ if (indent === -1)
2096
+ continue;
2097
+ if (startIndent > indent)
2098
+ break;
2099
+ var subRange = this.getFoldWidgetRange(session, "all", row);
2100
+ if (subRange) {
2101
+ if (subRange.start.row <= startRow) {
2102
+ break;
2103
+ }
2104
+ else if (subRange.isMultiLine()) {
2105
+ row = subRange.end.row;
2106
+ }
2107
+ else if (startIndent == indent) {
2108
+ break;
2109
+ }
2110
+ }
2111
+ endRow = row;
2112
+ }
2113
+ return new Range(startRow, startColumn, endRow, session.getLine(endRow).length);
2114
+ };
2115
+ this.getCommentRegionBlock = function (session, line, row) {
2116
+ var startColumn = line.search(/\s*$/);
2117
+ var maxRow = session.getLength();
1834
2118
  var startRow = row;
1835
2119
  var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/;
1836
2120
  var depth = 1;
@@ -1855,19 +2139,51 @@ oop.inherits(FoldMode, BaseFoldMode);
1855
2139
 
1856
2140
  });
1857
2141
 
1858
- ace.define("ace/mode/javascript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
2142
+ ace.define("ace/mode/folding/javascript",["require","exports","module","ace/lib/oop","ace/mode/folding/xml","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
2143
+ var oop = require("../../lib/oop");
2144
+ var XmlFoldMode = require("./xml").FoldMode;
2145
+ var CFoldMode = require("./cstyle").FoldMode;
2146
+ var FoldMode = exports.FoldMode = function (commentRegex) {
2147
+ if (commentRegex) {
2148
+ this.foldingStartMarker = new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start));
2149
+ this.foldingStopMarker = new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end));
2150
+ }
2151
+ this.xmlFoldMode = new XmlFoldMode();
2152
+ };
2153
+ oop.inherits(FoldMode, CFoldMode);
2154
+ (function () {
2155
+ this.getFoldWidgetRangeBase = this.getFoldWidgetRange;
2156
+ this.getFoldWidgetBase = this.getFoldWidget;
2157
+ this.getFoldWidget = function (session, foldStyle, row) {
2158
+ var fw = this.getFoldWidgetBase(session, foldStyle, row);
2159
+ if (!fw) {
2160
+ return this.xmlFoldMode.getFoldWidget(session, foldStyle, row);
2161
+ }
2162
+ return fw;
2163
+ };
2164
+ this.getFoldWidgetRange = function (session, foldStyle, row, forceMultiline) {
2165
+ var range = this.getFoldWidgetRangeBase(session, foldStyle, row, forceMultiline);
2166
+ if (range)
2167
+ return range;
2168
+ return this.xmlFoldMode.getFoldWidgetRange(session, foldStyle, row);
2169
+ };
2170
+ }).call(FoldMode.prototype);
2171
+
2172
+ });
2173
+
2174
+ ace.define("ace/mode/javascript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/behaviour/javascript","ace/mode/folding/javascript"], function(require, exports, module){"use strict";
1859
2175
  var oop = require("../lib/oop");
1860
2176
  var TextMode = require("./text").Mode;
1861
2177
  var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules;
1862
2178
  var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
1863
2179
  var WorkerClient = require("../worker/worker_client").WorkerClient;
1864
- var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
1865
- var CStyleFoldMode = require("./folding/cstyle").FoldMode;
2180
+ var JavaScriptBehaviour = require("./behaviour/javascript").JavaScriptBehaviour;
2181
+ var JavaScriptFoldMode = require("./folding/javascript").FoldMode;
1866
2182
  var Mode = function () {
1867
2183
  this.HighlightRules = JavaScriptHighlightRules;
1868
2184
  this.$outdent = new MatchingBraceOutdent();
1869
- this.$behaviour = new CstyleBehaviour();
1870
- this.foldingRules = new CStyleFoldMode();
2185
+ this.$behaviour = new JavaScriptBehaviour();
2186
+ this.foldingRules = new JavaScriptFoldMode();
1871
2187
  };
1872
2188
  oop.inherits(Mode, TextMode);
1873
2189
  (function () {
@@ -1895,13 +2211,6 @@ oop.inherits(Mode, TextMode);
1895
2211
  if (endState == "start" || endState == "no_regex") {
1896
2212
  return "";
1897
2213
  }
1898
- var match = line.match(/^\s*(\/?)\*/);
1899
- if (match) {
1900
- if (match[1]) {
1901
- indent += " ";
1902
- }
1903
- indent += "* ";
1904
- }
1905
2214
  }
1906
2215
  return indent;
1907
2216
  };
@@ -2227,154 +2536,6 @@ exports.Mode = Mode;
2227
2536
 
2228
2537
  });
2229
2538
 
2230
- ace.define("ace/mode/behaviour/xml",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"], function(require, exports, module){"use strict";
2231
- var oop = require("../../lib/oop");
2232
- var Behaviour = require("../behaviour").Behaviour;
2233
- var TokenIterator = require("../../token_iterator").TokenIterator;
2234
- var lang = require("../../lib/lang");
2235
- function is(token, type) {
2236
- return token && token.type.lastIndexOf(type + ".xml") > -1;
2237
- }
2238
- var XmlBehaviour = function () {
2239
- this.add("string_dquotes", "insertion", function (state, action, editor, session, text) {
2240
- if (text == '"' || text == "'") {
2241
- var quote = text;
2242
- var selected = session.doc.getTextRange(editor.getSelectionRange());
2243
- if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) {
2244
- return {
2245
- text: quote + selected + quote,
2246
- selection: false
2247
- };
2248
- }
2249
- var cursor = editor.getCursorPosition();
2250
- var line = session.doc.getLine(cursor.row);
2251
- var rightChar = line.substring(cursor.column, cursor.column + 1);
2252
- var iterator = new TokenIterator(session, cursor.row, cursor.column);
2253
- var token = iterator.getCurrentToken();
2254
- if (rightChar == quote && (is(token, "attribute-value") || is(token, "string"))) {
2255
- return {
2256
- text: "",
2257
- selection: [1, 1]
2258
- };
2259
- }
2260
- if (!token)
2261
- token = iterator.stepBackward();
2262
- if (!token)
2263
- return;
2264
- while (is(token, "tag-whitespace") || is(token, "whitespace")) {
2265
- token = iterator.stepBackward();
2266
- }
2267
- var rightSpace = !rightChar || rightChar.match(/\s/);
2268
- if (is(token, "attribute-equals") && (rightSpace || rightChar == '>') || (is(token, "decl-attribute-equals") && (rightSpace || rightChar == '?'))) {
2269
- return {
2270
- text: quote + quote,
2271
- selection: [1, 1]
2272
- };
2273
- }
2274
- }
2275
- });
2276
- this.add("string_dquotes", "deletion", function (state, action, editor, session, range) {
2277
- var selected = session.doc.getTextRange(range);
2278
- if (!range.isMultiLine() && (selected == '"' || selected == "'")) {
2279
- var line = session.doc.getLine(range.start.row);
2280
- var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
2281
- if (rightChar == selected) {
2282
- range.end.column++;
2283
- return range;
2284
- }
2285
- }
2286
- });
2287
- this.add("autoclosing", "insertion", function (state, action, editor, session, text) {
2288
- if (text == '>') {
2289
- var position = editor.getSelectionRange().start;
2290
- var iterator = new TokenIterator(session, position.row, position.column);
2291
- var token = iterator.getCurrentToken() || iterator.stepBackward();
2292
- if (!token || !(is(token, "tag-name") || is(token, "tag-whitespace") || is(token, "attribute-name") || is(token, "attribute-equals") || is(token, "attribute-value")))
2293
- return;
2294
- if (is(token, "reference.attribute-value"))
2295
- return;
2296
- if (is(token, "attribute-value")) {
2297
- var tokenEndColumn = iterator.getCurrentTokenColumn() + token.value.length;
2298
- if (position.column < tokenEndColumn)
2299
- return;
2300
- if (position.column == tokenEndColumn) {
2301
- var nextToken = iterator.stepForward();
2302
- if (nextToken && is(nextToken, "attribute-value"))
2303
- return;
2304
- iterator.stepBackward();
2305
- }
2306
- }
2307
- if (/^\s*>/.test(session.getLine(position.row).slice(position.column)))
2308
- return;
2309
- while (!is(token, "tag-name")) {
2310
- token = iterator.stepBackward();
2311
- if (token.value == "<") {
2312
- token = iterator.stepForward();
2313
- break;
2314
- }
2315
- }
2316
- var tokenRow = iterator.getCurrentTokenRow();
2317
- var tokenColumn = iterator.getCurrentTokenColumn();
2318
- if (is(iterator.stepBackward(), "end-tag-open"))
2319
- return;
2320
- var element = token.value;
2321
- if (tokenRow == position.row)
2322
- element = element.substring(0, position.column - tokenColumn);
2323
- if (this.voidElements.hasOwnProperty(element.toLowerCase()))
2324
- return;
2325
- return {
2326
- text: ">" + "</" + element + ">",
2327
- selection: [1, 1]
2328
- };
2329
- }
2330
- });
2331
- this.add("autoindent", "insertion", function (state, action, editor, session, text) {
2332
- if (text == "\n") {
2333
- var cursor = editor.getCursorPosition();
2334
- var line = session.getLine(cursor.row);
2335
- var iterator = new TokenIterator(session, cursor.row, cursor.column);
2336
- var token = iterator.getCurrentToken();
2337
- if (token && token.type.indexOf("tag-close") !== -1) {
2338
- if (token.value == "/>")
2339
- return;
2340
- while (token && token.type.indexOf("tag-name") === -1) {
2341
- token = iterator.stepBackward();
2342
- }
2343
- if (!token) {
2344
- return;
2345
- }
2346
- var tag = token.value;
2347
- var row = iterator.getCurrentTokenRow();
2348
- token = iterator.stepBackward();
2349
- if (!token || token.type.indexOf("end-tag") !== -1) {
2350
- return;
2351
- }
2352
- if (this.voidElements && !this.voidElements[tag]) {
2353
- var nextToken = session.getTokenAt(cursor.row, cursor.column + 1);
2354
- var line = session.getLine(row);
2355
- var nextIndent = this.$getIndent(line);
2356
- var indent = nextIndent + session.getTabString();
2357
- if (nextToken && nextToken.value === "</") {
2358
- return {
2359
- text: "\n" + indent + "\n" + nextIndent,
2360
- selection: [1, indent.length, 1, indent.length]
2361
- };
2362
- }
2363
- else {
2364
- return {
2365
- text: "\n" + indent
2366
- };
2367
- }
2368
- }
2369
- }
2370
- }
2371
- });
2372
- };
2373
- oop.inherits(XmlBehaviour, Behaviour);
2374
- exports.XmlBehaviour = XmlBehaviour;
2375
-
2376
- });
2377
-
2378
2539
  ace.define("ace/mode/folding/mixed",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
2379
2540
  var oop = require("../../lib/oop");
2380
2541
  var BaseFoldMode = require("./fold_mode").FoldMode;
@@ -2414,107 +2575,6 @@ oop.inherits(FoldMode, BaseFoldMode);
2414
2575
 
2415
2576
  });
2416
2577
 
2417
- ace.define("ace/mode/folding/xml",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
2418
- var oop = require("../../lib/oop");
2419
- var Range = require("../../range").Range;
2420
- var BaseFoldMode = require("./fold_mode").FoldMode;
2421
- var FoldMode = exports.FoldMode = function (voidElements, optionalEndTags) {
2422
- BaseFoldMode.call(this);
2423
- this.voidElements = voidElements || {};
2424
- this.optionalEndTags = oop.mixin({}, this.voidElements);
2425
- if (optionalEndTags)
2426
- oop.mixin(this.optionalEndTags, optionalEndTags);
2427
- };
2428
- oop.inherits(FoldMode, BaseFoldMode);
2429
- var Tag = function () {
2430
- this.tagName = "";
2431
- this.closing = false;
2432
- this.selfClosing = false;
2433
- this.start = { row: 0, column: 0 };
2434
- this.end = { row: 0, column: 0 };
2435
- };
2436
- function is(token, type) {
2437
- return token.type.lastIndexOf(type + ".xml") > -1;
2438
- }
2439
- (function () {
2440
- this.getFoldWidget = function (session, foldStyle, row) {
2441
- var tag = this._getFirstTagInLine(session, row);
2442
- if (!tag)
2443
- return this.getCommentFoldWidget(session, row);
2444
- if (tag.closing || (!tag.tagName && tag.selfClosing))
2445
- return foldStyle === "markbeginend" ? "end" : "";
2446
- if (!tag.tagName || tag.selfClosing || this.voidElements.hasOwnProperty(tag.tagName.toLowerCase()))
2447
- return "";
2448
- if (this._findEndTagInLine(session, row, tag.tagName, tag.end.column))
2449
- return "";
2450
- return "start";
2451
- };
2452
- this.getCommentFoldWidget = function (session, row) {
2453
- if (/comment/.test(session.getState(row)) && /<!-/.test(session.getLine(row)))
2454
- return "start";
2455
- return "";
2456
- };
2457
- this._getFirstTagInLine = function (session, row) {
2458
- var tokens = session.getTokens(row);
2459
- var tag = new Tag();
2460
- for (var i = 0; i < tokens.length; i++) {
2461
- var token = tokens[i];
2462
- if (is(token, "tag-open")) {
2463
- tag.end.column = tag.start.column + token.value.length;
2464
- tag.closing = is(token, "end-tag-open");
2465
- token = tokens[++i];
2466
- if (!token)
2467
- return null;
2468
- tag.tagName = token.value;
2469
- tag.end.column += token.value.length;
2470
- for (i++; i < tokens.length; i++) {
2471
- token = tokens[i];
2472
- tag.end.column += token.value.length;
2473
- if (is(token, "tag-close")) {
2474
- tag.selfClosing = token.value == '/>';
2475
- break;
2476
- }
2477
- }
2478
- return tag;
2479
- }
2480
- else if (is(token, "tag-close")) {
2481
- tag.selfClosing = token.value == '/>';
2482
- return tag;
2483
- }
2484
- tag.start.column += token.value.length;
2485
- }
2486
- return null;
2487
- };
2488
- this._findEndTagInLine = function (session, row, tagName, startColumn) {
2489
- var tokens = session.getTokens(row);
2490
- var column = 0;
2491
- for (var i = 0; i < tokens.length; i++) {
2492
- var token = tokens[i];
2493
- column += token.value.length;
2494
- if (column < startColumn)
2495
- continue;
2496
- if (is(token, "end-tag-open")) {
2497
- token = tokens[i + 1];
2498
- if (token && token.value == tagName)
2499
- return true;
2500
- }
2501
- }
2502
- return false;
2503
- };
2504
- this.getFoldWidgetRange = function (session, foldStyle, row) {
2505
- var tags = session.getMatchingTags({ row: row, column: 0 });
2506
- if (tags) {
2507
- return new Range(tags.openTag.end.row, tags.openTag.end.column, tags.closeTag.start.row, tags.closeTag.start.column);
2508
- }
2509
- else {
2510
- return this.getCommentFoldWidget(session, row)
2511
- && session.getCommentFoldRange(row, session.getLine(row).length);
2512
- }
2513
- };
2514
- }).call(FoldMode.prototype);
2515
-
2516
- });
2517
-
2518
2578
  ace.define("ace/mode/folding/html",["require","exports","module","ace/lib/oop","ace/mode/folding/mixed","ace/mode/folding/xml","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
2519
2579
  var oop = require("../../lib/oop");
2520
2580
  var MixedFoldMode = require("./mixed").FoldMode;