more ruby support
This commit is contained in:
parent
700fcb7e63
commit
a642d98912
2 changed files with 1 additions and 42 deletions
|
|
@ -67,7 +67,7 @@ JavaScriptHighlightRules = function() {
|
|||
"start" : [
|
||||
{
|
||||
token : "comment",
|
||||
regex : "\\/\\/.*$"
|
||||
regex : "/#.*$/"
|
||||
},
|
||||
docComment.getStartRule("doc-start"),
|
||||
{
|
||||
|
|
|
|||
|
|
@ -122,47 +122,6 @@ oop.inherits(Mode, TextMode);
|
|||
this.autoOutdent = function(state, doc, row) {
|
||||
return this.$outdent.autoOutdent(doc, row);
|
||||
};
|
||||
|
||||
this.createWorker = function(session) {
|
||||
var doc = session.getDocument();
|
||||
var worker = new WorkerClient("../..", ["ace", "pilot"], "ace/mode/javascript_worker", "JavaScriptWorker");
|
||||
worker.call("setValue", [doc.getValue()]);
|
||||
|
||||
doc.on("change", function(e) {
|
||||
e.range = {
|
||||
start: e.data.range.start,
|
||||
end: e.data.range.end
|
||||
};
|
||||
worker.emit("change", e);
|
||||
});
|
||||
|
||||
worker.on("jslint", function(results) {
|
||||
var errors = [];
|
||||
for (var i=0; i<results.data.length; i++) {
|
||||
var error = results.data[i];
|
||||
if (error)
|
||||
errors.push({
|
||||
row: error.line-1,
|
||||
column: error.character-1,
|
||||
text: error.reason,
|
||||
type: "warning",
|
||||
lint: error
|
||||
})
|
||||
}
|
||||
|
||||
session.setAnnotations(errors)
|
||||
});
|
||||
|
||||
worker.on("narcissus", function(e) {
|
||||
session.setAnnotations([e.data]);
|
||||
});
|
||||
|
||||
worker.on("terminate", function() {
|
||||
session.clearAnnotations();
|
||||
});
|
||||
|
||||
return worker;
|
||||
};
|
||||
|
||||
}).call(Mode.prototype);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue