[TxMt] Extending existing grammar (css -> rcss)

Shane Liesegang shane at techie.net
Tue May 22 15:12:05 UTC 2007


I recently added support for .rcss files to my Ruby on Rails project, those
being the equivalent of .rhtml, but for stylesheets. I've been trying to make a
grammar that gives me all the nice ERB autocompletion and syntax coloring that
exists for .rhtml files, but seem to be running into issues with the scope
selectors. 

My grammar, based on th HTML (Rails) one is here: http://pastie.textmate.org/63540

Using that, I get proper syntax coloring for embedded Ruby if I use it at the
root level, but I still don't get autocomplete. And inside a CSS selector, I
can't get anything. 

The output I'm getting: http://pastie.textmate.org/63543

Is there a way to specify conditional scope within a grammar? It seems like once
it hits the CSS selector, it doesn't recognize ERB anymore. 




More information about the textmate mailing list