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?
On 13 Apr 2009, at 22:33, Gabe da Silveira wrote:
[...] I solved this problem by adding:
{ include = 'source.ruby.rails.shoulda'; },
to those definitions within the Rails bundle.
[...] This seems like it will make upgrading complicated since I don't imagine there is any kind of granularity with language updates.
There is a some, for example editing a repository rule will create a delta with just the changes, but editing something in the root patterns array does not produce good deltas. We could restructure the Rails grammar so that it is a better fit for deltas if this edit is common.
Secondly, it feels wrong for the Rails bundle to define an include of a language that is descended from the Rails bundle itself [...]
It is not pure, no. But there is presently no way for new bundles to extend existing grammars, so for some things, users will just have to edit the grmmars.
On Thu, Apr 16, 2009 at 2:59 AM, Allan Odgaard mailinglist@textmate.org wrote:
There is a some, for example editing a repository rule will create a delta with just the changes, but editing something in the root patterns array does not produce good deltas. We could restructure the Rails grammar so that it is a better fit for deltas if this edit is common.
Good to know. Something is better than nothing.
Secondly, it feels wrong for the Rails bundle to define an include of a language that is descended from the Rails bundle itself [...]
It is not pure, no. But there is presently no way for new bundles to extend existing grammars, so for some things, users will just have to edit the grmmars.
In this case I'm getting a lot of bang for the buck so I'm not too worried about it. I also fretted over it enough that when it causes problems down the line I'll remember what I did. At least now I know there is no solution constrained to the shoulda bundle.
Thanks Allan