ace-rails-ap 2.0.1 → 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +5 -4
- data/lib/ace/rails/version.rb +1 -1
- data/vendor/assets/javascripts/ace/ace.js +14194 -13349
- data/vendor/assets/javascripts/ace/ext-beautify.js +335 -0
- data/vendor/assets/javascripts/ace/ext-chromevox.js +6 -1
- data/vendor/assets/javascripts/ace/ext-elastic_tabstops_lite.js +8 -33
- data/vendor/assets/javascripts/ace/ext-emmet.js +487 -424
- data/vendor/assets/javascripts/ace/ext-error_marker.js +6 -0
- data/vendor/assets/javascripts/ace/ext-keybinding_menu.js +45 -72
- data/vendor/assets/javascripts/ace/ext-language_tools.js +734 -578
- data/vendor/assets/javascripts/ace/ext-linking.js +53 -0
- data/vendor/assets/javascripts/ace/ext-modelist.js +25 -10
- data/vendor/assets/javascripts/ace/ext-old_ie.js +93 -120
- data/vendor/assets/javascripts/ace/ext-searchbox.js +8 -41
- data/vendor/assets/javascripts/ace/ext-settings_menu.js +229 -234
- data/vendor/assets/javascripts/ace/ext-spellcheck.js +7 -3
- data/vendor/assets/javascripts/ace/ext-split.js +13 -37
- data/vendor/assets/javascripts/ace/ext-static_highlight.js +16 -39
- data/vendor/assets/javascripts/ace/ext-statusbar.js +8 -2
- data/vendor/assets/javascripts/ace/ext-textarea.js +254 -99
- data/vendor/assets/javascripts/ace/ext-themelist.js +13 -40
- data/vendor/assets/javascripts/ace/ext-whitespace.js +17 -41
- data/vendor/assets/javascripts/ace/keybinding-emacs.js +803 -788
- data/vendor/assets/javascripts/ace/keybinding-vim.js +1559 -1560
- data/vendor/assets/javascripts/ace/mode-abap.js +52 -83
- data/vendor/assets/javascripts/ace/mode-actionscript.js +27 -63
- data/vendor/assets/javascripts/ace/mode-ada.js +27 -58
- data/vendor/assets/javascripts/ace/mode-apache_conf.js +310 -0
- data/vendor/assets/javascripts/ace/mode-applescript.js +226 -0
- data/vendor/assets/javascripts/ace/mode-asciidoc.js +39 -70
- data/vendor/assets/javascripts/ace/mode-assembly_x86.js +26 -58
- data/vendor/assets/javascripts/ace/mode-autohotkey.js +27 -63
- data/vendor/assets/javascripts/ace/mode-batchfile.js +27 -63
- data/vendor/assets/javascripts/ace/mode-c9search.js +92 -112
- data/vendor/assets/javascripts/ace/mode-c_cpp.js +224 -223
- data/vendor/assets/javascripts/ace/mode-cirru.js +202 -0
- data/vendor/assets/javascripts/ace/mode-clojure.js +98 -92
- data/vendor/assets/javascripts/ace/mode-cobol.js +27 -58
- data/vendor/assets/javascripts/ace/mode-coffee.js +90 -122
- data/vendor/assets/javascripts/ace/mode-coldfusion.js +1908 -1464
- data/vendor/assets/javascripts/ace/mode-csharp.js +291 -264
- data/vendor/assets/javascripts/ace/mode-css.js +266 -267
- data/vendor/assets/javascripts/ace/mode-curly.js +796 -815
- data/vendor/assets/javascripts/ace/mode-d.js +64 -95
- data/vendor/assets/javascripts/ace/mode-dart.js +254 -256
- data/vendor/assets/javascripts/ace/mode-diff.js +27 -58
- data/vendor/assets/javascripts/ace/mode-django.js +856 -866
- data/vendor/assets/javascripts/ace/mode-dockerfile.js +759 -0
- data/vendor/assets/javascripts/ace/mode-dot.js +106 -106
- data/vendor/assets/javascripts/ace/mode-eiffel.js +135 -0
- data/vendor/assets/javascripts/ace/mode-ejs.js +931 -938
- data/vendor/assets/javascripts/ace/mode-erlang.js +27 -58
- data/vendor/assets/javascripts/ace/mode-forth.js +27 -63
- data/vendor/assets/javascripts/ace/mode-ftl.js +457 -508
- data/vendor/assets/javascripts/ace/mode-gcode.js +85 -0
- data/vendor/assets/javascripts/ace/mode-gherkin.js +129 -0
- data/vendor/assets/javascripts/ace/mode-gitignore.js +50 -0
- data/vendor/assets/javascripts/ace/mode-glsl.js +252 -248
- data/vendor/assets/javascripts/ace/mode-golang.js +206 -179
- data/vendor/assets/javascripts/ace/mode-groovy.js +310 -242
- data/vendor/assets/javascripts/ace/mode-haml.js +156 -190
- data/vendor/assets/javascripts/ace/mode-handlebars.js +815 -784
- data/vendor/assets/javascripts/ace/mode-haskell.js +27 -63
- data/vendor/assets/javascripts/ace/mode-haxe.js +206 -176
- data/vendor/assets/javascripts/ace/mode-html.js +779 -792
- data/vendor/assets/javascripts/ace/mode-html_ruby.js +916 -923
- data/vendor/assets/javascripts/ace/mode-ini.js +27 -58
- data/vendor/assets/javascripts/ace/mode-io.js +201 -0
- data/vendor/assets/javascripts/ace/mode-jack.js +169 -170
- data/vendor/assets/javascripts/ace/mode-jade.js +722 -774
- data/vendor/assets/javascripts/ace/mode-java.js +310 -245
- data/vendor/assets/javascripts/ace/mode-javascript.js +285 -247
- data/vendor/assets/javascripts/ace/mode-json.js +183 -184
- data/vendor/assets/javascripts/ace/mode-jsoniq.js +3211 -1274
- data/vendor/assets/javascripts/ace/mode-jsp.js +481 -504
- data/vendor/assets/javascripts/ace/mode-jsx.js +206 -176
- data/vendor/assets/javascripts/ace/mode-julia.js +33 -69
- data/vendor/assets/javascripts/ace/mode-latex.js +74 -41
- data/vendor/assets/javascripts/ace/mode-less.js +250 -251
- data/vendor/assets/javascripts/ace/mode-liquid.js +424 -475
- data/vendor/assets/javascripts/ace/mode-lisp.js +24 -57
- data/vendor/assets/javascripts/ace/mode-livescript.js +42 -41
- data/vendor/assets/javascripts/ace/mode-logiql.js +229 -230
- data/vendor/assets/javascripts/ace/mode-lsl.js +200 -441
- data/vendor/assets/javascripts/ace/mode-lua.js +136 -167
- data/vendor/assets/javascripts/ace/mode-luapage.js +904 -884
- data/vendor/assets/javascripts/ace/mode-lucene.js +22 -17
- data/vendor/assets/javascripts/ace/mode-makefile.js +162 -137
- data/vendor/assets/javascripts/ace/mode-markdown.js +846 -854
- data/vendor/assets/javascripts/ace/mode-matlab.js +98 -72
- data/vendor/assets/javascripts/ace/mode-mel.js +569 -0
- data/vendor/assets/javascripts/ace/mode-mushcode.js +84 -115
- data/vendor/assets/javascripts/ace/mode-mysql.js +49 -80
- data/vendor/assets/javascripts/ace/mode-nix.js +252 -256
- data/vendor/assets/javascripts/ace/mode-objectivec.js +242 -274
- data/vendor/assets/javascripts/ace/mode-ocaml.js +71 -102
- data/vendor/assets/javascripts/ace/mode-pascal.js +32 -68
- data/vendor/assets/javascripts/ace/mode-perl.js +67 -98
- data/vendor/assets/javascripts/ace/mode-pgsql.js +990 -982
- data/vendor/assets/javascripts/ace/mode-php.js +1878 -1900
- data/vendor/assets/javascripts/ace/mode-plain_text.js +3 -34
- data/vendor/assets/javascripts/ace/mode-powershell.js +181 -151
- data/vendor/assets/javascripts/ace/mode-praat.js +418 -0
- data/vendor/assets/javascripts/ace/mode-prolog.js +27 -63
- data/vendor/assets/javascripts/ace/mode-properties.js +20 -48
- data/vendor/assets/javascripts/ace/mode-protobuf.js +252 -259
- data/vendor/assets/javascripts/ace/mode-python.js +84 -115
- data/vendor/assets/javascripts/ace/mode-r.js +105 -140
- data/vendor/assets/javascripts/ace/mode-rdoc.js +84 -89
- data/vendor/assets/javascripts/ace/mode-rhtml.js +892 -908
- data/vendor/assets/javascripts/ace/mode-ruby.js +434 -98
- data/vendor/assets/javascripts/ace/mode-rust.js +27 -63
- data/vendor/assets/javascripts/ace/mode-sass.js +75 -106
- data/vendor/assets/javascripts/ace/mode-scad.js +219 -220
- data/vendor/assets/javascripts/ace/mode-scala.js +311 -243
- data/vendor/assets/javascripts/ace/mode-scheme.js +24 -60
- data/vendor/assets/javascripts/ace/mode-scss.js +250 -251
- data/vendor/assets/javascripts/ace/mode-sh.js +506 -118
- data/vendor/assets/javascripts/ace/mode-sjs.js +314 -280
- data/vendor/assets/javascripts/ace/mode-smarty.js +2474 -0
- data/vendor/assets/javascripts/ace/mode-snippets.js +89 -89
- data/vendor/assets/javascripts/ace/mode-soy_template.js +792 -811
- data/vendor/assets/javascripts/ace/mode-space.js +22 -23
- data/vendor/assets/javascripts/ace/mode-sql.js +31 -58
- data/vendor/assets/javascripts/ace/mode-stylus.js +161 -197
- data/vendor/assets/javascripts/ace/mode-svg.js +906 -836
- data/vendor/assets/javascripts/ace/mode-tcl.js +61 -92
- data/vendor/assets/javascripts/ace/mode-tex.js +36 -73
- data/vendor/assets/javascripts/ace/mode-text.js +1 -0
- data/vendor/assets/javascripts/ace/mode-textile.js +41 -72
- data/vendor/assets/javascripts/ace/mode-toml.js +26 -62
- data/vendor/assets/javascripts/ace/mode-twig.js +1196 -892
- data/vendor/assets/javascripts/ace/mode-typescript.js +313 -277
- data/vendor/assets/javascripts/ace/mode-vala.js +982 -0
- data/vendor/assets/javascripts/ace/mode-vbscript.js +25 -62
- data/vendor/assets/javascripts/ace/mode-velocity.js +2251 -1242
- data/vendor/assets/javascripts/ace/mode-verilog.js +27 -59
- data/vendor/assets/javascripts/ace/mode-vhdl.js +26 -55
- data/vendor/assets/javascripts/ace/mode-xml.js +319 -644
- data/vendor/assets/javascripts/ace/mode-xquery.js +2503 -588
- data/vendor/assets/javascripts/ace/mode-yaml.js +56 -90
- data/vendor/assets/javascripts/ace/snippets/abap.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/actionscript.js +159 -0
- data/vendor/assets/javascripts/ace/snippets/ada.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/apache_conf.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/applescript.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/asciidoc.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/assembly_x86.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/autohotkey.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/batchfile.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/c9search.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/c_cpp.js +138 -0
- data/vendor/assets/javascripts/ace/snippets/cirru.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/clojure.js +97 -0
- data/vendor/assets/javascripts/ace/snippets/cobol.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/coffee.js +102 -0
- data/vendor/assets/javascripts/ace/snippets/coldfusion.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/csharp.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/css.js +974 -0
- data/vendor/assets/javascripts/ace/snippets/curly.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/d.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/dart.js +90 -0
- data/vendor/assets/javascripts/ace/snippets/diff.js +18 -0
- data/vendor/assets/javascripts/ace/snippets/django.js +115 -0
- data/vendor/assets/javascripts/ace/snippets/dockerfile.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/dot.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/eiffel.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/ejs.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/erlang.js +167 -0
- data/vendor/assets/javascripts/ace/snippets/forth.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/ftl.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/gcode.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/gherkin.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/gitignore.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/glsl.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/golang.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/groovy.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/haml.js +27 -0
- data/vendor/assets/javascripts/ace/snippets/handlebars.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/haskell.js +89 -0
- data/vendor/assets/javascripts/ace/snippets/haxe.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/html.js +835 -0
- data/vendor/assets/javascripts/ace/snippets/html_ruby.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/ini.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/io.js +69 -0
- data/vendor/assets/javascripts/ace/snippets/jack.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/jade.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/java.js +241 -0
- data/vendor/assets/javascripts/ace/snippets/javascript.js +189 -0
- data/vendor/assets/javascripts/ace/snippets/json.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/jsoniq.js +68 -0
- data/vendor/assets/javascripts/ace/snippets/jsp.js +106 -0
- data/vendor/assets/javascripts/ace/snippets/jsx.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/julia.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/latex.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/less.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/liquid.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/lisp.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/livescript.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/logiql.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/lsl.js +1073 -0
- data/vendor/assets/javascripts/ace/snippets/lua.js +28 -0
- data/vendor/assets/javascripts/ace/snippets/luapage.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/lucene.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/makefile.js +11 -0
- data/vendor/assets/javascripts/ace/snippets/markdown.js +95 -0
- data/vendor/assets/javascripts/ace/snippets/matlab.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/mel.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/mushcode.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/mysql.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/nix.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/objectivec.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/ocaml.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/pascal.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/perl.js +354 -0
- data/vendor/assets/javascripts/ace/snippets/pgsql.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/php.js +283 -0
- data/vendor/assets/javascripts/ace/snippets/plain_text.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/powershell.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/praat.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/prolog.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/properties.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/protobuf.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/python.js +165 -0
- data/vendor/assets/javascripts/ace/snippets/r.js +128 -0
- data/vendor/assets/javascripts/ace/snippets/rdoc.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/rhtml.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/ruby.js +935 -0
- data/vendor/assets/javascripts/ace/snippets/rust.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/sass.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/scad.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/scala.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/scheme.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/scss.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/sh.js +90 -0
- data/vendor/assets/javascripts/ace/snippets/sjs.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/smarty.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/snippets.js +16 -0
- data/vendor/assets/javascripts/ace/snippets/soy_template.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/space.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/sql.js +33 -0
- data/vendor/assets/javascripts/ace/snippets/stylus.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/svg.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/tcl.js +99 -0
- data/vendor/assets/javascripts/ace/snippets/tex.js +197 -0
- data/vendor/assets/javascripts/ace/snippets/text.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/textile.js +37 -0
- data/vendor/assets/javascripts/ace/snippets/toml.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/twig.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/typescript.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/vala.js +193 -0
- data/vendor/assets/javascripts/ace/snippets/vbscript.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/velocity.js +36 -0
- data/vendor/assets/javascripts/ace/snippets/verilog.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/vhdl.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/xml.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/xquery.js +68 -0
- data/vendor/assets/javascripts/ace/snippets/yaml.js +7 -0
- data/vendor/assets/javascripts/ace/theme-ambiance.js +4 -24
- data/vendor/assets/javascripts/ace/theme-chaos.js +2 -25
- data/vendor/assets/javascripts/ace/theme-chrome.js +2 -31
- data/vendor/assets/javascripts/ace/theme-clouds.js +1 -31
- data/vendor/assets/javascripts/ace/theme-clouds_midnight.js +1 -31
- data/vendor/assets/javascripts/ace/theme-cobalt.js +1 -31
- data/vendor/assets/javascripts/ace/theme-crimson_editor.js +1 -31
- data/vendor/assets/javascripts/ace/theme-dawn.js +1 -31
- data/vendor/assets/javascripts/ace/theme-dreamweaver.js +5 -31
- data/vendor/assets/javascripts/ace/theme-eclipse.js +7 -33
- data/vendor/assets/javascripts/ace/theme-github.js +2 -35
- data/vendor/assets/javascripts/ace/theme-idle_fingers.js +1 -31
- data/vendor/assets/javascripts/ace/theme-katzenmilch.js +119 -0
- data/vendor/assets/javascripts/ace/theme-kr.js +1 -31
- data/vendor/assets/javascripts/ace/theme-kr_theme.js +57 -141
- data/vendor/assets/javascripts/ace/theme-kuroir.js +59 -0
- data/vendor/assets/javascripts/ace/theme-merbivore.js +1 -31
- data/vendor/assets/javascripts/ace/theme-merbivore_soft.js +1 -31
- data/vendor/assets/javascripts/ace/theme-mono_industrial.js +1 -31
- data/vendor/assets/javascripts/ace/theme-monokai.js +1 -31
- data/vendor/assets/javascripts/ace/theme-pastel_on_dark.js +1 -31
- data/vendor/assets/javascripts/ace/theme-solarized_dark.js +1 -31
- data/vendor/assets/javascripts/ace/theme-solarized_light.js +1 -31
- data/vendor/assets/javascripts/ace/theme-terminal.js +1 -31
- data/vendor/assets/javascripts/ace/theme-textmate.js +3 -32
- data/vendor/assets/javascripts/ace/theme-tomorrow.js +1 -31
- data/vendor/assets/javascripts/ace/theme-tomorrow_night.js +1 -31
- data/vendor/assets/javascripts/ace/theme-tomorrow_night_blue.js +1 -31
- data/vendor/assets/javascripts/ace/theme-tomorrow_night_bright.js +1 -31
- data/vendor/assets/javascripts/ace/theme-tomorrow_night_eighties.js +1 -31
- data/vendor/assets/javascripts/ace/theme-twilight.js +1 -31
- data/vendor/assets/javascripts/ace/theme-vibrant_ink.js +1 -31
- data/vendor/assets/javascripts/ace/theme-xcode.js +2 -33
- data/vendor/assets/javascripts/ace/worker-coffee.js +5026 -5008
- data/vendor/assets/javascripts/ace/worker-css.js +5489 -5134
- data/vendor/assets/javascripts/ace/worker-html.js +11517 -0
- data/vendor/assets/javascripts/ace/worker-javascript.js +9810 -9501
- data/vendor/assets/javascripts/ace/worker-json.js +1583 -1564
- data/vendor/assets/javascripts/ace/worker-lua.js +2631 -2612
- data/vendor/assets/javascripts/ace/worker-php.js +2385 -2341
- data/vendor/assets/javascripts/ace/worker-xquery.js +31643 -3993
- metadata +147 -11
@@ -1,100 +1,5 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
*
|
4
|
-
* Copyright (c) 2010, Ajax.org B.V.
|
5
|
-
* All rights reserved.
|
6
|
-
*
|
7
|
-
* Redistribution and use in source and binary forms, with or without
|
8
|
-
* modification, are permitted provided that the following conditions are met:
|
9
|
-
* * Redistributions of source code must retain the above copyright
|
10
|
-
* notice, this list of conditions and the following disclaimer.
|
11
|
-
* * Redistributions in binary form must reproduce the above copyright
|
12
|
-
* notice, this list of conditions and the following disclaimer in the
|
13
|
-
* documentation and/or other materials provided with the distribution.
|
14
|
-
* * Neither the name of Ajax.org B.V. nor the
|
15
|
-
* names of its contributors may be used to endorse or promote products
|
16
|
-
* derived from this software without specific prior written permission.
|
17
|
-
*
|
18
|
-
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
19
|
-
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
20
|
-
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
21
|
-
* DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY
|
22
|
-
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
23
|
-
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
24
|
-
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
25
|
-
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
26
|
-
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
27
|
-
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
28
|
-
*
|
29
|
-
* ***** END LICENSE BLOCK ***** */
|
30
|
-
|
31
|
-
define('ace/mode/json', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/json_highlight_rules', 'ace/mode/matching_brace_outdent', 'ace/mode/behaviour/cstyle', 'ace/mode/folding/cstyle', 'ace/worker/worker_client'], function(require, exports, module) {
|
32
|
-
|
33
|
-
|
34
|
-
var oop = require("../lib/oop");
|
35
|
-
var TextMode = require("./text").Mode;
|
36
|
-
var Tokenizer = require("../tokenizer").Tokenizer;
|
37
|
-
var HighlightRules = require("./json_highlight_rules").JsonHighlightRules;
|
38
|
-
var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
|
39
|
-
var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
|
40
|
-
var CStyleFoldMode = require("./folding/cstyle").FoldMode;
|
41
|
-
var WorkerClient = require("../worker/worker_client").WorkerClient;
|
42
|
-
|
43
|
-
var Mode = function() {
|
44
|
-
this.HighlightRules = HighlightRules;
|
45
|
-
this.$outdent = new MatchingBraceOutdent();
|
46
|
-
this.$behaviour = new CstyleBehaviour();
|
47
|
-
this.foldingRules = new CStyleFoldMode();
|
48
|
-
};
|
49
|
-
oop.inherits(Mode, TextMode);
|
50
|
-
|
51
|
-
(function() {
|
52
|
-
|
53
|
-
this.getNextLineIndent = function(state, line, tab) {
|
54
|
-
var indent = this.$getIndent(line);
|
55
|
-
|
56
|
-
if (state == "start") {
|
57
|
-
var match = line.match(/^.*[\{\(\[]\s*$/);
|
58
|
-
if (match) {
|
59
|
-
indent += tab;
|
60
|
-
}
|
61
|
-
}
|
62
|
-
|
63
|
-
return indent;
|
64
|
-
};
|
65
|
-
|
66
|
-
this.checkOutdent = function(state, line, input) {
|
67
|
-
return this.$outdent.checkOutdent(line, input);
|
68
|
-
};
|
69
|
-
|
70
|
-
this.autoOutdent = function(state, doc, row) {
|
71
|
-
this.$outdent.autoOutdent(doc, row);
|
72
|
-
};
|
73
|
-
|
74
|
-
this.createWorker = function(session) {
|
75
|
-
var worker = new WorkerClient(["ace"], "ace/mode/json_worker", "JsonWorker");
|
76
|
-
worker.attachToDocument(session.getDocument());
|
77
|
-
|
78
|
-
worker.on("error", function(e) {
|
79
|
-
session.setAnnotations([e.data]);
|
80
|
-
});
|
81
|
-
|
82
|
-
worker.on("ok", function() {
|
83
|
-
session.clearAnnotations();
|
84
|
-
});
|
85
|
-
|
86
|
-
return worker;
|
87
|
-
};
|
88
|
-
|
89
|
-
|
90
|
-
this.$id = "ace/mode/json";
|
91
|
-
}).call(Mode.prototype);
|
92
|
-
|
93
|
-
exports.Mode = Mode;
|
94
|
-
});
|
95
|
-
|
96
|
-
define('ace/mode/json_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) {
|
97
|
-
|
1
|
+
define("ace/mode/json_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) {
|
2
|
+
"use strict";
|
98
3
|
|
99
4
|
var oop = require("../lib/oop");
|
100
5
|
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
|
@@ -161,8 +66,8 @@ oop.inherits(JsonHighlightRules, TextHighlightRules);
|
|
161
66
|
exports.JsonHighlightRules = JsonHighlightRules;
|
162
67
|
});
|
163
68
|
|
164
|
-
define(
|
165
|
-
|
69
|
+
define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"], function(require, exports, module) {
|
70
|
+
"use strict";
|
166
71
|
|
167
72
|
var Range = require("../range").Range;
|
168
73
|
|
@@ -201,8 +106,8 @@ var MatchingBraceOutdent = function() {};
|
|
201
106
|
exports.MatchingBraceOutdent = MatchingBraceOutdent;
|
202
107
|
});
|
203
108
|
|
204
|
-
define(
|
205
|
-
|
109
|
+
define("ace/mode/behaviour/cstyle",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"], function(require, exports, module) {
|
110
|
+
"use strict";
|
206
111
|
|
207
112
|
var oop = require("../../lib/oop");
|
208
113
|
var Behaviour = require("../behaviour").Behaviour;
|
@@ -214,83 +119,34 @@ var SAFE_INSERT_IN_TOKENS =
|
|
214
119
|
var SAFE_INSERT_BEFORE_TOKENS =
|
215
120
|
["text", "paren.rparen", "punctuation.operator", "comment"];
|
216
121
|
|
217
|
-
|
218
|
-
var
|
219
|
-
var
|
220
|
-
var
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
iterator.stepForward();
|
237
|
-
return iterator.getCurrentTokenRow() !== cursor.row ||
|
238
|
-
this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_BEFORE_TOKENS);
|
239
|
-
};
|
240
|
-
|
241
|
-
CstyleBehaviour.$matchTokenType = function(token, types) {
|
242
|
-
return types.indexOf(token.type || token) > -1;
|
243
|
-
};
|
244
|
-
|
245
|
-
CstyleBehaviour.recordAutoInsert = function(editor, session, bracket) {
|
246
|
-
var cursor = editor.getCursorPosition();
|
247
|
-
var line = session.doc.getLine(cursor.row);
|
248
|
-
if (!this.isAutoInsertedClosing(cursor, line, autoInsertedLineEnd[0]))
|
249
|
-
autoInsertedBrackets = 0;
|
250
|
-
autoInsertedRow = cursor.row;
|
251
|
-
autoInsertedLineEnd = bracket + line.substr(cursor.column);
|
252
|
-
autoInsertedBrackets++;
|
253
|
-
};
|
254
|
-
|
255
|
-
CstyleBehaviour.recordMaybeInsert = function(editor, session, bracket) {
|
256
|
-
var cursor = editor.getCursorPosition();
|
257
|
-
var line = session.doc.getLine(cursor.row);
|
258
|
-
if (!this.isMaybeInsertedClosing(cursor, line))
|
259
|
-
maybeInsertedBrackets = 0;
|
260
|
-
maybeInsertedRow = cursor.row;
|
261
|
-
maybeInsertedLineStart = line.substr(0, cursor.column) + bracket;
|
262
|
-
maybeInsertedLineEnd = line.substr(cursor.column);
|
263
|
-
maybeInsertedBrackets++;
|
264
|
-
};
|
265
|
-
|
266
|
-
CstyleBehaviour.isAutoInsertedClosing = function(cursor, line, bracket) {
|
267
|
-
return autoInsertedBrackets > 0 &&
|
268
|
-
cursor.row === autoInsertedRow &&
|
269
|
-
bracket === autoInsertedLineEnd[0] &&
|
270
|
-
line.substr(cursor.column) === autoInsertedLineEnd;
|
271
|
-
};
|
272
|
-
|
273
|
-
CstyleBehaviour.isMaybeInsertedClosing = function(cursor, line) {
|
274
|
-
return maybeInsertedBrackets > 0 &&
|
275
|
-
cursor.row === maybeInsertedRow &&
|
276
|
-
line.substr(cursor.column) === maybeInsertedLineEnd &&
|
277
|
-
line.substr(0, cursor.column) == maybeInsertedLineStart;
|
278
|
-
};
|
279
|
-
|
280
|
-
CstyleBehaviour.popAutoInsertedClosing = function() {
|
281
|
-
autoInsertedLineEnd = autoInsertedLineEnd.substr(1);
|
282
|
-
autoInsertedBrackets--;
|
283
|
-
};
|
284
|
-
|
285
|
-
CstyleBehaviour.clearMaybeInsertedClosing = function() {
|
286
|
-
maybeInsertedBrackets = 0;
|
287
|
-
maybeInsertedRow = -1;
|
122
|
+
var context;
|
123
|
+
var contextCache = {}
|
124
|
+
var initContext = function(editor) {
|
125
|
+
var id = -1;
|
126
|
+
if (editor.multiSelect) {
|
127
|
+
id = editor.selection.id;
|
128
|
+
if (contextCache.rangeCount != editor.multiSelect.rangeCount)
|
129
|
+
contextCache = {rangeCount: editor.multiSelect.rangeCount};
|
130
|
+
}
|
131
|
+
if (contextCache[id])
|
132
|
+
return context = contextCache[id];
|
133
|
+
context = contextCache[id] = {
|
134
|
+
autoInsertedBrackets: 0,
|
135
|
+
autoInsertedRow: -1,
|
136
|
+
autoInsertedLineEnd: "",
|
137
|
+
maybeInsertedBrackets: 0,
|
138
|
+
maybeInsertedRow: -1,
|
139
|
+
maybeInsertedLineStart: "",
|
140
|
+
maybeInsertedLineEnd: ""
|
288
141
|
};
|
142
|
+
};
|
289
143
|
|
290
|
-
|
144
|
+
var CstyleBehaviour = function() {
|
145
|
+
this.add("braces", "insertion", function(state, action, editor, session, text) {
|
291
146
|
var cursor = editor.getCursorPosition();
|
292
147
|
var line = session.doc.getLine(cursor.row);
|
293
148
|
if (text == '{') {
|
149
|
+
initContext(editor);
|
294
150
|
var selection = editor.getSelectionRange();
|
295
151
|
var selected = session.doc.getTextRange(selection);
|
296
152
|
if (selected !== "" && selected !== "{" && editor.getWrapBehavioursEnabled()) {
|
@@ -314,6 +170,7 @@ var CstyleBehaviour = function () {
|
|
314
170
|
}
|
315
171
|
}
|
316
172
|
} else if (text == '}') {
|
173
|
+
initContext(editor);
|
317
174
|
var rightChar = line.substring(cursor.column, cursor.column + 1);
|
318
175
|
if (rightChar == '}') {
|
319
176
|
var matching = session.$findOpeningBracket('}', {column: cursor.column + 1, row: cursor.row});
|
@@ -326,9 +183,10 @@ var CstyleBehaviour = function () {
|
|
326
183
|
}
|
327
184
|
}
|
328
185
|
} else if (text == "\n" || text == "\r\n") {
|
186
|
+
initContext(editor);
|
329
187
|
var closing = "";
|
330
188
|
if (CstyleBehaviour.isMaybeInsertedClosing(cursor, line)) {
|
331
|
-
closing = lang.stringRepeat("}", maybeInsertedBrackets);
|
189
|
+
closing = lang.stringRepeat("}", context.maybeInsertedBrackets);
|
332
190
|
CstyleBehaviour.clearMaybeInsertedClosing();
|
333
191
|
}
|
334
192
|
var rightChar = line.substring(cursor.column, cursor.column + 1);
|
@@ -340,6 +198,7 @@ var CstyleBehaviour = function () {
|
|
340
198
|
} else if (closing) {
|
341
199
|
var next_indent = this.$getIndent(line);
|
342
200
|
} else {
|
201
|
+
CstyleBehaviour.clearMaybeInsertedClosing();
|
343
202
|
return;
|
344
203
|
}
|
345
204
|
var indent = next_indent + session.getTabString();
|
@@ -353,22 +212,24 @@ var CstyleBehaviour = function () {
|
|
353
212
|
}
|
354
213
|
});
|
355
214
|
|
356
|
-
this.add("braces", "deletion", function
|
215
|
+
this.add("braces", "deletion", function(state, action, editor, session, range) {
|
357
216
|
var selected = session.doc.getTextRange(range);
|
358
217
|
if (!range.isMultiLine() && selected == '{') {
|
218
|
+
initContext(editor);
|
359
219
|
var line = session.doc.getLine(range.start.row);
|
360
220
|
var rightChar = line.substring(range.end.column, range.end.column + 1);
|
361
221
|
if (rightChar == '}') {
|
362
222
|
range.end.column++;
|
363
223
|
return range;
|
364
224
|
} else {
|
365
|
-
maybeInsertedBrackets--;
|
225
|
+
context.maybeInsertedBrackets--;
|
366
226
|
}
|
367
227
|
}
|
368
228
|
});
|
369
229
|
|
370
|
-
this.add("parens", "insertion", function
|
230
|
+
this.add("parens", "insertion", function(state, action, editor, session, text) {
|
371
231
|
if (text == '(') {
|
232
|
+
initContext(editor);
|
372
233
|
var selection = editor.getSelectionRange();
|
373
234
|
var selected = session.doc.getTextRange(selection);
|
374
235
|
if (selected !== "" && editor.getWrapBehavioursEnabled()) {
|
@@ -384,6 +245,7 @@ var CstyleBehaviour = function () {
|
|
384
245
|
};
|
385
246
|
}
|
386
247
|
} else if (text == ')') {
|
248
|
+
initContext(editor);
|
387
249
|
var cursor = editor.getCursorPosition();
|
388
250
|
var line = session.doc.getLine(cursor.row);
|
389
251
|
var rightChar = line.substring(cursor.column, cursor.column + 1);
|
@@ -400,9 +262,10 @@ var CstyleBehaviour = function () {
|
|
400
262
|
}
|
401
263
|
});
|
402
264
|
|
403
|
-
this.add("parens", "deletion", function
|
265
|
+
this.add("parens", "deletion", function(state, action, editor, session, range) {
|
404
266
|
var selected = session.doc.getTextRange(range);
|
405
267
|
if (!range.isMultiLine() && selected == '(') {
|
268
|
+
initContext(editor);
|
406
269
|
var line = session.doc.getLine(range.start.row);
|
407
270
|
var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
|
408
271
|
if (rightChar == ')') {
|
@@ -412,8 +275,9 @@ var CstyleBehaviour = function () {
|
|
412
275
|
}
|
413
276
|
});
|
414
277
|
|
415
|
-
this.add("brackets", "insertion", function
|
278
|
+
this.add("brackets", "insertion", function(state, action, editor, session, text) {
|
416
279
|
if (text == '[') {
|
280
|
+
initContext(editor);
|
417
281
|
var selection = editor.getSelectionRange();
|
418
282
|
var selected = session.doc.getTextRange(selection);
|
419
283
|
if (selected !== "" && editor.getWrapBehavioursEnabled()) {
|
@@ -429,6 +293,7 @@ var CstyleBehaviour = function () {
|
|
429
293
|
};
|
430
294
|
}
|
431
295
|
} else if (text == ']') {
|
296
|
+
initContext(editor);
|
432
297
|
var cursor = editor.getCursorPosition();
|
433
298
|
var line = session.doc.getLine(cursor.row);
|
434
299
|
var rightChar = line.substring(cursor.column, cursor.column + 1);
|
@@ -445,9 +310,10 @@ var CstyleBehaviour = function () {
|
|
445
310
|
}
|
446
311
|
});
|
447
312
|
|
448
|
-
this.add("brackets", "deletion", function
|
313
|
+
this.add("brackets", "deletion", function(state, action, editor, session, range) {
|
449
314
|
var selected = session.doc.getTextRange(range);
|
450
315
|
if (!range.isMultiLine() && selected == '[') {
|
316
|
+
initContext(editor);
|
451
317
|
var line = session.doc.getLine(range.start.row);
|
452
318
|
var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
|
453
319
|
if (rightChar == ']') {
|
@@ -457,8 +323,9 @@ var CstyleBehaviour = function () {
|
|
457
323
|
}
|
458
324
|
});
|
459
325
|
|
460
|
-
this.add("string_dquotes", "insertion", function
|
326
|
+
this.add("string_dquotes", "insertion", function(state, action, editor, session, text) {
|
461
327
|
if (text == '"' || text == "'") {
|
328
|
+
initContext(editor);
|
462
329
|
var quote = text;
|
463
330
|
var selection = editor.getSelectionRange();
|
464
331
|
var selected = session.doc.getTextRange(selection);
|
@@ -510,9 +377,10 @@ var CstyleBehaviour = function () {
|
|
510
377
|
}
|
511
378
|
});
|
512
379
|
|
513
|
-
this.add("string_dquotes", "deletion", function
|
380
|
+
this.add("string_dquotes", "deletion", function(state, action, editor, session, range) {
|
514
381
|
var selected = session.doc.getTextRange(range);
|
515
382
|
if (!range.isMultiLine() && (selected == '"' || selected == "'")) {
|
383
|
+
initContext(editor);
|
516
384
|
var line = session.doc.getLine(range.start.row);
|
517
385
|
var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
|
518
386
|
if (rightChar == selected) {
|
@@ -524,13 +392,80 @@ var CstyleBehaviour = function () {
|
|
524
392
|
|
525
393
|
};
|
526
394
|
|
395
|
+
|
396
|
+
CstyleBehaviour.isSaneInsertion = function(editor, session) {
|
397
|
+
var cursor = editor.getCursorPosition();
|
398
|
+
var iterator = new TokenIterator(session, cursor.row, cursor.column);
|
399
|
+
if (!this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS)) {
|
400
|
+
var iterator2 = new TokenIterator(session, cursor.row, cursor.column + 1);
|
401
|
+
if (!this.$matchTokenType(iterator2.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS))
|
402
|
+
return false;
|
403
|
+
}
|
404
|
+
iterator.stepForward();
|
405
|
+
return iterator.getCurrentTokenRow() !== cursor.row ||
|
406
|
+
this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_BEFORE_TOKENS);
|
407
|
+
};
|
408
|
+
|
409
|
+
CstyleBehaviour.$matchTokenType = function(token, types) {
|
410
|
+
return types.indexOf(token.type || token) > -1;
|
411
|
+
};
|
412
|
+
|
413
|
+
CstyleBehaviour.recordAutoInsert = function(editor, session, bracket) {
|
414
|
+
var cursor = editor.getCursorPosition();
|
415
|
+
var line = session.doc.getLine(cursor.row);
|
416
|
+
if (!this.isAutoInsertedClosing(cursor, line, context.autoInsertedLineEnd[0]))
|
417
|
+
context.autoInsertedBrackets = 0;
|
418
|
+
context.autoInsertedRow = cursor.row;
|
419
|
+
context.autoInsertedLineEnd = bracket + line.substr(cursor.column);
|
420
|
+
context.autoInsertedBrackets++;
|
421
|
+
};
|
422
|
+
|
423
|
+
CstyleBehaviour.recordMaybeInsert = function(editor, session, bracket) {
|
424
|
+
var cursor = editor.getCursorPosition();
|
425
|
+
var line = session.doc.getLine(cursor.row);
|
426
|
+
if (!this.isMaybeInsertedClosing(cursor, line))
|
427
|
+
context.maybeInsertedBrackets = 0;
|
428
|
+
context.maybeInsertedRow = cursor.row;
|
429
|
+
context.maybeInsertedLineStart = line.substr(0, cursor.column) + bracket;
|
430
|
+
context.maybeInsertedLineEnd = line.substr(cursor.column);
|
431
|
+
context.maybeInsertedBrackets++;
|
432
|
+
};
|
433
|
+
|
434
|
+
CstyleBehaviour.isAutoInsertedClosing = function(cursor, line, bracket) {
|
435
|
+
return context.autoInsertedBrackets > 0 &&
|
436
|
+
cursor.row === context.autoInsertedRow &&
|
437
|
+
bracket === context.autoInsertedLineEnd[0] &&
|
438
|
+
line.substr(cursor.column) === context.autoInsertedLineEnd;
|
439
|
+
};
|
440
|
+
|
441
|
+
CstyleBehaviour.isMaybeInsertedClosing = function(cursor, line) {
|
442
|
+
return context.maybeInsertedBrackets > 0 &&
|
443
|
+
cursor.row === context.maybeInsertedRow &&
|
444
|
+
line.substr(cursor.column) === context.maybeInsertedLineEnd &&
|
445
|
+
line.substr(0, cursor.column) == context.maybeInsertedLineStart;
|
446
|
+
};
|
447
|
+
|
448
|
+
CstyleBehaviour.popAutoInsertedClosing = function() {
|
449
|
+
context.autoInsertedLineEnd = context.autoInsertedLineEnd.substr(1);
|
450
|
+
context.autoInsertedBrackets--;
|
451
|
+
};
|
452
|
+
|
453
|
+
CstyleBehaviour.clearMaybeInsertedClosing = function() {
|
454
|
+
if (context) {
|
455
|
+
context.maybeInsertedBrackets = 0;
|
456
|
+
context.maybeInsertedRow = -1;
|
457
|
+
}
|
458
|
+
};
|
459
|
+
|
460
|
+
|
461
|
+
|
527
462
|
oop.inherits(CstyleBehaviour, Behaviour);
|
528
463
|
|
529
464
|
exports.CstyleBehaviour = CstyleBehaviour;
|
530
465
|
});
|
531
466
|
|
532
|
-
define(
|
533
|
-
|
467
|
+
define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) {
|
468
|
+
"use strict";
|
534
469
|
|
535
470
|
var oop = require("../../lib/oop");
|
536
471
|
var Range = require("../../range").Range;
|
@@ -623,3 +558,67 @@ oop.inherits(FoldMode, BaseFoldMode);
|
|
623
558
|
}).call(FoldMode.prototype);
|
624
559
|
|
625
560
|
});
|
561
|
+
|
562
|
+
define("ace/mode/json",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/json_highlight_rules","ace/mode/matching_brace_outdent","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle","ace/worker/worker_client"], function(require, exports, module) {
|
563
|
+
"use strict";
|
564
|
+
|
565
|
+
var oop = require("../lib/oop");
|
566
|
+
var TextMode = require("./text").Mode;
|
567
|
+
var HighlightRules = require("./json_highlight_rules").JsonHighlightRules;
|
568
|
+
var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
|
569
|
+
var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
|
570
|
+
var CStyleFoldMode = require("./folding/cstyle").FoldMode;
|
571
|
+
var WorkerClient = require("../worker/worker_client").WorkerClient;
|
572
|
+
|
573
|
+
var Mode = function() {
|
574
|
+
this.HighlightRules = HighlightRules;
|
575
|
+
this.$outdent = new MatchingBraceOutdent();
|
576
|
+
this.$behaviour = new CstyleBehaviour();
|
577
|
+
this.foldingRules = new CStyleFoldMode();
|
578
|
+
};
|
579
|
+
oop.inherits(Mode, TextMode);
|
580
|
+
|
581
|
+
(function() {
|
582
|
+
|
583
|
+
this.getNextLineIndent = function(state, line, tab) {
|
584
|
+
var indent = this.$getIndent(line);
|
585
|
+
|
586
|
+
if (state == "start") {
|
587
|
+
var match = line.match(/^.*[\{\(\[]\s*$/);
|
588
|
+
if (match) {
|
589
|
+
indent += tab;
|
590
|
+
}
|
591
|
+
}
|
592
|
+
|
593
|
+
return indent;
|
594
|
+
};
|
595
|
+
|
596
|
+
this.checkOutdent = function(state, line, input) {
|
597
|
+
return this.$outdent.checkOutdent(line, input);
|
598
|
+
};
|
599
|
+
|
600
|
+
this.autoOutdent = function(state, doc, row) {
|
601
|
+
this.$outdent.autoOutdent(doc, row);
|
602
|
+
};
|
603
|
+
|
604
|
+
this.createWorker = function(session) {
|
605
|
+
var worker = new WorkerClient(["ace"], "ace/mode/json_worker", "JsonWorker");
|
606
|
+
worker.attachToDocument(session.getDocument());
|
607
|
+
|
608
|
+
worker.on("error", function(e) {
|
609
|
+
session.setAnnotations([e.data]);
|
610
|
+
});
|
611
|
+
|
612
|
+
worker.on("ok", function() {
|
613
|
+
session.clearAnnotations();
|
614
|
+
});
|
615
|
+
|
616
|
+
return worker;
|
617
|
+
};
|
618
|
+
|
619
|
+
|
620
|
+
this.$id = "ace/mode/json";
|
621
|
+
}).call(Mode.prototype);
|
622
|
+
|
623
|
+
exports.Mode = Mode;
|
624
|
+
});
|