Komodo 7 Alpha 2: Improved Syntax Checking

The plan for rolling out Komodo 7 is to bring on a wave of new functionality with each new alpha. This time the main difference is a revamp in the way we do as-you-type syntax checking.

Revisiting syntax checking

First of all, we're no longer handing over HTML-based templates (like Django, RHTML, Mason, etc.) to HTML Tidy and hoping for the best. Komodo now splits each of these documents into separate parts, and then sends each section to the correct syntax checker. The contents of script tags are handed by a JavaScript checker, the code in style tags by a CSS checker, and everything else by the HTML checker.

Next, the system easily supports different checkers. For example, we're shipping JSLint and JSHint checkers for JavaScript. They're off by default, but you can control which ones to use on a per-document or per-project basis, following whatever makes sense. Similarly, if you've installed pylint, PyChecker, or pyflakes, you can now use them to vet your Python code.

We've found there are two other HTML libraries written as Perl modules (HTML::Tidy and HTML::Lint) that sometimes do better HTML checking than Tidy, so you now have the option of using those. If you've moved to HTML5, you can check it with Komodo's built-in html5lib instead.

Roll your own

Finally, the new syntax checking system is fully extensible. The three parts to add support for a new language are: UDL to describe the language, an XPCOM library to determine how the checking works, and a Mozilla extension to add new preference pages. If you just want to add support for a new checker for an existing language, you can do that with a simple Mozilla extension.

CoffeeScript!

Speaking of new languages, we've added support for CoffeeScript, the JavaScript preprocessor. Currently it does coloring, and supports the same kind of indentation-level-based folding that Python does. If Komodo finds a program called "coffee" on the PATH, it will do syntax-checking as well. If you're using a snazzy new template language that preprocesses CoffeeScript elements and converts them to regular JavaScript script elements for the browser, Komodo will now syntax-check that as well.

Updated Mozilla under the hood

The other main change is that this version of Komodo is now using the same version of Mozilla as Firefox 4. Startup should definitely be faster, as most components can now be loaded on demand as they're needed, as opposed to loading everything initially on startup. This also means extension writers can take advantage of new features in JavaScript 1.8.5

Additionally there have been several bug fixes since the last alpha, particularly in the new sync and collaboration modules.