ace-rails-ap 3.0.1 → 3.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ace/rails/version.rb +1 -1
- data/vendor/assets/javascripts/ace/ace.js +210 -161
- data/vendor/assets/javascripts/ace/ext-beautify.js +0 -1
- data/vendor/assets/javascripts/ace/ext-chromevox.js +0 -1
- data/vendor/assets/javascripts/ace/ext-elastic_tabstops_lite.js +0 -1
- data/vendor/assets/javascripts/ace/ext-emmet.js +66 -48
- data/vendor/assets/javascripts/ace/ext-keybinding_menu.js +9 -19
- data/vendor/assets/javascripts/ace/ext-language_tools.js +108 -10
- data/vendor/assets/javascripts/ace/ext-linking.js +0 -1
- data/vendor/assets/javascripts/ace/ext-modelist.js +4 -1
- data/vendor/assets/javascripts/ace/ext-old_ie.js +23 -2
- data/vendor/assets/javascripts/ace/ext-searchbox.js +23 -2
- data/vendor/assets/javascripts/ace/ext-settings_menu.js +10 -1
- data/vendor/assets/javascripts/ace/ext-spellcheck.js +0 -1
- data/vendor/assets/javascripts/ace/ext-split.js +0 -1
- data/vendor/assets/javascripts/ace/ext-static_highlight.js +0 -1
- data/vendor/assets/javascripts/ace/ext-statusbar.js +2 -4
- data/vendor/assets/javascripts/ace/ext-textarea.js +0 -1
- data/vendor/assets/javascripts/ace/ext-themelist.js +0 -1
- data/vendor/assets/javascripts/ace/ext-whitespace.js +0 -1
- data/vendor/assets/javascripts/ace/keybinding-emacs.js +159 -50
- data/vendor/assets/javascripts/ace/mode-autohotkey.js +1 -1
- data/vendor/assets/javascripts/ace/mode-c_cpp.js +32 -14
- data/vendor/assets/javascripts/ace/mode-coffee.js +1 -1
- data/vendor/assets/javascripts/ace/mode-coldfusion.js +62 -24
- data/vendor/assets/javascripts/ace/mode-csharp.js +14 -8
- data/vendor/assets/javascripts/ace/mode-css.js +2 -2
- data/vendor/assets/javascripts/ace/mode-curly.js +62 -24
- data/vendor/assets/javascripts/ace/mode-d.js +13 -7
- data/vendor/assets/javascripts/ace/mode-dart.js +32 -14
- data/vendor/assets/javascripts/ace/mode-django.js +62 -24
- data/vendor/assets/javascripts/ace/mode-dockerfile.js +3 -3
- data/vendor/assets/javascripts/ace/mode-dot.js +12 -6
- data/vendor/assets/javascripts/ace/mode-ejs.js +126 -27
- data/vendor/assets/javascripts/ace/mode-elixir.js +493 -0
- data/vendor/assets/javascripts/ace/mode-elm.js +248 -0
- data/vendor/assets/javascripts/ace/mode-forth.js +1 -1
- data/vendor/assets/javascripts/ace/mode-ftl.js +20 -10
- data/vendor/assets/javascripts/ace/mode-gitignore.js +1 -0
- data/vendor/assets/javascripts/ace/mode-glsl.js +32 -14
- data/vendor/assets/javascripts/ace/mode-golang.js +14 -8
- data/vendor/assets/javascripts/ace/mode-groovy.js +22 -12
- data/vendor/assets/javascripts/ace/mode-haml.js +64 -3
- data/vendor/assets/javascripts/ace/mode-handlebars.js +72 -34
- data/vendor/assets/javascripts/ace/mode-haxe.js +14 -8
- data/vendor/assets/javascripts/ace/mode-html.js +62 -24
- data/vendor/assets/javascripts/ace/mode-html_ruby.js +126 -27
- data/vendor/assets/javascripts/ace/mode-jack.js +2 -2
- data/vendor/assets/javascripts/ace/mode-jade.js +21 -11
- data/vendor/assets/javascripts/ace/mode-java.js +22 -12
- data/vendor/assets/javascripts/ace/mode-javascript.js +22 -12
- data/vendor/assets/javascripts/ace/mode-json.js +2 -2
- data/vendor/assets/javascripts/ace/mode-jsoniq.js +47 -1835
- data/vendor/assets/javascripts/ace/mode-jsp.js +22 -12
- data/vendor/assets/javascripts/ace/mode-jsx.js +14 -8
- data/vendor/assets/javascripts/ace/mode-less.js +2 -2
- data/vendor/assets/javascripts/ace/mode-liquid.js +20 -10
- data/vendor/assets/javascripts/ace/mode-logiql.js +2 -2
- data/vendor/assets/javascripts/ace/mode-lsl.js +2 -2
- data/vendor/assets/javascripts/ace/mode-luapage.js +62 -24
- data/vendor/assets/javascripts/ace/mode-markdown.js +62 -24
- data/vendor/assets/javascripts/ace/mode-mel.js +2 -2
- data/vendor/assets/javascripts/ace/mode-mysql.js +12 -6
- data/vendor/assets/javascripts/ace/mode-nix.js +32 -14
- data/vendor/assets/javascripts/ace/mode-objectivec.js +30 -12
- data/vendor/assets/javascripts/ace/mode-pgsql.js +20 -10
- data/vendor/assets/javascripts/ace/mode-php.js +1126 -40
- data/vendor/assets/javascripts/ace/mode-powershell.js +2 -2
- data/vendor/assets/javascripts/ace/mode-protobuf.js +32 -14
- data/vendor/assets/javascripts/ace/mode-rhtml.js +62 -24
- data/vendor/assets/javascripts/ace/mode-ruby.js +66 -5
- data/vendor/assets/javascripts/ace/mode-rust.js +36 -3
- data/vendor/assets/javascripts/ace/mode-scad.js +14 -8
- data/vendor/assets/javascripts/ace/mode-scala.js +22 -12
- data/vendor/assets/javascripts/ace/mode-scss.js +2 -2
- data/vendor/assets/javascripts/ace/mode-sh.js +2 -2
- data/vendor/assets/javascripts/ace/mode-sjs.js +22 -12
- data/vendor/assets/javascripts/ace/mode-smarty.js +62 -24
- data/vendor/assets/javascripts/ace/mode-soy_template.js +63 -25
- data/vendor/assets/javascripts/ace/mode-stylus.js +4 -1
- data/vendor/assets/javascripts/ace/mode-svg.js +62 -24
- data/vendor/assets/javascripts/ace/mode-textile.js +1 -0
- data/vendor/assets/javascripts/ace/mode-twig.js +62 -24
- data/vendor/assets/javascripts/ace/mode-typescript.js +22 -12
- data/vendor/assets/javascripts/ace/mode-vala.js +2 -2
- data/vendor/assets/javascripts/ace/mode-velocity.js +62 -24
- data/vendor/assets/javascripts/ace/mode-xml.js +40 -12
- data/vendor/assets/javascripts/ace/mode-xquery.js +47 -1835
- data/vendor/assets/javascripts/ace/theme-cobalt.js +1 -1
- data/vendor/assets/javascripts/ace/theme-idle_fingers.js +1 -1
- data/vendor/assets/javascripts/ace/theme-tomorrow_night_bright.js +2 -2
- data/vendor/assets/javascripts/ace/worker-coffee.js +15 -5
- data/vendor/assets/javascripts/ace/worker-css.js +15 -5
- data/vendor/assets/javascripts/ace/worker-html.js +15 -5
- data/vendor/assets/javascripts/ace/worker-javascript.js +15 -5
- data/vendor/assets/javascripts/ace/worker-json.js +17 -6
- data/vendor/assets/javascripts/ace/worker-lua.js +15 -5
- data/vendor/assets/javascripts/ace/worker-php.js +15 -5
- data/vendor/assets/javascripts/ace/worker-xquery.js +15 -5
- metadata +4 -2
@@ -149,22 +149,28 @@ var oop = require("../lib/oop");
|
|
149
149
|
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
|
150
150
|
|
151
151
|
var DocCommentHighlightRules = function() {
|
152
|
-
|
153
152
|
this.$rules = {
|
154
153
|
"start" : [ {
|
155
154
|
token : "comment.doc.tag",
|
156
155
|
regex : "@[\\w\\d_]+" // TODO: fix email addresses
|
157
|
-
},
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
156
|
+
},
|
157
|
+
DocCommentHighlightRules.getTagRule(),
|
158
|
+
{
|
159
|
+
defaultToken : "comment.doc",
|
160
|
+
caseInsensitive: true
|
162
161
|
}]
|
163
162
|
};
|
164
163
|
};
|
165
164
|
|
166
165
|
oop.inherits(DocCommentHighlightRules, TextHighlightRules);
|
167
166
|
|
167
|
+
DocCommentHighlightRules.getTagRule = function(start) {
|
168
|
+
return {
|
169
|
+
token : "comment.doc.tag.storage.type",
|
170
|
+
regex : "\\b(?:TODO|FIXME|XXX|HACK)\\b"
|
171
|
+
};
|
172
|
+
}
|
173
|
+
|
168
174
|
DocCommentHighlightRules.getStartRule = function(start) {
|
169
175
|
return {
|
170
176
|
token : "comment.doc", // doc comment
|
@@ -436,20 +442,24 @@ var JavaScriptHighlightRules = function(options) {
|
|
436
442
|
}
|
437
443
|
],
|
438
444
|
"comment_regex_allowed" : [
|
445
|
+
DocCommentHighlightRules.getTagRule(),
|
439
446
|
{token : "comment", regex : "\\*\\/", next : "start"},
|
440
|
-
{defaultToken : "comment"}
|
447
|
+
{defaultToken : "comment", caseInsensitive: true}
|
441
448
|
],
|
442
449
|
"comment" : [
|
450
|
+
DocCommentHighlightRules.getTagRule(),
|
443
451
|
{token : "comment", regex : "\\*\\/", next : "no_regex"},
|
444
|
-
{defaultToken : "comment"}
|
452
|
+
{defaultToken : "comment", caseInsensitive: true}
|
445
453
|
],
|
446
454
|
"line_comment_regex_allowed" : [
|
455
|
+
DocCommentHighlightRules.getTagRule(),
|
447
456
|
{token : "comment", regex : "$|^", next : "start"},
|
448
|
-
{defaultToken : "comment"}
|
457
|
+
{defaultToken : "comment", caseInsensitive: true}
|
449
458
|
],
|
450
459
|
"line_comment" : [
|
460
|
+
DocCommentHighlightRules.getTagRule(),
|
451
461
|
{token : "comment", regex : "$|^", next : "no_regex"},
|
452
|
-
{defaultToken : "comment"}
|
462
|
+
{defaultToken : "comment", caseInsensitive: true}
|
453
463
|
],
|
454
464
|
"qqstring" : [
|
455
465
|
{
|
@@ -934,9 +944,70 @@ var RubyHighlightRules = function() {
|
|
934
944
|
regex : "[/](?:(?:\\[(?:\\\\]|[^\\]])+\\])|(?:\\\\/|[^\\]/]))*[/]\\w*\\s*(?=[).,;]|$)"
|
935
945
|
},
|
936
946
|
|
937
|
-
|
938
|
-
|
939
|
-
|
947
|
+
[{
|
948
|
+
regex: "[{}]", onMatch: function(val, state, stack) {
|
949
|
+
this.next = val == "{" ? this.nextState : "";
|
950
|
+
if (val == "{" && stack.length) {
|
951
|
+
stack.unshift("start", state);
|
952
|
+
return "paren.lparen";
|
953
|
+
}
|
954
|
+
if (val == "}" && stack.length) {
|
955
|
+
stack.shift();
|
956
|
+
this.next = stack.shift();
|
957
|
+
if (this.next.indexOf("string") != -1)
|
958
|
+
return "paren.end";
|
959
|
+
}
|
960
|
+
return val == "{" ? "paren.lparen" : "paren.rparen";
|
961
|
+
},
|
962
|
+
nextState: "start"
|
963
|
+
}, {
|
964
|
+
token : "string.start",
|
965
|
+
regex : /"/,
|
966
|
+
push : [{
|
967
|
+
token : "constant.language.escape",
|
968
|
+
regex : /\\(?:[nsrtvfbae'"\\]|c.|C-.|M-.(?:\\C-.)?|[0-7]{3}|x[\da-fA-F]{2}|u[\da-fA-F]{4})/
|
969
|
+
}, {
|
970
|
+
token : "paren.start",
|
971
|
+
regex : /\#{/,
|
972
|
+
push : "start"
|
973
|
+
}, {
|
974
|
+
token : "string.end",
|
975
|
+
regex : /"/,
|
976
|
+
next : "pop"
|
977
|
+
}, {
|
978
|
+
defaultToken: "string"
|
979
|
+
}]
|
980
|
+
}, {
|
981
|
+
token : "string.start",
|
982
|
+
regex : /`/,
|
983
|
+
push : [{
|
984
|
+
token : "constant.language.escape",
|
985
|
+
regex : /\\(?:[nsrtvfbae'"\\]|c.|C-.|M-.(?:\\C-.)?|[0-7]{3}|x[\da-fA-F]{2}|u[\da-fA-F]{4})/
|
986
|
+
}, {
|
987
|
+
token : "paren.start",
|
988
|
+
regex : /\#{/,
|
989
|
+
push : "start"
|
990
|
+
}, {
|
991
|
+
token : "string.end",
|
992
|
+
regex : /`/,
|
993
|
+
next : "pop"
|
994
|
+
}, {
|
995
|
+
defaultToken: "string"
|
996
|
+
}]
|
997
|
+
}, {
|
998
|
+
token : "string.start",
|
999
|
+
regex : /'/,
|
1000
|
+
push : [{
|
1001
|
+
token : "constant.language.escape",
|
1002
|
+
regex : /\\['\\]/
|
1003
|
+
}, {
|
1004
|
+
token : "string.end",
|
1005
|
+
regex : /'/,
|
1006
|
+
next : "pop"
|
1007
|
+
}, {
|
1008
|
+
defaultToken: "string"
|
1009
|
+
}]
|
1010
|
+
}],
|
940
1011
|
|
941
1012
|
{
|
942
1013
|
token : "text", // namespaces aren't symbols
|
@@ -1160,11 +1231,11 @@ var SAFE_INSERT_BEFORE_TOKENS =
|
|
1160
1231
|
["text", "paren.rparen", "punctuation.operator", "comment"];
|
1161
1232
|
|
1162
1233
|
var context;
|
1163
|
-
var contextCache = {}
|
1234
|
+
var contextCache = {};
|
1164
1235
|
var initContext = function(editor) {
|
1165
1236
|
var id = -1;
|
1166
1237
|
if (editor.multiSelect) {
|
1167
|
-
id = editor.selection.
|
1238
|
+
id = editor.selection.index;
|
1168
1239
|
if (contextCache.rangeCount != editor.multiSelect.rangeCount)
|
1169
1240
|
contextCache = {rangeCount: editor.multiSelect.rangeCount};
|
1170
1241
|
}
|
@@ -1834,12 +1905,13 @@ exports.Mode = Mode;
|
|
1834
1905
|
|
1835
1906
|
});
|
1836
1907
|
|
1837
|
-
define("ace/mode/behaviour/xml",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator"], function(require, exports, module) {
|
1908
|
+
define("ace/mode/behaviour/xml",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"], function(require, exports, module) {
|
1838
1909
|
"use strict";
|
1839
1910
|
|
1840
1911
|
var oop = require("../../lib/oop");
|
1841
1912
|
var Behaviour = require("../behaviour").Behaviour;
|
1842
1913
|
var TokenIterator = require("../../token_iterator").TokenIterator;
|
1914
|
+
var lang = require("../../lib/lang");
|
1843
1915
|
|
1844
1916
|
function is(token, type) {
|
1845
1917
|
return token.type.lastIndexOf(type + ".xml") > -1;
|
@@ -1937,29 +2009,56 @@ var XmlBehaviour = function () {
|
|
1937
2009
|
return;
|
1938
2010
|
|
1939
2011
|
return {
|
1940
|
-
text:
|
2012
|
+
text: ">" + "</" + element + ">",
|
1941
2013
|
selection: [1, 1]
|
1942
2014
|
};
|
1943
2015
|
}
|
1944
2016
|
});
|
1945
2017
|
|
1946
|
-
this.add(
|
2018
|
+
this.add("autoindent", "insertion", function (state, action, editor, session, text) {
|
1947
2019
|
if (text == "\n") {
|
1948
2020
|
var cursor = editor.getCursorPosition();
|
1949
2021
|
var line = session.getLine(cursor.row);
|
1950
|
-
var
|
1951
|
-
|
1952
|
-
var next_indent = this.$getIndent(line);
|
1953
|
-
var indent = next_indent + session.getTabString();
|
2022
|
+
var iterator = new TokenIterator(session, cursor.row, cursor.column);
|
2023
|
+
var token = iterator.getCurrentToken();
|
1954
2024
|
|
1955
|
-
|
1956
|
-
|
1957
|
-
|
1958
|
-
}
|
2025
|
+
if (token && token.type.indexOf("tag-close") !== -1) {
|
2026
|
+
while (token && token.type.indexOf("tag-name") === -1) {
|
2027
|
+
token = iterator.stepBackward();
|
2028
|
+
}
|
2029
|
+
|
2030
|
+
if (!token) {
|
2031
|
+
return;
|
2032
|
+
}
|
2033
|
+
|
2034
|
+
var tag = token.value;
|
2035
|
+
var row = iterator.getCurrentTokenRow();
|
2036
|
+
token = iterator.stepBackward();
|
2037
|
+
if (!token || token.type.indexOf("end-tag") !== -1) {
|
2038
|
+
return;
|
2039
|
+
}
|
2040
|
+
|
2041
|
+
if (this.voidElements && !this.voidElements[tag]) {
|
2042
|
+
var nextToken = session.getTokenAt(cursor.row, cursor.column+1);
|
2043
|
+
var line = session.getLine(row);
|
2044
|
+
var nextIndent = this.$getIndent(line);
|
2045
|
+
var indent = nextIndent + session.getTabString();
|
2046
|
+
|
2047
|
+
if (nextToken && nextToken.value === "</") {
|
2048
|
+
return {
|
2049
|
+
text: "\n" + indent + "\n" + nextIndent,
|
2050
|
+
selection: [1, indent.length, 1, indent.length]
|
2051
|
+
};
|
2052
|
+
} else {
|
2053
|
+
return {
|
2054
|
+
text: "\n" + indent
|
2055
|
+
};
|
2056
|
+
}
|
2057
|
+
}
|
1959
2058
|
}
|
1960
2059
|
}
|
1961
2060
|
});
|
1962
|
-
|
2061
|
+
|
1963
2062
|
};
|
1964
2063
|
|
1965
2064
|
oop.inherits(XmlBehaviour, Behaviour);
|
@@ -162,11 +162,11 @@ var SAFE_INSERT_BEFORE_TOKENS =
|
|
162
162
|
["text", "paren.rparen", "punctuation.operator", "comment"];
|
163
163
|
|
164
164
|
var context;
|
165
|
-
var contextCache = {}
|
165
|
+
var contextCache = {};
|
166
166
|
var initContext = function(editor) {
|
167
167
|
var id = -1;
|
168
168
|
if (editor.multiSelect) {
|
169
|
-
id = editor.selection.
|
169
|
+
id = editor.selection.index;
|
170
170
|
if (contextCache.rangeCount != editor.multiSelect.rangeCount)
|
171
171
|
contextCache = {rangeCount: editor.multiSelect.rangeCount};
|
172
172
|
}
|
@@ -5,22 +5,28 @@ var oop = require("../lib/oop");
|
|
5
5
|
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
|
6
6
|
|
7
7
|
var DocCommentHighlightRules = function() {
|
8
|
-
|
9
8
|
this.$rules = {
|
10
9
|
"start" : [ {
|
11
10
|
token : "comment.doc.tag",
|
12
11
|
regex : "@[\\w\\d_]+" // TODO: fix email addresses
|
13
|
-
},
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
12
|
+
},
|
13
|
+
DocCommentHighlightRules.getTagRule(),
|
14
|
+
{
|
15
|
+
defaultToken : "comment.doc",
|
16
|
+
caseInsensitive: true
|
18
17
|
}]
|
19
18
|
};
|
20
19
|
};
|
21
20
|
|
22
21
|
oop.inherits(DocCommentHighlightRules, TextHighlightRules);
|
23
22
|
|
23
|
+
DocCommentHighlightRules.getTagRule = function(start) {
|
24
|
+
return {
|
25
|
+
token : "comment.doc.tag.storage.type",
|
26
|
+
regex : "\\b(?:TODO|FIXME|XXX|HACK)\\b"
|
27
|
+
};
|
28
|
+
}
|
29
|
+
|
24
30
|
DocCommentHighlightRules.getStartRule = function(start) {
|
25
31
|
return {
|
26
32
|
token : "comment.doc", // doc comment
|
@@ -292,20 +298,24 @@ var JavaScriptHighlightRules = function(options) {
|
|
292
298
|
}
|
293
299
|
],
|
294
300
|
"comment_regex_allowed" : [
|
301
|
+
DocCommentHighlightRules.getTagRule(),
|
295
302
|
{token : "comment", regex : "\\*\\/", next : "start"},
|
296
|
-
{defaultToken : "comment"}
|
303
|
+
{defaultToken : "comment", caseInsensitive: true}
|
297
304
|
],
|
298
305
|
"comment" : [
|
306
|
+
DocCommentHighlightRules.getTagRule(),
|
299
307
|
{token : "comment", regex : "\\*\\/", next : "no_regex"},
|
300
|
-
{defaultToken : "comment"}
|
308
|
+
{defaultToken : "comment", caseInsensitive: true}
|
301
309
|
],
|
302
310
|
"line_comment_regex_allowed" : [
|
311
|
+
DocCommentHighlightRules.getTagRule(),
|
303
312
|
{token : "comment", regex : "$|^", next : "start"},
|
304
|
-
{defaultToken : "comment"}
|
313
|
+
{defaultToken : "comment", caseInsensitive: true}
|
305
314
|
],
|
306
315
|
"line_comment" : [
|
316
|
+
DocCommentHighlightRules.getTagRule(),
|
307
317
|
{token : "comment", regex : "$|^", next : "no_regex"},
|
308
|
-
{defaultToken : "comment"}
|
318
|
+
{defaultToken : "comment", caseInsensitive: true}
|
309
319
|
],
|
310
320
|
"qqstring" : [
|
311
321
|
{
|
@@ -1618,7 +1628,7 @@ define("ace/mode/coffee_highlight_rules",["require","exports","module","ace/lib/
|
|
1618
1628
|
}
|
1619
1629
|
if (val == "}" && stack.length) {
|
1620
1630
|
stack.shift();
|
1621
|
-
this.next = stack.shift();
|
1631
|
+
this.next = stack.shift() || "";
|
1622
1632
|
if (this.next.indexOf("string") != -1)
|
1623
1633
|
return "paren.string";
|
1624
1634
|
}
|
@@ -5,22 +5,28 @@ var oop = require("../lib/oop");
|
|
5
5
|
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
|
6
6
|
|
7
7
|
var DocCommentHighlightRules = function() {
|
8
|
-
|
9
8
|
this.$rules = {
|
10
9
|
"start" : [ {
|
11
10
|
token : "comment.doc.tag",
|
12
11
|
regex : "@[\\w\\d_]+" // TODO: fix email addresses
|
13
|
-
},
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
12
|
+
},
|
13
|
+
DocCommentHighlightRules.getTagRule(),
|
14
|
+
{
|
15
|
+
defaultToken : "comment.doc",
|
16
|
+
caseInsensitive: true
|
18
17
|
}]
|
19
18
|
};
|
20
19
|
};
|
21
20
|
|
22
21
|
oop.inherits(DocCommentHighlightRules, TextHighlightRules);
|
23
22
|
|
23
|
+
DocCommentHighlightRules.getTagRule = function(start) {
|
24
|
+
return {
|
25
|
+
token : "comment.doc.tag.storage.type",
|
26
|
+
regex : "\\b(?:TODO|FIXME|XXX|HACK)\\b"
|
27
|
+
};
|
28
|
+
}
|
29
|
+
|
24
30
|
DocCommentHighlightRules.getStartRule = function(start) {
|
25
31
|
return {
|
26
32
|
token : "comment.doc", // doc comment
|
@@ -292,20 +298,24 @@ var JavaScriptHighlightRules = function(options) {
|
|
292
298
|
}
|
293
299
|
],
|
294
300
|
"comment_regex_allowed" : [
|
301
|
+
DocCommentHighlightRules.getTagRule(),
|
295
302
|
{token : "comment", regex : "\\*\\/", next : "start"},
|
296
|
-
{defaultToken : "comment"}
|
303
|
+
{defaultToken : "comment", caseInsensitive: true}
|
297
304
|
],
|
298
305
|
"comment" : [
|
306
|
+
DocCommentHighlightRules.getTagRule(),
|
299
307
|
{token : "comment", regex : "\\*\\/", next : "no_regex"},
|
300
|
-
{defaultToken : "comment"}
|
308
|
+
{defaultToken : "comment", caseInsensitive: true}
|
301
309
|
],
|
302
310
|
"line_comment_regex_allowed" : [
|
311
|
+
DocCommentHighlightRules.getTagRule(),
|
303
312
|
{token : "comment", regex : "$|^", next : "start"},
|
304
|
-
{defaultToken : "comment"}
|
313
|
+
{defaultToken : "comment", caseInsensitive: true}
|
305
314
|
],
|
306
315
|
"line_comment" : [
|
316
|
+
DocCommentHighlightRules.getTagRule(),
|
307
317
|
{token : "comment", regex : "$|^", next : "no_regex"},
|
308
|
-
{defaultToken : "comment"}
|
318
|
+
{defaultToken : "comment", caseInsensitive: true}
|
309
319
|
],
|
310
320
|
"qqstring" : [
|
311
321
|
{
|
@@ -444,11 +454,11 @@ var SAFE_INSERT_BEFORE_TOKENS =
|
|
444
454
|
["text", "paren.rparen", "punctuation.operator", "comment"];
|
445
455
|
|
446
456
|
var context;
|
447
|
-
var contextCache = {}
|
457
|
+
var contextCache = {};
|
448
458
|
var initContext = function(editor) {
|
449
459
|
var id = -1;
|
450
460
|
if (editor.multiSelect) {
|
451
|
-
id = editor.selection.
|
461
|
+
id = editor.selection.index;
|
452
462
|
if (contextCache.rangeCount != editor.multiSelect.rangeCount)
|
453
463
|
contextCache = {rangeCount: editor.multiSelect.rangeCount};
|
454
464
|
}
|
@@ -5,22 +5,28 @@ var oop = require("../lib/oop");
|
|
5
5
|
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
|
6
6
|
|
7
7
|
var DocCommentHighlightRules = function() {
|
8
|
-
|
9
8
|
this.$rules = {
|
10
9
|
"start" : [ {
|
11
10
|
token : "comment.doc.tag",
|
12
11
|
regex : "@[\\w\\d_]+" // TODO: fix email addresses
|
13
|
-
},
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
12
|
+
},
|
13
|
+
DocCommentHighlightRules.getTagRule(),
|
14
|
+
{
|
15
|
+
defaultToken : "comment.doc",
|
16
|
+
caseInsensitive: true
|
18
17
|
}]
|
19
18
|
};
|
20
19
|
};
|
21
20
|
|
22
21
|
oop.inherits(DocCommentHighlightRules, TextHighlightRules);
|
23
22
|
|
23
|
+
DocCommentHighlightRules.getTagRule = function(start) {
|
24
|
+
return {
|
25
|
+
token : "comment.doc.tag.storage.type",
|
26
|
+
regex : "\\b(?:TODO|FIXME|XXX|HACK)\\b"
|
27
|
+
};
|
28
|
+
}
|
29
|
+
|
24
30
|
DocCommentHighlightRules.getStartRule = function(start) {
|
25
31
|
return {
|
26
32
|
token : "comment.doc", // doc comment
|
@@ -292,20 +298,24 @@ var JavaScriptHighlightRules = function(options) {
|
|
292
298
|
}
|
293
299
|
],
|
294
300
|
"comment_regex_allowed" : [
|
301
|
+
DocCommentHighlightRules.getTagRule(),
|
295
302
|
{token : "comment", regex : "\\*\\/", next : "start"},
|
296
|
-
{defaultToken : "comment"}
|
303
|
+
{defaultToken : "comment", caseInsensitive: true}
|
297
304
|
],
|
298
305
|
"comment" : [
|
306
|
+
DocCommentHighlightRules.getTagRule(),
|
299
307
|
{token : "comment", regex : "\\*\\/", next : "no_regex"},
|
300
|
-
{defaultToken : "comment"}
|
308
|
+
{defaultToken : "comment", caseInsensitive: true}
|
301
309
|
],
|
302
310
|
"line_comment_regex_allowed" : [
|
311
|
+
DocCommentHighlightRules.getTagRule(),
|
303
312
|
{token : "comment", regex : "$|^", next : "start"},
|
304
|
-
{defaultToken : "comment"}
|
313
|
+
{defaultToken : "comment", caseInsensitive: true}
|
305
314
|
],
|
306
315
|
"line_comment" : [
|
316
|
+
DocCommentHighlightRules.getTagRule(),
|
307
317
|
{token : "comment", regex : "$|^", next : "no_regex"},
|
308
|
-
{defaultToken : "comment"}
|
318
|
+
{defaultToken : "comment", caseInsensitive: true}
|
309
319
|
],
|
310
320
|
"qqstring" : [
|
311
321
|
{
|
@@ -444,11 +454,11 @@ var SAFE_INSERT_BEFORE_TOKENS =
|
|
444
454
|
["text", "paren.rparen", "punctuation.operator", "comment"];
|
445
455
|
|
446
456
|
var context;
|
447
|
-
var contextCache = {}
|
457
|
+
var contextCache = {};
|
448
458
|
var initContext = function(editor) {
|
449
459
|
var id = -1;
|
450
460
|
if (editor.multiSelect) {
|
451
|
-
id = editor.selection.
|
461
|
+
id = editor.selection.index;
|
452
462
|
if (contextCache.rangeCount != editor.multiSelect.rangeCount)
|
453
463
|
contextCache = {rangeCount: editor.multiSelect.rangeCount};
|
454
464
|
}
|