【问题标题】:Syntax highlighting inside Symfony annotations in Sublime 3Sublime 3 中 Symfony 注释中的语法高亮显示
【发布时间】:2018-03-31 11:09:30
【问题描述】:

是否有任何 sublime 插件为 PHP 的 Symfony 注释添加颜色突出显示?还是很容易以其他方式添加?即使注解是写成 PHP cmets 的,那里也有一些颜色会很好。

【问题讨论】:

    标签: symfony annotations sublimetext3


    【解决方案1】:

    目前没有插件,但我找到了一个 interesting Gist,其中包含更改默认 PHP 语法突出显示以支持 Symfony、Doctrine 和 JMS 注释的说明。

    这些是您应该为 PHP 文档添加的 dict 模式:

        <dict>
            <key>match</key>
            <string>\@(Route|Template|Method|ParamConverter|Cache)\b</string>
            <key>name</key>
            <string>keyword.other.symfonyannotations.php</string>
        </dict>
        <dict>
            <key>match</key>
            <string>\@(Assert)\b</string>
            <key>name</key>
            <string>keyword.other.symfonyassertannotations.php</string>
        </dict>
        <dict>
            <key>match</key>
            <string>\@(ORM)\b</string>
            <key>name</key>
            <string>keyword.other.doctrineannotations.php</string>
        </dict>
        <dict>
            <key>match</key>
            <string>\@(Secure)\b</string>
            <key>name</key>
            <string>keyword.other.jmssecurityannotations.php</string>
        </dict>
    

    有关详细说明,请参阅 Gist ??

    (注意:我个人还没有尝试过,但对我来说看起来不错)

    【讨论】:

      猜你喜欢
      • 2016-07-26
      • 2018-08-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-11-04
      • 2016-09-29
      • 2013-12-21
      • 1970-01-01
      相关资源
      最近更新 更多