diff --git a/package.json b/package.json index 233601f..dc84e73 100644 --- a/package.json +++ b/package.json @@ -84,7 +84,11 @@ { "language": "cactbot-timeline", "scopeName": "source.cactbot.timeline", - "path": "./syntaxes/timeline.tmLanguage.json" + "path": "./syntaxes/timeline.tmLanguage.json", + "embeddedLanguages": { + "source.js": "javascript", + "meta.embedded.block.javascript": "javascript" + } } ], "snippets": [ diff --git a/syntaxes/timeline.tmLanguage.yaml b/syntaxes/timeline.tmLanguage.yaml index d7a2c84..bc51f28 100644 --- a/syntaxes/timeline.tmLanguage.yaml +++ b/syntaxes/timeline.tmLanguage.yaml @@ -56,10 +56,16 @@ repository: # 0.0 "--Reset--" sync / 21:........:40000010:/ window 10000 jump 0 duration 5 # ^ ^ ^ ^ ^ ^ # #time #strings #sync / regex #window #jump #duration + # Cactbot introduce a new syntax for timeline file in + # https://github.com/quisquous/cactbot/issues/3547 + # 0.0 "--Reset--" Action { id: "123", name: "Prime Eden" } window 10000 jump 0 duration 5 + # ^ ^ ^ ^ ^ ^ + # #time #strings #netsync / net regex #window #jump #duration - include: '#number' - include: '#strings' - include: '#comma' - include: '#regex' + - include: '#netsync' regex: name: constant.regexp.timeline @@ -71,6 +77,17 @@ repository: - name: constant.character.escape.regexp.timeline match: '\\.' + netsync: + name: definition.netsync.timeline + begin: '\b(\w+)\s*(?={)' + end: '(?<=})' + beginCaptures: + '1': + name: entity.name.function.timeline + contentName: meta.embedded.block.javascript + patterns: + - include: 'source.js' + number: patterns: - match: >