Sublime Forum

Syntax Definition Help

#1

Ok so by the following yaml definition, shouldn’t ONLY what’s in between {blah} and {!blah} get text.html.basic syntax highlighting? And the blah tags themselves take the highlighting of a comment? Unfortunately it’s not happening that way. html highlighting is anywhere in the document, and {blah} doesn’t get comment highlighting. : (

# [PackageDev] target_format: plist, ext: tmLanguage
---
name: Test
scopeName: source.test
fileTypes: [test]
uuid: 3631aac6-ee25-4ec1-ab08-39f156235363

patterns:
- name: comment.number-sign
  begin: \{blah\}
  end: \{\!blah\}
  patterns:
  - include: text.html.basic
    match: .
...
0 Likes

#2

Remove the last match: . line. It is not supposed to be used together with an include (they are exclusive) and it appears it takes priority over the include and thus no include happens.

However, even without the change I get the text between {blah} and {!blah} marked as a comment and html tags outside of that are not highlighted (which is to be expected).
So basically with the above “fix” I get the following result:

0 Likes