我有类似的问题。我猛撞我的头,然后TextMate IRC频道中的某个人给我直线:由于某种原因(我忘记了),您需要重新包含您的语言文法。
我的图案部分,现在看起来像
patterns = (
{ include = 'source.ruby'; },
{ include = '$self'; },
);
要更多信息添加到这个例子,这里是我的包我是创造语言语法(在我感兴趣的是该文件的一部分,一切都在范围meta.rails.model。也许你没有在你的CSS包。
patterns = (
{ name = 'meta.rails.model';
comment = "Uses lookahead to match classes that (may) inherit from ActiveRecord::Base; includes 'source.ruby' to avoid infinite recursion";
begin = '(^\s*)(?=class\s+.+ActiveRecord::Base)';
end = '^\1(?=end)\b';
patterns = (
{ include = 'source.ruby'; },
{ include = '$self'; },
);
},
{ name = 'source.ruby.rails.aasm.event';
match = '(aasm_event\W*:\w+)';
captures = { 1 = { name = 'keyword.other.context.ruby.rails.aasm.event'; }; };
},
{ include = 'source.ruby.rails'; },
);
}
但是你会发现$ self声明会将其他模式引入meta.rails.model模式(我认为这很重要)。
完美的,正是我所期待的。 – 2010-07-06 15:01:12