【问题标题】:Creating a new syntax for Sublime text 3为 Sublime text 3 创建新语法
【发布时间】:2016-02-05 19:06:38
【问题描述】:

我正在尝试为Flex 创建语法突出显示。我正在使用PackageDev 和 YAML。

所以,我想找到一个以%{ 开头并以%} 结尾的块,然后我需要将此块内的所有内容突出显示为C++ 代码。

我想到了两种变体,它们都不起作用:

# ...
# first
- begin: '%\{'
  end: '%\}'
  contentName:
    patterns:
    - include: source.c++ #  that's doesn't work

# second
- match: '%\{((?:.|\n)*)%\}' # regexpr works correctly
  name: source.c++
  captures:
    '1':
      - include: source.c++ # that's doesn't work too

【问题讨论】:

    标签: yaml sublimetext3 syntax-highlighting


    【解决方案1】:

    有效:

    - name: markup.italic.lex
      begin: '%\{'
      end: '%\}'
      patterns:
      - include: source.c++
    

    手册thisthis。范围名称手册here

    【讨论】:

      猜你喜欢
      • 2016-02-29
      • 1970-01-01
      • 2014-01-30
      • 2013-08-10
      • 2013-07-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多