[TxMt] Language Definition Inheritance/Injection (Shoulda/Rails bundle)

Gabe da Silveira gabriel.d at gmail.com
Mon Apr 13 20:33:44 UTC 2009


Even though I'm #1498 I have to admit I'm quite a bundle newbie.  One
of the issues that I recently came across was that the Shoulda Bundle
was not recognizing "context" and "should" blocks within test classes.
 This is important, because the symbol navigation is extremely useful
for these.

At first I thought there was maybe a conflict or something else going
on, but when I moved these blocks into the root scope of the file they
worked.  I realized that the shoulda language was built on
source.ruby.rails, which meant it wasn't being picked up inside
source.ruby.rails.meta.rails.unit_test or
source.ruby.rails.meta.rails.functional_test.

I solved this problem by adding:

{       include = 'source.ruby.rails.shoulda'; },

to those definitions within the Rails bundle.

However I feel dirty.  First, because I'm hacking the Rails bundle to
make another bundle work.   This seems like it will make upgrading
complicated since I don't imagine there is any kind of granularity
with language updates.  Secondly, it feels wrong for the Rails bundle
to define an include of a language that is descended from the Rails
bundle itself.  Apparently TextMate handles this properly because it
works fine, but it was a red flag for me.  So I guess my question is
am I doing this wrong?  What do the bundle gurus have to say on the
matter?

-- 
Gabe da Silveira
http://darwinweb.net



More information about the textmate mailing list