When coding, I prefer to have things like this:
something( "blah" );
Rather than:
something("blah");
To accomplish this, I had created a scope called "meta.parentheses" which only applied if the cursor was between empty matching parentheses. I then had a snippet, with the spacebar as the key equivalent and meta.parentheses as the scope, that would insert [space]$0[space]. This made the spacebar behave normally inside parentheses unless they were empty, which is what I wanted.
The problem: I noticed this morning that by adding the "meta.parentheses" scope to a particular Language Grammar, I wasn't getting updates for that language (my local modified copy taking precedence).
Now, I probably set this up prior to when TextMate started storing things as deltas. Is it possible that if I duplicate the change, I will still see updates to the grammar in the future with my delta applied?
Or perhaps a better question: I had added my new scope to the PHP grammar, but I'd really like the behavior in all "text" and "source" contexts. My searching of the archives led me to some discussions of applying a snippet to all scopes, but how can I add a scope to all languages (without missing out on updates)?
Thanks.
Rob
On 15/8/2006, at 21:03, Rob McBroom wrote:
[...] Or perhaps a better question: I had added my new scope to the PHP grammar, but I'd really like the behavior in all "text" and "source" contexts. My searching of the archives led me to some discussions of applying a snippet to all scopes, but how can I add a scope to all languages (without missing out on updates)?
There is currently no good way to do that.
If the language is “stand alone” (i.e. not included by a parent language) then one can often create a new language and let that new language define the additional rules and include the original grammar.
There is however a very clear need for more flexibility in this respect, and I am contemplating a system both using base grammars (shared by all languages) and the scope injection which has been mentioned a few times in the past (to inject a sub-grammar into a given scope.)
As for the delta files: these do not have the granularity of storing only changes to single rules, as that can’t be merged without potential conflicts when the default grammar is updated.