Add php worker

This commit is contained in:
DanyaPostfactum 2013-01-01 23:07:36 +10:00
commit 1c37fff927
3 changed files with 6909 additions and 0 deletions

View file

@ -37,6 +37,7 @@ var Tokenizer = require("../tokenizer").Tokenizer;
var PhpHighlightRules = require("./php_highlight_rules").PhpHighlightRules;
var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
var Range = require("../range").Range;
var WorkerClient = require("../worker/worker_client").WorkerClient;
var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
var CStyleFoldMode = require("./folding/cstyle").FoldMode;
var unicode = require("../unicode");
@ -134,6 +135,21 @@ oop.inherits(Mode, TextMode);
this.$outdent.autoOutdent(doc, row);
};
this.createWorker = function(session) {
var worker = new WorkerClient(["ace"], "ace/mode/php_worker", "PhpWorker");
worker.attachToDocument(session.getDocument());
worker.on("error", function(e) {
session.setAnnotations(e.data);
});
worker.on("ok", function() {
session.clearAnnotations();
});
return worker;
};
}).call(Mode.prototype);
exports.Mode = Mode;