CodeMirror syntax validation

tried to solve using the CodeMirror or Ace editor. I tend to CodeMirror, but there is one feature of Ace that I really like, and that is how it performs parsing. As I type, a warning or error icon appears in the left area of โ€‹โ€‹the gutter next to the line number, and when I hover over it, this gives me a small description.

Is there a way to get this functionality in CodeMirror? In particular, I use css mode for CodeMirror.

It would also be nice to add your own validation.

Thanks.

+7
source share
2 answers

see http://codemirror.net/3/demo/widget.html for a nice demo.

but the ace has other nice features. The deciding factors for me were multiple cursors and indentGuides

+9
source

For Ace, adding your own validation function is pretty simple. Here's how we added CSS validation using CSSLint:

https://github.com/ajaxorg/ace/blob/master/lib/ace/mode/css_worker.js https://github.com/ajaxorg/ace/blob/master/lib/ace/mode/css.js # L78

0
source

All Articles