marijnh/CodeMirror — pull request #1272 by angelozerr (2013-02-21 11:05:55+00:00)
Title: Manage async lint

Here a patch to manage async lint. I'm using this feature with a XQuery Editor which calls with JQuery Ajax (see remoting-lint.js) a server which parse the xquery with the XML Database Java clases on server side.

* lint.js : modify the lint to manage async
* remoting-lint.js use jQuery Ajax and calll the lint when server returns array of annotations. This lint is generic and could be used with any mode (Velocity, etc ).
* meta.js : ignore that, I don't know why it is in this pulling request.

Here how to use remoting-lint.js You must just set the url which validate the content of the editor on server side :

--------------------------
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
gutters: ["CodeMirror-linenumbers", "CodeMirror-lint-markers"],
lintWith : {
"getAnnotations" : CodeMirror.remotingValidator,
"async" : true,
"url" : "../xquerydebugger"
}
});
--------------------------

Hope you will like it.