views:

125

answers:

2

I want to know if there is an api that supports nicely eRuby (erb) and JavaScript highlighting, sintax analysis and code assist.

I've already tried Eclipse with Aptana RadRails. Perhaps I'm configuring something wrong, but it guesses that I'm using html.erb on both css.erb and js.erb files. Tried in both windows and linux (Fedora 12).

I've tried too the Emacs with nXhtml, MuMaMo, js2 and Rinari modes. Again, it works fine for html.erb, but it detects the css.erb and js.erb as html.erb files. Maybe it's possible to configure it to accept that files and be compatible. Tried in both windows and linux (Fedora 12).

Also, doesn't matter the operative system, just getting the code analysis, assist and highlighting I'm happy with it.

+1  A: 

Hi Pickachu,

Normally Emacs decide what major mode (multi major with nXhtml) to use from the file extension. It can however use the whole file name path or the contents too.

If you send a bug report for nXhtml we can try to work it out.

Leo
A: 

A simple solution is to use indirect buffers : On a buffer with multiple languages, do a C-x 4 c It shows the same buffer in another window. Each window can have its own major mode. You could have one window in ruby mode, one another with java-mode for your javascript, etc. Behind all those windows is one single buffer.

For syntax analysis, you should use flymake, but it requires you to configure it properly for eRuby.

Jérôme Radix