Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/node.js/37.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Css Textmate语法突出显示,从另一种语言扩展突出显示_Css_Syntax Highlighting_Textmate_Highlighting - Fatal编程技术网

Css Textmate语法突出显示,从另一种语言扩展突出显示

Css Textmate语法突出显示,从另一种语言扩展突出显示,css,syntax-highlighting,textmate,highlighting,Css,Syntax Highlighting,Textmate,Highlighting,我试图在Textmate中扩展一些CSS高亮显示。我的方法是这样的 { .... patterns = ( { include = 'source.css'; }, { name = 'support.function'; match = '\..*\);'; }, ); } 问题是“include='source.css';”。如果我去掉那条线。我的自定义匹配器点击并应

我试图在Textmate中扩展一些CSS高亮显示。我的方法是这样的

{ 
    ....
    patterns = (
        { include = 'source.css'; },
        { 
            name = 'support.function';
            match = '\..*\);';
        },
    );
}
问题是“include='source.css';”。如果我去掉那条线。我的自定义匹配器点击并应用预期的高亮显示。但是,我失去了所有预定义的css高亮显示,我想要的


我对如何覆盖我所包含的现有css突出显示感到困惑。想法?

我也有类似的问题。我的头撞到了它上,然后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模式(我认为这就是为什么这很重要)。

完美,这正是我想要的。