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
@@ -193,11 +193,11 @@ var SAFE_INSERT_BEFORE_TOKENS =
|
|
193
193
|
["text", "paren.rparen", "punctuation.operator", "comment"];
|
194
194
|
|
195
195
|
var context;
|
196
|
-
var contextCache = {}
|
196
|
+
var contextCache = {};
|
197
197
|
var initContext = function(editor) {
|
198
198
|
var id = -1;
|
199
199
|
if (editor.multiSelect) {
|
200
|
-
id = editor.selection.
|
200
|
+
id = editor.selection.index;
|
201
201
|
if (contextCache.rangeCount != editor.multiSelect.rangeCount)
|
202
202
|
contextCache = {rangeCount: editor.multiSelect.rangeCount};
|
203
203
|
}
|
@@ -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
|
@@ -89,11 +95,12 @@ var c_cppHighlightRules = function() {
|
|
89
95
|
|
90
96
|
var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\d\\$_\u00a1-\uffff]*\\b";
|
91
97
|
|
92
|
-
this.$rules = {
|
98
|
+
this.$rules = {
|
93
99
|
"start" : [
|
94
100
|
{
|
95
101
|
token : "comment",
|
96
|
-
regex : "
|
102
|
+
regex : "//",
|
103
|
+
next : "singleLineComment"
|
97
104
|
},
|
98
105
|
DocCommentHighlightRules.getStartRule("doc-start"),
|
99
106
|
{
|
@@ -160,14 +167,26 @@ var c_cppHighlightRules = function() {
|
|
160
167
|
regex : ".+"
|
161
168
|
}
|
162
169
|
],
|
170
|
+
"singleLineComment" : [
|
171
|
+
{
|
172
|
+
token : "comment",
|
173
|
+
regex : /\\$/,
|
174
|
+
next : "singleLineComment"
|
175
|
+
}, {
|
176
|
+
token : "comment",
|
177
|
+
regex : /$/,
|
178
|
+
next : "start"
|
179
|
+
}, {
|
180
|
+
defaultToken: "comment"
|
181
|
+
}
|
182
|
+
],
|
163
183
|
"qqstring" : [
|
164
184
|
{
|
165
185
|
token : "string",
|
166
186
|
regex : '(?:(?:\\\\.)|(?:[^"\\\\]))*?"',
|
167
187
|
next : "start"
|
168
188
|
}, {
|
169
|
-
|
170
|
-
regex : '.+'
|
189
|
+
defaultToken : "string"
|
171
190
|
}
|
172
191
|
],
|
173
192
|
"qstring" : [
|
@@ -176,8 +195,7 @@ var c_cppHighlightRules = function() {
|
|
176
195
|
regex : "(?:(?:\\\\.)|(?:[^'\\\\]))*?'",
|
177
196
|
next : "start"
|
178
197
|
}, {
|
179
|
-
|
180
|
-
regex : '.+'
|
198
|
+
defaultToken : "string"
|
181
199
|
}
|
182
200
|
],
|
183
201
|
"directive" : [
|
@@ -275,11 +293,11 @@ var SAFE_INSERT_BEFORE_TOKENS =
|
|
275
293
|
["text", "paren.rparen", "punctuation.operator", "comment"];
|
276
294
|
|
277
295
|
var context;
|
278
|
-
var contextCache = {}
|
296
|
+
var contextCache = {};
|
279
297
|
var initContext = function(editor) {
|
280
298
|
var id = -1;
|
281
299
|
if (editor.multiSelect) {
|
282
|
-
id = editor.selection.
|
300
|
+
id = editor.selection.index;
|
283
301
|
if (contextCache.rangeCount != editor.multiSelect.rangeCount)
|
284
302
|
contextCache = {rangeCount: editor.multiSelect.rangeCount};
|
285
303
|
}
|
@@ -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
|
}
|
@@ -1554,12 +1564,13 @@ oop.inherits(HtmlHighlightRules, XmlHighlightRules);
|
|
1554
1564
|
exports.HtmlHighlightRules = HtmlHighlightRules;
|
1555
1565
|
});
|
1556
1566
|
|
1557
|
-
define("ace/mode/behaviour/xml",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator"], function(require, exports, module) {
|
1567
|
+
define("ace/mode/behaviour/xml",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"], function(require, exports, module) {
|
1558
1568
|
"use strict";
|
1559
1569
|
|
1560
1570
|
var oop = require("../../lib/oop");
|
1561
1571
|
var Behaviour = require("../behaviour").Behaviour;
|
1562
1572
|
var TokenIterator = require("../../token_iterator").TokenIterator;
|
1573
|
+
var lang = require("../../lib/lang");
|
1563
1574
|
|
1564
1575
|
function is(token, type) {
|
1565
1576
|
return token.type.lastIndexOf(type + ".xml") > -1;
|
@@ -1657,29 +1668,56 @@ var XmlBehaviour = function () {
|
|
1657
1668
|
return;
|
1658
1669
|
|
1659
1670
|
return {
|
1660
|
-
text:
|
1671
|
+
text: ">" + "</" + element + ">",
|
1661
1672
|
selection: [1, 1]
|
1662
1673
|
};
|
1663
1674
|
}
|
1664
1675
|
});
|
1665
1676
|
|
1666
|
-
this.add(
|
1677
|
+
this.add("autoindent", "insertion", function (state, action, editor, session, text) {
|
1667
1678
|
if (text == "\n") {
|
1668
1679
|
var cursor = editor.getCursorPosition();
|
1669
1680
|
var line = session.getLine(cursor.row);
|
1670
|
-
var
|
1671
|
-
|
1672
|
-
var next_indent = this.$getIndent(line);
|
1673
|
-
var indent = next_indent + session.getTabString();
|
1681
|
+
var iterator = new TokenIterator(session, cursor.row, cursor.column);
|
1682
|
+
var token = iterator.getCurrentToken();
|
1674
1683
|
|
1675
|
-
|
1676
|
-
|
1677
|
-
|
1678
|
-
}
|
1684
|
+
if (token && token.type.indexOf("tag-close") !== -1) {
|
1685
|
+
while (token && token.type.indexOf("tag-name") === -1) {
|
1686
|
+
token = iterator.stepBackward();
|
1687
|
+
}
|
1688
|
+
|
1689
|
+
if (!token) {
|
1690
|
+
return;
|
1691
|
+
}
|
1692
|
+
|
1693
|
+
var tag = token.value;
|
1694
|
+
var row = iterator.getCurrentTokenRow();
|
1695
|
+
token = iterator.stepBackward();
|
1696
|
+
if (!token || token.type.indexOf("end-tag") !== -1) {
|
1697
|
+
return;
|
1698
|
+
}
|
1699
|
+
|
1700
|
+
if (this.voidElements && !this.voidElements[tag]) {
|
1701
|
+
var nextToken = session.getTokenAt(cursor.row, cursor.column+1);
|
1702
|
+
var line = session.getLine(row);
|
1703
|
+
var nextIndent = this.$getIndent(line);
|
1704
|
+
var indent = nextIndent + session.getTabString();
|
1705
|
+
|
1706
|
+
if (nextToken && nextToken.value === "</") {
|
1707
|
+
return {
|
1708
|
+
text: "\n" + indent + "\n" + nextIndent,
|
1709
|
+
selection: [1, indent.length, 1, indent.length]
|
1710
|
+
};
|
1711
|
+
} else {
|
1712
|
+
return {
|
1713
|
+
text: "\n" + indent
|
1714
|
+
};
|
1715
|
+
}
|
1716
|
+
}
|
1679
1717
|
}
|
1680
1718
|
}
|
1681
1719
|
});
|
1682
|
-
|
1720
|
+
|
1683
1721
|
};
|
1684
1722
|
|
1685
1723
|
oop.inherits(XmlBehaviour, Behaviour);
|
@@ -106,9 +106,70 @@ var RubyHighlightRules = function() {
|
|
106
106
|
regex : "[/](?:(?:\\[(?:\\\\]|[^\\]])+\\])|(?:\\\\/|[^\\]/]))*[/]\\w*\\s*(?=[).,;]|$)"
|
107
107
|
},
|
108
108
|
|
109
|
-
|
110
|
-
|
111
|
-
|
109
|
+
[{
|
110
|
+
regex: "[{}]", onMatch: function(val, state, stack) {
|
111
|
+
this.next = val == "{" ? this.nextState : "";
|
112
|
+
if (val == "{" && stack.length) {
|
113
|
+
stack.unshift("start", state);
|
114
|
+
return "paren.lparen";
|
115
|
+
}
|
116
|
+
if (val == "}" && stack.length) {
|
117
|
+
stack.shift();
|
118
|
+
this.next = stack.shift();
|
119
|
+
if (this.next.indexOf("string") != -1)
|
120
|
+
return "paren.end";
|
121
|
+
}
|
122
|
+
return val == "{" ? "paren.lparen" : "paren.rparen";
|
123
|
+
},
|
124
|
+
nextState: "start"
|
125
|
+
}, {
|
126
|
+
token : "string.start",
|
127
|
+
regex : /"/,
|
128
|
+
push : [{
|
129
|
+
token : "constant.language.escape",
|
130
|
+
regex : /\\(?:[nsrtvfbae'"\\]|c.|C-.|M-.(?:\\C-.)?|[0-7]{3}|x[\da-fA-F]{2}|u[\da-fA-F]{4})/
|
131
|
+
}, {
|
132
|
+
token : "paren.start",
|
133
|
+
regex : /\#{/,
|
134
|
+
push : "start"
|
135
|
+
}, {
|
136
|
+
token : "string.end",
|
137
|
+
regex : /"/,
|
138
|
+
next : "pop"
|
139
|
+
}, {
|
140
|
+
defaultToken: "string"
|
141
|
+
}]
|
142
|
+
}, {
|
143
|
+
token : "string.start",
|
144
|
+
regex : /`/,
|
145
|
+
push : [{
|
146
|
+
token : "constant.language.escape",
|
147
|
+
regex : /\\(?:[nsrtvfbae'"\\]|c.|C-.|M-.(?:\\C-.)?|[0-7]{3}|x[\da-fA-F]{2}|u[\da-fA-F]{4})/
|
148
|
+
}, {
|
149
|
+
token : "paren.start",
|
150
|
+
regex : /\#{/,
|
151
|
+
push : "start"
|
152
|
+
}, {
|
153
|
+
token : "string.end",
|
154
|
+
regex : /`/,
|
155
|
+
next : "pop"
|
156
|
+
}, {
|
157
|
+
defaultToken: "string"
|
158
|
+
}]
|
159
|
+
}, {
|
160
|
+
token : "string.start",
|
161
|
+
regex : /'/,
|
162
|
+
push : [{
|
163
|
+
token : "constant.language.escape",
|
164
|
+
regex : /\\['\\]/
|
165
|
+
}, {
|
166
|
+
token : "string.end",
|
167
|
+
regex : /'/,
|
168
|
+
next : "pop"
|
169
|
+
}, {
|
170
|
+
defaultToken: "string"
|
171
|
+
}]
|
172
|
+
}],
|
112
173
|
|
113
174
|
{
|
114
175
|
token : "text", // namespaces aren't symbols
|
@@ -277,11 +338,11 @@ var SAFE_INSERT_BEFORE_TOKENS =
|
|
277
338
|
["text", "paren.rparen", "punctuation.operator", "comment"];
|
278
339
|
|
279
340
|
var context;
|
280
|
-
var contextCache = {}
|
341
|
+
var contextCache = {};
|
281
342
|
var initContext = function(editor) {
|
282
343
|
var id = -1;
|
283
344
|
if (editor.multiSelect) {
|
284
|
-
id = editor.selection.
|
345
|
+
id = editor.selection.index;
|
285
346
|
if (contextCache.rangeCount != editor.multiSelect.rangeCount)
|
286
347
|
contextCache = {rangeCount: editor.multiSelect.rangeCount};
|
287
348
|
}
|
@@ -17,6 +17,35 @@ var RustHighlightRules = function() {
|
|
17
17
|
next: 'pop' },
|
18
18
|
{ include: '#rust_escaped_character' },
|
19
19
|
{ defaultToken: 'string.quoted.single.source.rust' } ] },
|
20
|
+
{
|
21
|
+
stateName: "bracketedComment",
|
22
|
+
onMatch : function(value, currentState, stack){
|
23
|
+
stack.unshift(this.next, value.length - 1, currentState);
|
24
|
+
return "string.quoted.raw.source.rust";
|
25
|
+
},
|
26
|
+
regex : /r#*"/,
|
27
|
+
next : [
|
28
|
+
{
|
29
|
+
onMatch : function(value, currentState, stack) {
|
30
|
+
var token = "string.quoted.raw.source.rust";
|
31
|
+
if (value.length >= stack[1]) {
|
32
|
+
if (value.length > stack[1])
|
33
|
+
token = "invalid";
|
34
|
+
stack.shift();
|
35
|
+
stack.shift();
|
36
|
+
this.next = stack.shift();
|
37
|
+
} else {
|
38
|
+
this.next = "";
|
39
|
+
}
|
40
|
+
return token;
|
41
|
+
},
|
42
|
+
regex : /"#*/,
|
43
|
+
next : "start"
|
44
|
+
}, {
|
45
|
+
defaultToken : "string.quoted.raw.source.rust"
|
46
|
+
}
|
47
|
+
]
|
48
|
+
},
|
20
49
|
{ token: 'string.quoted.double.source.rust',
|
21
50
|
regex: '"',
|
22
51
|
push:
|
@@ -64,10 +93,14 @@ var RustHighlightRules = function() {
|
|
64
93
|
regex: '$',
|
65
94
|
next: 'pop' },
|
66
95
|
{ defaultToken: 'comment.line.double-dash.source.rust' } ] },
|
67
|
-
{ token: 'comment.block.source.rust',
|
96
|
+
{ token: 'comment.start.block.source.rust',
|
68
97
|
regex: '/\\*',
|
98
|
+
stateName: 'comment',
|
69
99
|
push:
|
70
|
-
[ { token: 'comment.block.source.rust',
|
100
|
+
[ { token: 'comment.start.block.source.rust',
|
101
|
+
regex: '/\\*',
|
102
|
+
push: 'comment' },
|
103
|
+
{ token: 'comment.end.block.source.rust',
|
71
104
|
regex: '\\*/',
|
72
105
|
next: 'pop' },
|
73
106
|
{ defaultToken: 'comment.block.source.rust' } ] } ],
|
@@ -200,7 +233,7 @@ var Mode = function() {
|
|
200
233
|
oop.inherits(Mode, TextMode);
|
201
234
|
|
202
235
|
(function() {
|
203
|
-
this.lineCommentStart = "
|
236
|
+
this.lineCommentStart = "//";
|
204
237
|
this.blockComment = {start: "/*", end: "*/"};
|
205
238
|
this.$id = "ace/mode/rust";
|
206
239
|
}).call(Mode.prototype);
|
@@ -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
|
@@ -206,11 +212,11 @@ var SAFE_INSERT_BEFORE_TOKENS =
|
|
206
212
|
["text", "paren.rparen", "punctuation.operator", "comment"];
|
207
213
|
|
208
214
|
var context;
|
209
|
-
var contextCache = {}
|
215
|
+
var contextCache = {};
|
210
216
|
var initContext = function(editor) {
|
211
217
|
var id = -1;
|
212
218
|
if (editor.multiSelect) {
|
213
|
-
id = editor.selection.
|
219
|
+
id = editor.selection.index;
|
214
220
|
if (contextCache.rangeCount != editor.multiSelect.rangeCount)
|
215
221
|
contextCache = {rangeCount: editor.multiSelect.rangeCount};
|
216
222
|
}
|