Using Haml & Sass with Eclipse

Well, what about Aptana? According to the Haml/Saas Syntax Highlighting in Aptana/Eclipse blog post:

Recently, I have been using Haml in
some my Rails projects. It simply
makes your views clean and readable.
One issue I had was syntax
highlighting in my favorite IDE,
Aptana Studio. The Haml syntax
highlighting support has been stopped
a while ago and more issues have
raised after Aptana recent updates.

After some research, I found a
solution posted by Max Kostovetski, a
member of Haml Google group. Now, to
the steps:

  1. Download the following files to your hard drive:>
    • http://haml.googlegroups.com/web/haml_lexer.lxr
    • http://haml.googlegroups.com/web/haml.col
    • http://haml.googlegroups.com/web/sass_lexer.lxr
    • http://haml.googlegroups.com/web/sass.col
  2. From AptanaEclipse “Window” menu, select “Preferences…”
  3. In the the preferences window, select “Editors” > “Generic Text”
  4. Press “Add…” to add new file extensions: *.haml and *.sass
  5. For each of the new extensions, click it and press “Browse…” to
    select the proper lexer file (*.lxr)
  6. For colorization, press “Import…” to import the *.col files
  7. Press “OK”
  8. Enjoy you Haml views

PS: Refer to the original blog post as it provides up-to-date links.

Note: this can be used with the Aptana RadRails Eclipse plugin as well as Aptana Studio

UPDATE: At the time of writing, RadRails and Studio seems to support Haml and Sass so it might now be unnecessary to follow the steps above.


To compile SaaS in an “integrated” way inside Eclipse, you could maybe just use an External Tool (Run > External Tools). Another more elaborated option would be to add a “Program Builder” to your project’s Builders like in this blog post. Of course, the described solution would require to be adapted to Saas but the principles behind it seems to apply. Caution: I didn’t implement it myself, it’s just an idea and I’m not even sure it makes sense.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)