Hi, I think I must have done something to mess up my HTML (Rails) syntax highlighting. All my .html.erb files default to this document type, which is great, but there’s no highlighting. Perhaps my color scheme is broken? I am using the Monokai color scheme, but I tried many others as well as installing and using the Railscast color scheme to no avail.
HTML (Rails) has no syntax highlighting
I’ve noticed that Packages/Rails/HTML (Rails).tmLanguage has quite less in it than Packages/HTML/HTML.tmLanguage, so I suppose that is a start. I see some lines that look like they may load in another syntax file :
<dict>
<key>include</key>
<string>text.html.basic</string>
</dict>
Here’s a gist of my HTML (Rails).tmLanguage :https://gist.github.com/limratana/6810126
Something must be messed up with my installation. I installed a fresh copy on a virtualized windows machine (I am using OS X), and HTML (Rails) works fine. I even copied over the syntax file from that fresh installation to overwrite the copy on my OS X installation. That did not work.
Also, I have checked that syntax highlighting works on other files where the document type is set to HTML.
The last thing I tried was :
Set document type to “Javascript (Rails)”
This works, so I copy the contents of Javascript (Rails).tmLanguage file into the HTML (Rails).tmLanguage, except I change the file types to match the html.erb extension, I make sure “text.html.basic” is included at the end of the includes, and set the “scopeName” section at the end to the HTML (Rails) version. This doesn’t work. It’s almost like there is something overriding the HTML (Rails) type. Perhaps if I create a completely new type it will work.
This last thing worked. I created a new file “HTML2 (Rails).tmLanguage” and if I select it, it works. Very odd.
Ok. Something fixed it. When I restarted Sublime, it now works. Unfortunately I’m not sure what did it.
For me, removing the Homebrew-formula-syntax package and then restarting fixed it.