Weird, it does work for me on .h files which Atom highlighted as C instead of C++. So I don’t really know what’s wrong.
I think part of the underlying problem is that ‘rb’ is in the fileTypes of both the
ruby-on-rails packages (same with ‘h’ for C and C++), so I’m not entirely sure how that is supposed to work. It doesn’t make much sense to have the extension in both languages if Atom always loads the first/last/whatever one anyway.
A package as
file-types kind of resolves that by always selecting a set grammar. But I don’t think that completely solves the issue if you are frequently switching between e.g. Ruby and Ruby on Rails projects or files.
Ideally, shouldn’t Atom (or a package, but there are such conflicts in the core language packages as well) maybe select a grammar based on the file extension and, when there are multiple possibilities defined, the contents of the file? I don’t really know how this is done in other editors/IDE’s though so maybe I’m wrong on that.