我有類似的問題。我猛撞我的頭,然後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