From 86b96565f5365cd1d673adaae314190e6252705c Mon Sep 17 00:00:00 2001 From: Dustin Wilson Date: Thu, 17 Jun 2021 22:53:47 -0500 Subject: [PATCH] Added more language grammars --- data/source.applescript.json | 1384 ++++++++ data/source.c.json | 1955 +++++++++++ data/source.coffee.json | 1319 +++++++ data/source.cpp.json | 461 +++ data/source.graphql.json | 599 ++++ data/source.java-properties.json | 85 + data/source.java.el.json | 100 + data/source.java.json | 1853 ++++++++++ data/source.json.json | 182 + data/source.litcoffee.json | 668 ++++ data/source.lua.json | 145 + data/source.python.json | 2805 +++++++++++++++ data/source.regexp.python.json | 178 + data/source.ruby.gemfile.json | 27 + data/source.ruby.json | 2829 +++++++++++++++ data/source.ts.json | 5408 ++++++++++++++++++++++++++++ data/source.tsx.json | 5661 ++++++++++++++++++++++++++++++ data/text.html.erb.json | 154 + data/text.html.jsp.json | 1202 +++++++ data/text.html.smarty.json | 201 ++ data/text.html.textile.json | 271 ++ data/text.junit-test-report.json | 90 + data/text.md.json | 4313 +++++++++++++++++++++++ data/text.python.console.json | 25 + data/text.python.traceback.json | 46 + run | 58 +- 26 files changed, 32000 insertions(+), 19 deletions(-) create mode 100644 data/source.applescript.json create mode 100644 data/source.c.json create mode 100644 data/source.coffee.json create mode 100644 data/source.cpp.json create mode 100644 data/source.graphql.json create mode 100644 data/source.java-properties.json create mode 100644 data/source.java.el.json create mode 100644 data/source.java.json create mode 100644 data/source.json.json create mode 100644 data/source.litcoffee.json create mode 100644 data/source.lua.json create mode 100644 data/source.python.json create mode 100644 data/source.regexp.python.json create mode 100644 data/source.ruby.gemfile.json create mode 100644 data/source.ruby.json create mode 100644 data/source.ts.json create mode 100644 data/source.tsx.json create mode 100644 data/text.html.erb.json create mode 100644 data/text.html.jsp.json create mode 100644 data/text.html.smarty.json create mode 100644 data/text.html.textile.json create mode 100644 data/text.junit-test-report.json create mode 100644 data/text.md.json create mode 100644 data/text.python.console.json create mode 100644 data/text.python.traceback.json diff --git a/data/source.applescript.json b/data/source.applescript.json new file mode 100644 index 0000000..a4d5557 --- /dev/null +++ b/data/source.applescript.json @@ -0,0 +1,1384 @@ +{ + "fileTypes": [ + "applescript", + "script editor", + "scpt" + ], + "firstLineMatch": "^#!.*osascript(?!.*JavaScript)|^FasdUAS", + "name": "AppleScript", + "patterns": [ + { + "include": "#blocks" + }, + { + "include": "#inline" + } + ], + "repository": { + "attributes.considering-ignoring": { + "patterns": [ + { + "match": ",", + "name": "punctuation.separator.array.attributes.applescript" + }, + { + "match": "\\b(and)\\b", + "name": "keyword.control.attributes.and.applescript" + }, + { + "match": "\\b(?i:case|diacriticals|hyphens|numeric\\s+strings|punctuation|white\\s+space)\\b", + "name": "constant.other.attributes.text.applescript" + }, + { + "match": "\\b(?i:application\\s+responses)\\b", + "name": "constant.other.attributes.application.applescript" + } + ] + }, + "blocks": { + "patterns": [ + { + "begin": "^\\s*(script)\\s+(\\w+)", + "beginCaptures": { + "1": { + "name": "keyword.control.script.applescript" + }, + "2": { + "name": "entity.name.type.script-object.applescript" + } + }, + "end": "^\\s*(end(?:\\s+script)?)(?=\\s*(--.*?)?$)", + "endCaptures": { + "1": { + "name": "keyword.control.script.applescript" + } + }, + "name": "meta.block.script.applescript", + "patterns": [ + { + "include": "$self" + } + ] + }, + { + "begin": "^(?x)\n\t\t\t\t\t\t\\s*(to|on)\\s+ \t\t\t\t\t# \"on\" or \"to\"\n\t\t\t\t\t\t(\\w+)\t\t\t\t\t\t\t# function name\n\t\t\t\t\t\t(\\()\t\t\t\t\t\t\t# opening paren\n\t\t\t\t\t\t\t((?:[\\s,:\\{\\}]*(?:\\w+)?)*)\t# parameters\n\t\t\t\t\t\t(\\))\t\t\t\t\t\t\t# closing paren\n\t\t\t\t\t", + "beginCaptures": { + "1": { + "name": "keyword.control.function.applescript" + }, + "2": { + "name": "entity.name.function.handler.applescript" + }, + "3": { + "name": "punctuation.definition.parameters.begin.applescript" + }, + "4": { + "name": "variable.parameter.handler.applescript" + }, + "5": { + "name": "punctuation.definition.parameters.end.applescript" + } + }, + "comment": "\n\t\t\t\t\t\tThis is not a very well-designed rule. For now,\n\t\t\t\t\t\twe can leave it like this though, as it sorta works.\n\t\t\t\t\t", + "end": "^\\s*(end)(?:\\s+(\\2))?(?=\\s*(--.*?)?$)", + "endCaptures": { + "1": { + "name": "keyword.control.function.applescript" + } + }, + "name": "meta.function.positional.applescript", + "patterns": [ + { + "include": "$self" + } + ] + }, + { + "begin": "^(?x)\n\t\t\t\t\t\t\\s*(to|on)\\s+ \t\t\t\t\t# \"on\" or \"to\"\n\t\t\t\t\t\t(\\w+)\t\t\t\t\t\t\t# function name\n\t\t\t\t\t\t(?:\\s+\n\t\t\t\t\t\t\t(of|in)\\s+\t\t\t\t\t# \"of\" or \"in\"\n\t\t\t\t\t\t\t(\\w+)\t\t\t\t\t\t# direct parameter\n\t\t\t\t\t\t)?\n\t\t\t\t\t\t(?=\\s+(above|against|apart\\s+from|around|aside\\s+from|at|below|beneath|beside|between|by|for|from|instead\\s+of|into|on|onto|out\\s+of|over|thru|under)\\b)\n\t\t\t\t\t", + "beginCaptures": { + "1": { + "name": "keyword.control.function.applescript" + }, + "2": { + "name": "entity.name.function.handler.applescript" + }, + "3": { + "name": "keyword.control.function.applescript" + }, + "4": { + "name": "variable.parameter.handler.direct.applescript" + } + }, + "comment": "TODO: match `given` parameters", + "end": "^\\s*(end)(?:\\s+(\\2))?(?=\\s*(--.*?)?$)", + "endCaptures": { + "1": { + "name": "keyword.control.function.applescript" + } + }, + "name": "meta.function.prepositional.applescript", + "patterns": [ + { + "captures": { + "1": { + "name": "keyword.control.preposition.applescript" + }, + "2": { + "name": "variable.parameter.handler.applescript" + } + }, + "match": "\\b(?i:above|against|apart\\s+from|around|aside\\s+from|at|below|beneath|beside|between|by|for|from|instead\\s+of|into|on|onto|out\\s+of|over|thru|under)\\s+(\\w+)\\b" + }, + { + "include": "$self" + } + ] + }, + { + "begin": "^(?x)\n\t\t\t\t\t\t\\s*(to|on)\\s+ \t\t\t\t\t# \"on\" or \"to\"\n\t\t\t\t\t\t(\\w+)\t\t\t\t\t\t\t# function name\n\t\t\t\t\t\t(?=\\s*(--.*?)?$)\t\t\t\t# nothing else\n\t\t\t\t\t", + "beginCaptures": { + "1": { + "name": "keyword.control.function.applescript" + }, + "2": { + "name": "entity.name.function.handler.applescript" + } + }, + "end": "^\\s*(end)(?:\\s+(\\2))?(?=\\s*(--.*?)?$)", + "endCaptures": { + "1": { + "name": "keyword.control.function.applescript" + } + }, + "name": "meta.function.parameterless.applescript", + "patterns": [ + { + "include": "$self" + } + ] + }, + { + "include": "#blocks.tell" + }, + { + "include": "#blocks.repeat" + }, + { + "include": "#blocks.statement" + }, + { + "include": "#blocks.other" + } + ] + }, + "blocks.other": { + "patterns": [ + { + "begin": "^\\s*(considering)\\b", + "end": "^\\s*(end(?:\\s+considering)?)(?=\\s*(--.*?)?$)", + "name": "meta.block.considering.applescript", + "patterns": [ + { + "begin": "(?<=considering)", + "end": "(?|<|≥|>=|≤|<=)", + "name": "keyword.operator.comparison.applescript" + }, + { + "match": "(?ix)\\b\n\t\t\t\t\t\t(and|or|div|mod|as|not\n\t\t\t\t\t\t|(a\\s+)?(ref(\\s+to)?|reference\\s+to)\n\t\t\t\t\t\t|equal(s|\\s+to)|contains?|comes\\s+(after|before)|(start|begin|end)s?\\s+with\n\t\t\t\t\t\t)\n\t\t\t\t\t\\b", + "name": "keyword.operator.word.applescript" + }, + { + "comment": "In double quotes so we can use a single quote in the keywords.", + "match": "(?ix)\\b\n\t\t\t\t\t\t(is(n't|\\s+not)?(\\s+(equal(\\s+to)?|(less|greater)\\s+than(\\s+or\\s+equal(\\s+to)?)?|in|contained\\s+by))?\n\t\t\t\t\t\t|does(n't|\\s+not)\\s+(equal|come\\s+(before|after)|contain)\n\t\t\t\t\t\t)\n\t\t\t\t\t\\b", + "name": "keyword.operator.word.applescript" + }, + { + "match": "\\b(?i:some|every|whose|where|that|id|index|\\d+(st|nd|rd|th)|first|second|third|fourth|fifth|sixth|seventh|eighth|ninth|tenth|last|front|back|middle|named|beginning|end|from|to|thr(u|ough)|before|(front|back|beginning|end)\\s+of|after|behind|in\\s+(front|back|beginning|end)\\s+of)\\b", + "name": "keyword.operator.reference.applescript" + }, + { + "match": "\\b(?i:continue|return|exit(\\s+repeat)?)\\b", + "name": "keyword.control.loop.applescript" + }, + { + "match": "\\b(?i:about|above|after|against|and|apart\\s+from|around|as|aside\\s+from|at|back|before|beginning|behind|below|beneath|beside|between|but|by|considering|contain|contains|contains|copy|div|does|eighth|else|end|equal|equals|error|every|false|fifth|first|for|fourth|from|front|get|given|global|if|ignoring|in|instead\\s+of|into|is|it|its|last|local|me|middle|mod|my|ninth|not|of|on|onto|or|out\\s+of|over|prop|property|put|ref|reference|repeat|returning|script|second|set|seventh|since|sixth|some|tell|tenth|that|the|then|third|through|thru|timeout|times|to|transaction|true|try|until|where|while|whose|with|without)\\b", + "name": "keyword.other.applescript" + } + ] + }, + "built-in.punctuation": { + "patterns": [ + { + "match": "¬", + "name": "punctuation.separator.continuation.line.applescript" + }, + { + "comment": "the : in property assignments", + "match": ":", + "name": "punctuation.separator.key-value.property.applescript" + }, + { + "comment": "the parentheses in groups", + "match": "[()]", + "name": "punctuation.section.group.applescript" + } + ] + }, + "built-in.support": { + "patterns": [ + { + "match": "\\b(?i:POSIX\\s+path|frontmost|id|name|running|version|days?|weekdays?|months?|years?|time|date\\s+string|time\\s+string|length|rest|reverse|items?|contents|quoted\\s+form|characters?|paragraphs?|words?)\\b", + "name": "support.function.built-in.property.applescript" + }, + { + "match": "\\b(?i:activate|log|clipboard\\s+info|set\\s+the\\s+clipboard\\s+to|the\\s+clipboard|info\\s+for|list\\s+(disks|folder)|mount\\s+volume|path\\s+to(\\s+resource)?|close\\s+access|get\\s+eof|open\\s+for\\s+access|read|set\\s+eof|write|open\\s+location|current\\s+date|do\\s+shell\\s+script|get\\s+volume\\s+settings|random\\s+number|round|set\\s+volume|system\\s+(attribute|info)|time\\s+to\\s+GMT|load\\s+script|run\\s+script|scripting\\s+components|store\\s+script|copy|count|get|launch|run|set|ASCII\\s+(character|number)|localized\\s+string|offset|summarize|beep|choose\\s+(application|color|file(\\s+name)?|folder|from\\s+list|remote\\s+application|URL)|delay|display\\s+(alert|dialog)|say)\\b", + "name": "support.function.built-in.command.applescript" + }, + { + "match": "\\b(?i:get|run)\\b", + "name": "support.function.built-in.applescript" + }, + { + "match": "\\b(?i:anything|data|text|upper\\s+case|propert(y|ies))\\b", + "name": "support.class.built-in.applescript" + }, + { + "match": "\\b(?i:alias|class)(es)?\\b", + "name": "support.class.built-in.applescript" + }, + { + "match": "\\b(?i:app(lication)?|boolean|character|constant|date|event|file(\\s+specification)?|handler|integer|item|keystroke|linked\\s+list|list|machine|number|picture|preposition|POSIX\\s+file|real|record|reference(\\s+form)?|RGB\\s+color|script|sound|text\\s+item|type\\s+class|vector|writing\\s+code(\\s+info)?|zone|((international|styled(\\s+(Clipboard|Unicode))?|Unicode)\\s+)?text|((C|encoded|Pascal)\\s+)?string)s?\\b", + "name": "support.class.built-in.applescript" + }, + { + "match": "(?ix)\\b\n\t\t\t\t\t\t(\t(cubic\\s+(centi)?|square\\s+(kilo)?|centi|kilo)met(er|re)s\n\t\t\t\t\t\t|\tsquare\\s+(yards|feet|miles)|cubic\\s+(yards|feet|inches)|miles|inches\n\t\t\t\t\t\t|\tlit(re|er)s|gallons|quarts\n\t\t\t\t\t\t|\t(kilo)?grams|ounces|pounds\n\t\t\t\t\t\t|\tdegrees\\s+(Celsius|Fahrenheit|Kelvin)\n\t\t\t\t\t\t)\n\t\t\t\t\t\\b", + "name": "support.class.built-in.unit.applescript" + }, + { + "match": "\\b(?i:seconds|minutes|hours|days)\\b", + "name": "support.class.built-in.time.applescript" + } + ] + }, + "comments": { + "patterns": [ + { + "begin": "^\\s*(#!)", + "captures": { + "1": { + "name": "punctuation.definition.comment.applescript" + } + }, + "end": "\\n", + "name": "comment.line.number-sign.applescript" + }, + { + "begin": "(^[ \\t]+)?(?=--)", + "beginCaptures": { + "1": { + "name": "punctuation.whitespace.comment.leading.applescript" + } + }, + "end": "(?!\\G)", + "patterns": [ + { + "begin": "--", + "beginCaptures": { + "0": { + "name": "punctuation.definition.comment.applescript" + } + }, + "end": "\\n", + "name": "comment.line.double-dash.applescript" + } + ] + }, + { + "begin": "\\(\\*", + "captures": { + "0": { + "name": "punctuation.definition.comment.applescript" + } + }, + "end": "\\*\\)", + "name": "comment.block.applescript", + "patterns": [ + { + "include": "#comments.nested" + } + ] + } + ] + }, + "comments.nested": { + "patterns": [ + { + "begin": "\\(\\*", + "beginCaptures": { + "0": { + "name": "punctuation.definition.comment.begin.applescript" + } + }, + "end": "\\*\\)", + "endCaptures": { + "0": { + "name": "punctuation.definition.comment.end.applescript" + } + }, + "name": "comment.block.applescript", + "patterns": [ + { + "include": "#comments.nested" + } + ] + } + ] + }, + "data-structures": { + "patterns": [ + { + "begin": "\\{", + "beginCaptures": { + "0": { + "name": "punctuation.definition.array.begin.applescript" + } + }, + "comment": "We cannot necessarily distinguish \"records\" from \"arrays\", and so this could be either.", + "end": "\\}", + "endCaptures": { + "0": { + "name": "punctuation.definition.array.end.applescript" + } + }, + "name": "meta.array.applescript", + "patterns": [ + { + "captures": { + "1": { + "name": "constant.other.key.applescript" + }, + "2": { + "name": "meta.identifier.applescript" + }, + "3": { + "name": "punctuation.definition.identifier.applescript" + }, + "4": { + "name": "punctuation.definition.identifier.applescript" + }, + "5": { + "name": "punctuation.separator.key-value.applescript" + } + }, + "match": "(\\w+|((\\|)[^|\\n]*(\\|)))\\s*(:)" + }, + { + "match": ":", + "name": "punctuation.separator.key-value.applescript" + }, + { + "match": ",", + "name": "punctuation.separator.array.applescript" + }, + { + "include": "#inline" + } + ] + }, + { + "begin": "(?:(?<=application )|(?<=app ))(\")", + "captures": { + "1": { + "name": "punctuation.definition.string.applescript" + } + }, + "end": "(\")", + "name": "string.quoted.double.application-name.applescript", + "patterns": [ + { + "match": "\\\\.", + "name": "constant.character.escape.applescript" + } + ] + }, + { + "begin": "(\")", + "captures": { + "1": { + "name": "punctuation.definition.string.applescript" + } + }, + "end": "(\")", + "name": "string.quoted.double.applescript", + "patterns": [ + { + "match": "\\\\.", + "name": "constant.character.escape.applescript" + } + ] + }, + { + "captures": { + "1": { + "name": "punctuation.definition.identifier.applescript" + }, + "2": { + "name": "punctuation.definition.identifier.applescript" + } + }, + "match": "(\\|)[^|\\n]*(\\|)", + "name": "meta.identifier.applescript" + }, + { + "captures": { + "1": { + "name": "punctuation.definition.data.applescript" + }, + "2": { + "name": "support.class.built-in.applescript" + }, + "3": { + "name": "storage.type.utxt.applescript" + }, + "4": { + "name": "string.unquoted.data.applescript" + }, + "5": { + "name": "punctuation.definition.data.applescript" + }, + "6": { + "name": "keyword.operator.applescript" + }, + "7": { + "name": "support.class.built-in.applescript" + } + }, + "match": "(«)(data) (utxt|utf8)([[:xdigit:]]*)(»)(?:\\s+(as)\\s+(?i:Unicode\\s+text))?", + "name": "constant.other.data.utxt.applescript" + }, + { + "begin": "(«)(\\w+)\\b(?=\\s)", + "beginCaptures": { + "1": { + "name": "punctuation.definition.data.applescript" + }, + "2": { + "name": "support.class.built-in.applescript" + } + }, + "end": "(»)", + "endCaptures": { + "1": { + "name": "punctuation.definition.data.applescript" + } + }, + "name": "constant.other.data.raw.applescript" + }, + { + "captures": { + "1": { + "name": "punctuation.definition.data.applescript" + }, + "2": { + "name": "punctuation.definition.data.applescript" + } + }, + "match": "(«)[^»]*(»)", + "name": "invalid.illegal.data.applescript" + } + ] + }, + "finder": { + "patterns": [ + { + "match": "\\b(item|container|(computer|disk|trash)-object|disk|folder|((alias|application|document|internet location) )?file|clipping|package)s?\\b", + "name": "support.class.finder.items.applescript" + }, + { + "match": "\\b((Finder|desktop|information|preferences|clipping) )windows?\\b", + "name": "support.class.finder.window-classes.applescript" + }, + { + "match": "\\b(preferences|(icon|column|list) view options|(label|column|alias list)s?)\\b", + "name": "support.class.finder.type-definitions.applescript" + }, + { + "match": "\\b(copy|find|sort|clean up|eject|empty( trash)|erase|reveal|update)\\b", + "name": "support.function.finder.items.applescript" + }, + { + "match": "\\b(insertion location|product version|startup disk|desktop|trash|home|computer container|finder preferences)\\b", + "name": "support.constant.finder.applescript" + }, + { + "match": "\\b(visible)\\b", + "name": "support.variable.finder.applescript" + } + ] + }, + "inline": { + "patterns": [ + { + "include": "#comments" + }, + { + "include": "#data-structures" + }, + { + "include": "#built-in" + }, + { + "include": "#standardadditions" + } + ] + }, + "itunes": { + "patterns": [ + { + "match": "\\b(artwork|application|encoder|EQ preset|item|source|visual|(EQ |browser )?window|((audio CD|device|shared|URL|file) )?track|playlist window|((audio CD|device|radio tuner|library|folder|user) )?playlist)s?\\b", + "name": "support.class.itunes.applescript" + }, + { + "match": "\\b(add|back track|convert|fast forward|(next|previous) track|pause|play(pause)?|refresh|resume|rewind|search|stop|update|eject|subscribe|update(Podcast|AllPodcasts)|download)\\b", + "name": "support.function.itunes.applescript" + }, + { + "match": "\\b(current (playlist|stream (title|URL)|track)|player state)\\b", + "name": "support.constant.itunes.applescript" + }, + { + "match": "\\b(current (encoder|EQ preset|visual)|EQ enabled|fixed indexing|full screen|mute|player position|sound volume|visuals enabled|visual size)\\b", + "name": "support.variable.itunes.applescript" + } + ] + }, + "standard-suite": { + "patterns": [ + { + "match": "\\b(colors?|documents?|items?|windows?)\\b", + "name": "support.class.standard-suite.applescript" + }, + { + "match": "\\b(close|count|delete|duplicate|exists|make|move|open|print|quit|save|activate|select|data size)\\b", + "name": "support.function.standard-suite.applescript" + }, + { + "match": "\\b(name|frontmost|version)\\b", + "name": "support.constant.standard-suite.applescript" + }, + { + "match": "\\b(selection)\\b", + "name": "support.variable.standard-suite.applescript" + }, + { + "match": "\\b(attachments?|attribute runs?|characters?|paragraphs?|texts?|words?)\\b", + "name": "support.class.text-suite.applescript" + } + ] + }, + "standardadditions": { + "patterns": [ + { + "match": "\\b((alert|dialog) reply)\\b", + "name": "support.class.standardadditions.user-interaction.applescript" + }, + { + "match": "\\b(file information)\\b", + "name": "support.class.standardadditions.file.applescript" + }, + { + "match": "\\b(POSIX files?|system information|volume settings)\\b", + "name": "support.class.standardadditions.miscellaneous.applescript" + }, + { + "match": "\\b(URLs?|internet address(es)?|web pages?|FTP items?)\\b", + "name": "support.class.standardadditions.internet.applescript" + }, + { + "match": "\\b(info for|list (disks|folder)|mount volume|path to( resource)?)\\b", + "name": "support.function.standardadditions.file.applescript" + }, + { + "match": "\\b(beep|choose (application|color|file( name)?|folder|from list|remote application|URL)|delay|display (alert|dialog)|say)\\b", + "name": "support.function.standardadditions.user-interaction.applescript" + }, + { + "match": "\\b(ASCII (character|number)|localized string|offset|summarize)\\b", + "name": "support.function.standardadditions.string.applescript" + }, + { + "match": "\\b(set the clipboard to|the clipboard|clipboard info)\\b", + "name": "support.function.standardadditions.clipboard.applescript" + }, + { + "match": "\\b(open for access|close access|read|write|get eof|set eof)\\b", + "name": "support.function.standardadditions.file-i-o.applescript" + }, + { + "match": "\\b((load|store|run) script|scripting components)\\b", + "name": "support.function.standardadditions.scripting.applescript" + }, + { + "match": "\\b(current date|do shell script|get volume settings|random number|round|set volume|system attribute|system info|time to GMT)\\b", + "name": "support.function.standardadditions.miscellaneous.applescript" + }, + { + "match": "\\b(opening folder|(closing|moving) folder window for|adding folder items to|removing folder items from)\\b", + "name": "support.function.standardadditions.folder-actions.applescript" + }, + { + "match": "\\b(open location|handle CGI request)\\b", + "name": "support.function.standardadditions.internet.applescript" + } + ] + }, + "system-events": { + "patterns": [ + { + "match": "\\b(audio (data|file))\\b", + "name": "support.class.system-events.audio-file.applescript" + }, + { + "match": "\\b(alias(es)?|(Classic|local|network|system|user) domain objects?|disk( item)?s?|domains?|file( package)?s?|folders?|items?)\\b", + "name": "support.class.system-events.disk-folder-file.applescript" + }, + { + "match": "\\b(delete|open|move)\\b", + "name": "support.function.system-events.disk-folder-file.applescript" + }, + { + "match": "\\b(folder actions?|scripts?)\\b", + "name": "support.class.system-events.folder-actions.applescript" + }, + { + "match": "\\b(attach action to|attached scripts|edit action of|remove action from)\\b", + "name": "support.function.system-events.folder-actions.applescript" + }, + { + "match": "\\b(movie data|movie file)\\b", + "name": "support.class.system-events.movie-file.applescript" + }, + { + "match": "\\b(log out|restart|shut down|sleep)\\b", + "name": "support.function.system-events.power.applescript" + }, + { + "match": "\\b(((application |desk accessory )?process|(check|combo )?box)(es)?|(action|attribute|browser|(busy|progress|relevance) indicator|color well|column|drawer|group|grow area|image|incrementor|list|menu( bar)?( item)?|(menu |pop up |radio )?button|outline|(radio|tab|splitter) group|row|scroll (area|bar)|sheet|slider|splitter|static text|table|text (area|field)|tool bar|UI element|window)s?)\\b", + "name": "support.class.system-events.processes.applescript" + }, + { + "match": "\\b(click|key code|keystroke|perform|select)\\b", + "name": "support.function.system-events.processes.applescript" + }, + { + "match": "\\b(property list (file|item))\\b", + "name": "support.class.system-events.property-list.applescript" + }, + { + "match": "\\b(annotation|QuickTime (data|file)|track)s?\\b", + "name": "support.class.system-events.quicktime-file.applescript" + }, + { + "match": "\\b((abort|begin|end) transaction)\\b", + "name": "support.function.system-events.system-events.applescript" + }, + { + "match": "\\b(XML (attribute|data|element|file)s?)\\b", + "name": "support.class.system-events.xml.applescript" + }, + { + "match": "\\b(print settings|users?|login items?)\\b", + "name": "support.class.sytem-events.other.applescript" + } + ] + }, + "textmate": { + "patterns": [ + { + "match": "\\b(print settings)\\b", + "name": "support.class.textmate.applescript" + }, + { + "match": "\\b(get url|insert|reload bundles)\\b", + "name": "support.function.textmate.applescript" + } + ] + } + }, + "scopeName": "source.applescript" +} diff --git a/data/source.c.json b/data/source.c.json new file mode 100644 index 0000000..1a4d941 --- /dev/null +++ b/data/source.c.json @@ -0,0 +1,1955 @@ +{ + "scopeName": "source.c", + "fileTypes": [ + "c", + "h.in", + "xpm" + ], + "firstLineMatch": "(?i)-\\*-[^*]*(Mode:\\s*)?C(\\s*;.*?)?\\s*-\\*-", + "name": "C", + "patterns": [ + { + "include": "#preprocessor-rule-enabled" + }, + { + "include": "#preprocessor-rule-disabled" + }, + { + "include": "#preprocessor-rule-conditional" + }, + { + "include": "#comments" + }, + { + "match": "\\b(break|case|continue|default|do|else|for|goto|if|_Pragma|return|switch|while)\\b", + "name": "keyword.control.c" + }, + { + "include": "#storage_types" + }, + { + "match": "\\b(const|extern|register|restrict|static|volatile|inline)\\b", + "name": "storage.modifier.c" + }, + { + "match": "\\bk[A-Z]\\w*\\b", + "name": "constant.other.variable.mac-classic.c" + }, + { + "match": "\\bg[A-Z]\\w*\\b", + "name": "variable.other.readwrite.global.mac-classic.c" + }, + { + "match": "\\bs[A-Z]\\w*\\b", + "name": "variable.other.readwrite.static.mac-classic.c" + }, + { + "match": "\\b(NULL|true|false|TRUE|FALSE)\\b", + "name": "constant.language.c" + }, + { + "include": "#operators" + }, + { + "include": "#numbers" + }, + { + "include": "#strings" + }, + { + "begin": "(?x)\n^\\s* ((\\#)\\s*define) \\s+ # define\n((?[a-zA-Z_$][\\w$]*)) # macro name\n(?:\n (\\()\n (\n \\s* \\g \\s* # first argument\n ((,) \\s* \\g \\s*)* # additional arguments\n (?:\\.\\.\\.)? # varargs ellipsis?\n )\n (\\))\n)?", + "beginCaptures": { + "1": { + "name": "keyword.control.directive.define.c" + }, + "2": { + "name": "punctuation.definition.directive.c" + }, + "3": { + "name": "entity.name.function.preprocessor.c" + }, + "5": { + "name": "punctuation.definition.parameters.begin.c" + }, + "6": { + "name": "variable.parameter.preprocessor.c" + }, + "8": { + "name": "punctuation.separator.parameters.c" + }, + "9": { + "name": "punctuation.definition.parameters.end.c" + } + }, + "end": "(?=(?://|/\\*))|(?", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.c" + } + }, + "name": "string.quoted.other.lt-gt.include.c" + } + ] + }, + { + "include": "#pragma-mark" + }, + { + "begin": "^\\s*((#)\\s*line)\\b", + "beginCaptures": { + "1": { + "name": "keyword.control.directive.line.c" + }, + "2": { + "name": "punctuation.definition.directive.c" + } + }, + "end": "(?=(?://|/\\*))|(?=+!]+|\\(\\)|\\[\\]))\\s*\\(\n)", + "end": "(?<=\\))(?!\\w)", + "name": "meta.function.c", + "patterns": [ + { + "include": "#function-innards" + } + ] + }, + { + "include": "#line_continuation_character" + }, + { + "match": "(\\[)|(\\])", + "captures": { + "1": { + "name": "punctuation.definition.begin.bracket.square.c" + }, + "2": { + "name": "punctuation.definition.end.bracket.square.c" + } + } + }, + { + "match": ";", + "name": "punctuation.terminator.statement.c" + }, + { + "match": ",", + "name": "punctuation.separator.delimiter.c" + } + ], + "repository": { + "access": { + "captures": { + "2": { + "name": "punctuation.separator.dot-access.c" + }, + "3": { + "name": "punctuation.separator.pointer-access.c" + }, + "4": { + "name": "variable.other.member.c" + } + }, + "match": "((\\.)|(->))\\s*(([a-zA-Z_][a-zA-Z_0-9]*)\\b(?!\\s*\\())?" + }, + "block": { + "patterns": [ + { + "begin": "{", + "beginCaptures": { + "0": { + "name": "punctuation.section.block.begin.bracket.curly.c" + } + }, + "end": "}|(?=\\s*#\\s*(?:elif|else|endif)\\b)", + "endCaptures": { + "0": { + "name": "punctuation.section.block.end.bracket.curly.c" + } + }, + "name": "meta.block.c", + "patterns": [ + { + "include": "#block_innards" + } + ] + } + ] + }, + "block_innards": { + "patterns": [ + { + "include": "#preprocessor-rule-enabled-block" + }, + { + "include": "#preprocessor-rule-disabled-block" + }, + { + "include": "#preprocessor-rule-conditional-block" + }, + { + "include": "#access" + }, + { + "include": "#libc" + }, + { + "include": "#c_function_call" + }, + { + "captures": { + "1": { + "name": "variable.other.c" + }, + "2": { + "name": "punctuation.definition.parameters.c" + } + }, + "match": "(?x)\n(?:\n (?:\n (?=\\s)(?=+!]+ | \\(\\) | \\[\\]))\n)\n\\s*(\\() # opening bracket", + "name": "meta.initialization.c" + }, + { + "begin": "{", + "beginCaptures": { + "0": { + "name": "punctuation.section.block.begin.bracket.curly.c" + } + }, + "end": "}|(?=\\s*#\\s*(?:elif|else|endif)\\b)", + "endCaptures": { + "0": { + "name": "punctuation.section.block.end.bracket.curly.c" + } + }, + "patterns": [ + { + "include": "#block_innards" + } + ] + }, + { + "include": "#parens-block" + }, + { + "include": "$base" + } + ] + }, + "c_function_call": { + "begin": "(?x)\n(?!(?:while|for|do|if|else|switch|catch|enumerate|return|typeid|alignof|alignas|sizeof|[cr]?iterate)\\s*\\()\n(?=\n(?:[A-Za-z_][A-Za-z0-9_]*+|::)++\\s*\\( # actual name\n|\n(?:(?<=operator)(?:[-*&<>=+!]+|\\(\\)|\\[\\]))\\s*\\(\n)", + "end": "(?<=\\))(?!\\w)", + "name": "meta.function-call.c", + "patterns": [ + { + "include": "#function-call-innards" + } + ] + }, + "comments": { + "patterns": [ + { + "captures": { + "1": { + "name": "meta.toc-list.banner.block.c" + } + }, + "match": "^/\\* =(\\s*.*?)\\s*= \\*/$\\n?", + "name": "comment.block.c" + }, + { + "begin": "/\\*", + "beginCaptures": { + "0": { + "name": "punctuation.definition.comment.begin.c" + } + }, + "end": "\\*/", + "endCaptures": { + "0": { + "name": "punctuation.definition.comment.end.c" + } + }, + "name": "comment.block.c" + }, + { + "match": "\\*/.*\\n", + "name": "invalid.illegal.stray-comment-end.c" + }, + { + "captures": { + "1": { + "name": "meta.toc-list.banner.line.c" + } + }, + "match": "^// =(\\s*.*?)\\s*=\\s*$\\n?", + "name": "comment.line.banner.cpp" + }, + { + "begin": "(^[ \\t]+)?(?=//)", + "beginCaptures": { + "1": { + "name": "punctuation.whitespace.comment.leading.cpp" + } + }, + "end": "(?!\\G)", + "patterns": [ + { + "begin": "//", + "beginCaptures": { + "0": { + "name": "punctuation.definition.comment.cpp" + } + }, + "end": "(?=\\n)", + "name": "comment.line.double-slash.cpp", + "patterns": [ + { + "include": "#line_continuation_character" + } + ] + } + ] + } + ] + }, + "disabled": { + "begin": "^\\s*#\\s*if(n?def)?\\b.*$", + "end": "^\\s*#\\s*endif\\b", + "patterns": [ + { + "include": "#disabled" + }, + { + "include": "#pragma-mark" + } + ] + }, + "libc": { + "captures": { + "1": { + "name": "punctuation.whitespace.support.function.leading.c" + }, + "2": { + "name": "support.function.C99.c" + } + }, + "match": "(?x) (\\s*) \\b\n(_Exit|(?:nearbyint|nextafter|nexttoward|netoward|nan)[fl]?|a(?:cos|sin)h?[fl]?|abort|abs|asctime|assert\n|atan(?:[h2]?[fl]?)?|atexit|ato[ifl]|atoll|bsearch|btowc|cabs[fl]?|cacos|cacos[fl]|cacosh[fl]?\n|calloc|carg[fl]?|casinh?[fl]?|catanh?[fl]?|cbrt[fl]?|ccosh?[fl]?|ceil[fl]?|cexp[fl]?|cimag[fl]?\n|clearerr|clock|clog[fl]?|conj[fl]?|copysign[fl]?|cosh?[fl]?|cpow[fl]?|cproj[fl]?|creal[fl]?\n|csinh?[fl]?|csqrt[fl]?|ctanh?[fl]?|ctime|difftime|div|erfc?[fl]?|exit|fabs[fl]?\n|exp(?:2[fl]?|[fl]|m1[fl]?)?|fclose|fdim[fl]?|fe[gs]et(?:env|exceptflag|round)|feclearexcept\n|feholdexcept|feof|feraiseexcept|ferror|fetestexcept|feupdateenv|fflush|fgetpos|fgetw?[sc]\n|floor[fl]?|fmax?[fl]?|fmin[fl]?|fmod[fl]?|fopen|fpclassify|fprintf|fputw?[sc]|fread|free|freopen\n|frexp[fl]?|fscanf|fseek|fsetpos|ftell|fwide|fwprintf|fwrite|fwscanf|genv|get[sc]|getchar|gmtime\n|gwc|gwchar|hypot[fl]?|ilogb[fl]?|imaxabs|imaxdiv|isalnum|isalpha|isblank|iscntrl|isdigit|isfinite\n|isgraph|isgreater|isgreaterequal|isinf|isless(?:equal|greater)?|isw?lower|isnan|isnormal|isw?print\n|isw?punct|isw?space|isunordered|isw?upper|iswalnum|iswalpha|iswblank|iswcntrl|iswctype|iswdigit|iswgraph\n|isw?xdigit|labs|ldexp[fl]?|ldiv|lgamma[fl]?|llabs|lldiv|llrint[fl]?|llround[fl]?|localeconv|localtime\n|log[2b]?[fl]?|log1[p0][fl]?|longjmp|lrint[fl]?|lround[fl]?|malloc|mbr?len|mbr?towc|mbsinit|mbsrtowcs\n|mbstowcs|memchr|memcmp|memcpy|memmove|memset|mktime|modf[fl]?|perror|pow[fl]?|printf|puts|putw?c(?:har)?\n|qsort|raise|rand|remainder[fl]?|realloc|remove|remquo[fl]?|rename|rewind|rint[fl]?|round[fl]?|scalbl?n[fl]?\n|scanf|setbuf|setjmp|setlocale|setvbuf|signal|signbit|sinh?[fl]?|snprintf|sprintf|sqrt[fl]?|srand|sscanf\n|strcat|strchr|strcmp|strcoll|strcpy|strcspn|strerror|strftime|strlen|strncat|strncmp|strncpy|strpbrk\n|strrchr|strspn|strstr|strto[kdf]|strtoimax|strtol[dl]?|strtoull?|strtoumax|strxfrm|swprintf|swscanf\n|system|tan|tan[fl]|tanh[fl]?|tgamma[fl]?|time|tmpfile|tmpnam|tolower|toupper|trunc[fl]?|ungetw?c|va_arg\n|va_copy|va_end|va_start|vfw?printf|vfw?scanf|vprintf|vscanf|vsnprintf|vsprintf|vsscanf|vswprintf|vswscanf\n|vwprintf|vwscanf|wcrtomb|wcscat|wcschr|wcscmp|wcscoll|wcscpy|wcscspn|wcsftime|wcslen|wcsncat|wcsncmp|wcsncpy\n|wcspbrk|wcsrchr|wcsrtombs|wcsspn|wcsstr|wcsto[dkf]|wcstoimax|wcstol[dl]?|wcstombs|wcstoull?|wcstoumax|wcsxfrm\n|wctom?b|wmem(?:set|chr|cpy|cmp|move)|wprintf|wscanf)\\b" + }, + "line_continuation_character": { + "patterns": [ + { + "match": "(\\\\)\\n", + "captures": { + "1": { + "name": "constant.character.escape.line-continuation.c" + } + } + } + ] + }, + "numbers": { + "patterns": [ + { + "match": "\\b((0(x|X)[0-9a-fA-F]([0-9a-fA-F']*[0-9a-fA-F])?)|(0(b|B)[01]([01']*[01])?)|(([0-9]([0-9']*[0-9])?\\.?[0-9]*([0-9']*[0-9])?)|(\\.[0-9]([0-9']*[0-9])?))((e|E)(\\+|-)?[0-9]([0-9']*[0-9])?)?)(L|l|UL|ul|u|U|F|f|ll|LL|ull|ULL)?\\b", + "name": "constant.numeric.c" + } + ] + }, + "parens": { + "begin": "\\(", + "beginCaptures": { + "0": { + "name": "punctuation.section.parens.begin.bracket.round.c" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.section.parens.end.bracket.round.c" + } + }, + "patterns": [ + { + "include": "$base" + } + ] + }, + "parens-block": { + "begin": "\\(", + "beginCaptures": { + "0": { + "name": "punctuation.section.parens.begin.bracket.round.c" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.section.parens.end.bracket.round.c" + } + }, + "patterns": [ + { + "include": "#block_innards" + } + ] + }, + "pragma-mark": { + "captures": { + "1": { + "name": "meta.preprocessor.pragma.c" + }, + "2": { + "name": "keyword.control.directive.pragma.pragma-mark.c" + }, + "3": { + "name": "punctuation.definition.directive.c" + }, + "4": { + "name": "entity.name.tag.pragma-mark.c" + } + }, + "match": "^\\s*(((#)\\s*pragma\\s+mark)\\s+(.*))", + "name": "meta.section" + }, + "operators": { + "patterns": [ + { + "match": "(?>=|\\|=", + "name": "keyword.operator.assignment.compound.bitwise.c" + }, + { + "match": "<<|>>", + "name": "keyword.operator.bitwise.shift.c" + }, + { + "match": "!=|<=|>=|==|<|>", + "name": "keyword.operator.comparison.c" + }, + { + "match": "&&|!|\\|\\|", + "name": "keyword.operator.logical.c" + }, + { + "match": "&|\\||\\^|~", + "name": "keyword.operator.c" + }, + { + "match": "=", + "name": "keyword.operator.assignment.c" + }, + { + "match": "%|\\*|/|-|\\+", + "name": "keyword.operator.c" + }, + { + "begin": "\\?", + "beginCaptures": { + "0": { + "name": "keyword.operator.ternary.c" + } + }, + "end": ":", + "applyEndPatternLast": true, + "endCaptures": { + "0": { + "name": "keyword.operator.ternary.c" + } + }, + "patterns": [ + { + "include": "#access" + }, + { + "include": "#libc" + }, + { + "include": "#c_function_call" + }, + { + "include": "$base" + } + ] + } + ] + }, + "strings": { + "patterns": [ + { + "begin": "\"", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.c" + } + }, + "end": "\"", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.c" + } + }, + "name": "string.quoted.double.c", + "patterns": [ + { + "include": "#string_escaped_char" + }, + { + "include": "#string_placeholder" + }, + { + "include": "#line_continuation_character" + } + ] + }, + { + "begin": "'", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.c" + } + }, + "end": "'", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.c" + } + }, + "name": "string.quoted.single.c", + "patterns": [ + { + "include": "#string_escaped_char" + }, + { + "include": "#line_continuation_character" + } + ] + } + ] + }, + "string_escaped_char": { + "patterns": [ + { + "match": "(?x)\\\\ (\n\\\\ |\n[abefnprtv'\"?] |\n[0-3]\\d{,2} |\n[4-7]\\d? |\nx[a-fA-F0-9]{,2} |\nu[a-fA-F0-9]{,4} |\nU[a-fA-F0-9]{,8} )", + "name": "constant.character.escape.c" + }, + { + "match": "\\\\.", + "name": "invalid.illegal.unknown-escape.c" + } + ] + }, + "string_placeholder": { + "patterns": [ + { + "match": "(?x) %\n(\\d+\\$)? # field (argument #)\n[#0\\- +']* # flags\n[,;:_]? # separator character (AltiVec)\n((-?\\d+)|\\*(-?\\d+\\$)?)? # minimum field width\n(\\.((-?\\d+)|\\*(-?\\d+\\$)?)?)? # precision\n(hh|h|ll|l|j|t|z|q|L|vh|vl|v|hv|hl)? # length modifier\n[diouxXDOUeEfFgGaACcSspn%] # conversion type", + "name": "constant.other.placeholder.c" + }, + { + "match": "(%)(?!\"\\s*(PRI|SCN))", + "captures": { + "1": { + "name": "invalid.illegal.placeholder.c" + } + } + } + ] + }, + "storage_types": { + "patterns": [ + { + "match": "\\b(asm|__asm__|auto|bool|_Bool|char|_Complex|double|enum|float|_Imaginary|int|long|short|signed|struct|typedef|union|unsigned|void)\\b", + "name": "storage.type.c" + } + ] + }, + "vararg_ellipses": { + "match": "(?=+!]+|\\(\\)|\\[\\]))\\s*\\(\n)", + "end": "(?<=\\))(?!\\w)|(?=+!]+|\\(\\)|\\[\\]))\n)\n\\s*(\\()", + "beginCaptures": { + "1": { + "name": "entity.name.function.c" + }, + "2": { + "name": "punctuation.section.arguments.begin.bracket.round.c" + } + }, + "end": "(\\))|(?=+!]+|\\(\\)|\\[\\]))\n)\n\\s*(\\()", + "beginCaptures": { + "1": { + "name": "entity.name.function.c" + }, + "2": { + "name": "punctuation.section.parameters.begin.bracket.round.c" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.section.parameters.end.bracket.round.c" + } + }, + "patterns": [ + { + "include": "#function-innards" + } + ] + }, + { + "begin": "\\(", + "beginCaptures": { + "0": { + "name": "punctuation.section.parens.begin.bracket.round.c" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.section.parens.end.bracket.round.c" + } + }, + "patterns": [ + { + "include": "#function-innards" + } + ] + }, + { + "include": "$base" + } + ] + }, + "function-call-innards": { + "patterns": [ + { + "include": "#comments" + }, + { + "include": "#storage_types" + }, + { + "include": "#access" + }, + { + "include": "#operators" + }, + { + "begin": "(?x)\n(?!(?:while|for|do|if|else|switch|catch|enumerate|return|typeid|alignof|alignas|sizeof|[cr]?iterate)\\s*\\()\n(\n(?:[A-Za-z_][A-Za-z0-9_]*+|::)++ # actual name\n|\n(?:(?<=operator)(?:[-*&<>=+!]+|\\(\\)|\\[\\]))\n)\n\\s*(\\()", + "beginCaptures": { + "1": { + "name": "entity.name.function.c" + }, + "2": { + "name": "punctuation.section.arguments.begin.bracket.round.c" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.section.arguments.end.bracket.round.c" + } + }, + "patterns": [ + { + "include": "#function-call-innards" + } + ] + }, + { + "begin": "\\(", + "beginCaptures": { + "0": { + "name": "punctuation.section.parens.begin.bracket.round.c" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.section.parens.end.bracket.round.c" + } + }, + "patterns": [ + { + "include": "#function-call-innards" + } + ] + }, + { + "include": "#block_innards" + } + ] + } + } +} diff --git a/data/source.coffee.json b/data/source.coffee.json new file mode 100644 index 0000000..860e06e --- /dev/null +++ b/data/source.coffee.json @@ -0,0 +1,1319 @@ +{ + "scopeName": "source.coffee", + "name": "CoffeeScript", + "fileTypes": [ + "coffee", + "Cakefile", + "coffee.erb", + "cson", + "_coffee", + "cjsx" + ], + "firstLineMatch": "(?x)\n# Hashbang\n^\\#!.*(?:\\s|\\/)\n coffee\n(?:$|\\s)\n|\n# Modeline\n(?i:\n # Emacs\n -\\*-(?:\\s*(?=[^:;\\s]+\\s*-\\*-)|(?:.*?[;\\s]|(?<=-\\*-))mode\\s*:\\s*)\n coffee\n (?=[\\s;]|(?]?\\d+|m)?|\\sex)(?=:(?=\\s*set?\\s[^\\n:]+:)|:(?!\\s*set?\\s))(?:(?:\\s|\\s*:\\s*)\\w*(?:\\s*=(?:[^\\n\\\\\\s]|\\\\.)*)?)*[\\s:](?:filetype|ft|syntax)\\s*=\n coffee\n (?=\\s|:|$)\n)", + "patterns": [ + { + "include": "#jsx" + }, + { + "match": "(new)\\s+(?:(?:(class)\\s+(\\w+(?:\\.\\w*)*)?)|(\\w+(?:\\.\\w*)*))", + "name": "meta.class.instance.constructor.coffee", + "captures": { + "1": { + "name": "keyword.operator.new.coffee" + }, + "2": { + "name": "storage.type.class.coffee" + }, + "3": { + "name": "entity.name.type.instance.coffee" + }, + "4": { + "name": "entity.name.type.instance.coffee" + } + } + }, + { + "begin": "'''", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.coffee" + } + }, + "end": "'''", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.coffee" + } + }, + "name": "string.quoted.single.heredoc.coffee", + "patterns": [ + { + "captures": { + "1": { + "name": "punctuation.definition.escape.backslash.coffee" + } + }, + "match": "(\\\\).", + "name": "constant.character.escape.backslash.coffee" + } + ] + }, + { + "begin": "\"\"\"", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.coffee" + } + }, + "end": "\"\"\"", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.coffee" + } + }, + "name": "string.quoted.double.heredoc.coffee", + "patterns": [ + { + "captures": { + "1": { + "name": "punctuation.definition.escape.backslash.coffee" + } + }, + "match": "(\\\\).", + "name": "constant.character.escape.backslash.coffee" + }, + { + "include": "#interpolated_coffee" + } + ] + }, + { + "match": "(`)(.*)(`)", + "name": "string.quoted.script.coffee", + "captures": { + "1": { + "name": "punctuation.definition.string.begin.coffee" + }, + "2": { + "name": "source.js.embedded.coffee", + "patterns": [ + { + "include": "source.js" + } + ] + }, + "3": { + "name": "punctuation.definition.string.end.coffee" + } + } + }, + { + "begin": "(?)", + "beginCaptures": { + "1": { + "name": "entity.name.function.coffee" + }, + "2": { + "name": "variable.other.readwrite.instance.coffee" + }, + "3": { + "name": "keyword.operator.assignment.coffee" + } + }, + "end": "[=-]>", + "endCaptures": { + "0": { + "name": "storage.type.function.coffee" + } + }, + "name": "meta.function.coffee", + "patterns": [ + { + "include": "#function_params" + } + ] + }, + { + "begin": "(?x)\n(?<=\\s|^)(?:((')([^']*?)('))|((\")([^\"]*?)(\")))\n\\s*([:=])\\s*\n(?=(\\([^\\(\\)]*\\)\\s*)?[=-]>)", + "beginCaptures": { + "1": { + "name": "string.quoted.single.coffee" + }, + "2": { + "name": "punctuation.definition.string.begin.coffee" + }, + "3": { + "name": "entity.name.function.coffee" + }, + "4": { + "name": "punctuation.definition.string.end.coffee" + }, + "5": { + "name": "string.quoted.double.coffee" + }, + "6": { + "name": "punctuation.definition.string.begin.coffee" + }, + "7": { + "name": "entity.name.function.coffee" + }, + "8": { + "name": "punctuation.definition.string.end.coffee" + }, + "9": { + "name": "keyword.operator.assignment.coffee" + } + }, + "end": "[=-]>", + "endCaptures": { + "0": { + "name": "storage.type.function.coffee" + } + }, + "name": "meta.function.coffee", + "patterns": [ + { + "include": "#function_params" + } + ] + }, + { + "begin": "(?=(\\([^\\(\\)]*\\)\\s*)?[=-]>)", + "end": "[=-]>", + "endCaptures": { + "0": { + "name": "storage.type.function.coffee" + } + }, + "name": "meta.function.inline.coffee", + "patterns": [ + { + "include": "#function_params" + } + ] + }, + { + "begin": "(?<=\\s|^)({)(?=[^'\"#]+?}[\\s\\]}]*=)", + "beginCaptures": { + "1": { + "name": "punctuation.definition.destructuring.begin.bracket.curly.coffee" + } + }, + "end": "}", + "endCaptures": { + "0": { + "name": "punctuation.definition.destructuring.end.bracket.curly.coffee" + } + }, + "name": "meta.variable.assignment.destructured.object.coffee", + "patterns": [ + { + "include": "$self" + }, + { + "match": "[a-zA-Z$_]\\w*", + "name": "variable.assignment.coffee" + } + ] + }, + { + "begin": "(?<=\\s|^)(\\[)(?=[^'\"#]+?\\][\\s\\]}]*=)", + "beginCaptures": { + "1": { + "name": "punctuation.definition.destructuring.begin.bracket.square.coffee" + } + }, + "end": "\\]", + "endCaptures": { + "0": { + "name": "punctuation.definition.destructuring.end.bracket.square.coffee" + } + }, + "name": "meta.variable.assignment.destructured.array.coffee", + "patterns": [ + { + "include": "$self" + }, + { + "match": "[a-zA-Z$_]\\w*", + "name": "variable.assignment.coffee" + } + ] + }, + { + "match": "\\b(?|\\-\\d|\\[|{|\"|'))", + "end": "(?=\\s*(?|\\-\\d|\\[|{|\"|')))", + "beginCaptures": { + "1": { + "name": "variable.other.readwrite.instance.coffee" + }, + "2": { + "patterns": [ + { + "include": "#function_names" + } + ] + } + }, + "end": "(?=\\s*(?|\\-\\d|\\[|{|\"|')))", + "beginCaptures": { + "1": { + "name": "punctuation.separator.method.period.coffee" + }, + "2": { + "name": "keyword.operator.prototype.coffee" + }, + "3": { + "patterns": [ + { + "include": "#method_names" + } + ] + } + }, + "end": "(?=\\s*(?>=|>>>=|\\|=)", + "captures": { + "1": { + "name": "variable.assignment.coffee" + }, + "2": { + "name": "keyword.operator.assignment.compound.bitwise.coffee" + } + } + }, + { + "match": "<<|>>>|>>", + "name": "keyword.operator.bitwise.shift.coffee" + }, + { + "match": "!=|<=|>=|==|<|>", + "name": "keyword.operator.comparison.coffee" + }, + { + "match": "&&|!|\\|\\|", + "name": "keyword.operator.logical.coffee" + }, + { + "match": "&|\\||\\^|~", + "name": "keyword.operator.bitwise.coffee" + }, + { + "match": "([a-zA-Z$_][\\w$]*)?\\s*(=|:(?!:))(?![>=])", + "captures": { + "1": { + "name": "variable.assignment.coffee" + }, + "2": { + "name": "keyword.operator.assignment.coffee" + } + } + }, + { + "match": "--", + "name": "keyword.operator.decrement.coffee" + }, + { + "match": "\\+\\+", + "name": "keyword.operator.increment.coffee" + }, + { + "match": "\\.\\.\\.", + "name": "keyword.operator.splat.coffee" + }, + { + "match": "\\?", + "name": "keyword.operator.existential.coffee" + }, + { + "match": "%|\\*|/|-|\\+", + "name": "keyword.operator.coffee" + }, + { + "match": "(?x)\n\\b(?)", + "name": "meta.tag.coffee", + "patterns": [ + { + "include": "#jsx-attribute" + } + ] + } + ] + }, + "jsx-end-tag": { + "patterns": [ + { + "begin": "()", + "name": "meta.tag.coffee" + } + ] + } + } +} diff --git a/data/source.cpp.json b/data/source.cpp.json new file mode 100644 index 0000000..36410bd --- /dev/null +++ b/data/source.cpp.json @@ -0,0 +1,461 @@ +{ + "scopeName": "source.cpp", + "fileTypes": [ + "cc", + "cpp", + "cp", + "cxx", + "c++", + "cu", + "cuh", + "h", + "hh", + "hpp", + "hxx", + "h++", + "inl", + "ino", + "ipp", + "tcc", + "tpp" + ], + "firstLineMatch": "(?i)-\\*-[^*]*(Mode:\\s*)?C\\+\\+(\\s*;.*?)?\\s*-\\*-", + "name": "C++", + "patterns": [ + { + "include": "#special_block" + }, + { + "include": "#strings" + }, + { + "match": "\\b(friend|explicit|virtual|override|final|noexcept)\\b", + "name": "storage.modifier.cpp" + }, + { + "match": "\\b(private:|protected:|public:)", + "name": "storage.modifier.cpp" + }, + { + "match": "\\b(catch|operator|try|throw|using)\\b", + "name": "keyword.control.cpp" + }, + { + "match": "\\bdelete\\b(\\s*\\[\\])?|\\bnew\\b(?!])", + "name": "keyword.control.cpp" + }, + { + "match": "\\b(f|m)[A-Z]\\w*\\b", + "name": "variable.other.readwrite.member.cpp" + }, + { + "match": "\\bthis\\b", + "name": "variable.language.this.cpp" + }, + { + "match": "\\bnullptr\\b", + "name": "constant.language.cpp" + }, + { + "match": "\\btemplate\\b\\s*", + "name": "storage.type.template.cpp" + }, + { + "match": "\\b(const_cast|dynamic_cast|reinterpret_cast|static_cast)\\b\\s*", + "name": "keyword.operator.cast.cpp" + }, + { + "match": "::", + "name": "punctuation.separator.namespace.access.cpp" + }, + { + "match": "\\b(and|and_eq|bitand|bitor|compl|not|not_eq|or|or_eq|typeid|xor|xor_eq|alignof|alignas)\\b", + "name": "keyword.operator.cpp" + }, + { + "match": "\\b(class|decltype|wchar_t|char16_t|char32_t)\\b", + "name": "storage.type.cpp" + }, + { + "match": "\\b(constexpr|export|mutable|typename|thread_local)\\b", + "name": "storage.modifier.cpp" + }, + { + "begin": "(?x)\n(?:\n ^ | # beginning of line\n (?:(?", + "name": "meta.angle-brackets.cpp", + "patterns": [ + { + "include": "#angle_brackets" + }, + { + "include": "$base" + } + ] + }, + "block": { + "begin": "\\{", + "beginCaptures": { + "0": { + "name": "punctuation.section.block.begin.bracket.curly.c" + } + }, + "end": "\\}", + "endCaptures": { + "0": { + "name": "punctuation.section.block.end.bracket.curly.c" + } + }, + "name": "meta.block.cpp", + "patterns": [ + { + "captures": { + "1": { + "name": "support.function.any-method.c" + }, + "2": { + "name": "punctuation.definition.parameters.c" + } + }, + "match": "(?x)\n(\n (?!while|for|do|if|else|switch|catch|enumerate|return|r?iterate)\n (?:\\b[A-Za-z_][A-Za-z0-9_]*+\\b|::)*+ # actual name\n)\n\\s*(\\() # opening bracket", + "name": "meta.function-call.c" + }, + { + "include": "$base" + } + ] + }, + "constructor": { + "patterns": [ + { + "begin": "(?x)\n(?:^\\s*) # beginning of line\n((?!while|for|do|if|else|switch|catch|enumerate|r?iterate)[A-Za-z_][A-Za-z0-9_:]*) # actual name\n\\s*(\\() # opening bracket", + "beginCaptures": { + "1": { + "name": "entity.name.function.cpp" + }, + "2": { + "name": "punctuation.definition.parameters.begin.c" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.definition.parameters.end.c" + } + }, + "name": "meta.function.constructor.cpp", + "patterns": [ + { + "include": "$base" + } + ] + }, + { + "begin": "(?x)\n(:)\n(\n (?=\n \\s*[A-Za-z_][A-Za-z0-9_:]* # actual name\n \\s* (\\() # opening bracket\n )\n)", + "beginCaptures": { + "1": { + "name": "punctuation.definition.parameters.c" + } + }, + "end": "(?=\\{)", + "name": "meta.function.constructor.initializer-list.cpp", + "patterns": [ + { + "include": "$base" + } + ] + } + ] + }, + "special_block": { + "patterns": [ + { + "begin": "\\b(using)\\b\\s*(namespace)\\b\\s*((?:[_A-Za-z][_A-Za-z0-9]*\\b(::)?)*)", + "beginCaptures": { + "1": { + "name": "keyword.control.cpp" + }, + "2": { + "name": "storage.type.cpp" + }, + "3": { + "name": "entity.name.type.cpp" + } + }, + "end": "(;)", + "name": "meta.using-namespace-declaration.cpp" + }, + { + "begin": "\\b(namespace)\\b\\s*([_A-Za-z][_A-Za-z0-9]*\\b)?+", + "beginCaptures": { + "1": { + "name": "storage.type.cpp" + }, + "2": { + "name": "entity.name.type.cpp" + } + }, + "captures": { + "1": { + "name": "keyword.control.namespace.$2" + } + }, + "end": "(?<=\\})|(?=(;|,|\\(|\\)|>|\\[|\\]|=))", + "name": "meta.namespace-block.cpp", + "patterns": [ + { + "begin": "\\{", + "beginCaptures": { + "0": { + "name": "punctuation.definition.scope.cpp" + } + }, + "end": "\\}", + "endCaptures": { + "0": { + "name": "punctuation.definition.scope.cpp" + } + }, + "patterns": [ + { + "include": "#special_block" + }, + { + "include": "#constructor" + }, + { + "include": "$base" + } + ] + }, + { + "include": "$base" + } + ] + }, + { + "begin": "\\b(class|struct)\\b\\s*([_A-Za-z][_A-Za-z0-9]*\\b)?+(\\s*:\\s*(public|protected|private)\\s*([_A-Za-z][_A-Za-z0-9]*\\b)((\\s*,\\s*(public|protected|private)\\s*[_A-Za-z][_A-Za-z0-9]*\\b)*))?", + "beginCaptures": { + "1": { + "name": "storage.type.cpp" + }, + "2": { + "name": "entity.name.type.cpp" + }, + "4": { + "name": "storage.type.modifier.cpp" + }, + "5": { + "name": "entity.name.type.inherited.cpp" + }, + "6": { + "patterns": [ + { + "match": "(public|protected|private)", + "name": "storage.type.modifier.cpp" + }, + { + "match": "[_A-Za-z][_A-Za-z0-9]*", + "name": "entity.name.type.inherited.cpp" + } + ] + } + }, + "end": "(?<=\\})|(?=(;|\\(|\\)|>|\\[|\\]|=))", + "name": "meta.class-struct-block.cpp", + "patterns": [ + { + "include": "#angle_brackets" + }, + { + "begin": "\\{", + "beginCaptures": { + "0": { + "name": "punctuation.section.block.begin.bracket.curly.cpp" + } + }, + "end": "(\\})(\\s*\\n)?", + "endCaptures": { + "1": { + "name": "punctuation.section.block.end.bracket.curly.cpp" + }, + "2": { + "name": "invalid.illegal.you-forgot-semicolon.cpp" + } + }, + "patterns": [ + { + "include": "#special_block" + }, + { + "include": "#constructor" + }, + { + "include": "$base" + } + ] + }, + { + "include": "$base" + } + ] + }, + { + "begin": "\\b(extern)(?=\\s*\")", + "beginCaptures": { + "1": { + "name": "storage.modifier.cpp" + } + }, + "end": "(?<=\\})|(?=\\w)|(?=\\s*#\\s*endif\\b)", + "name": "meta.extern-block.cpp", + "patterns": [ + { + "begin": "\\{", + "beginCaptures": { + "0": { + "name": "punctuation.section.block.begin.bracket.curly.c" + } + }, + "end": "\\}|(?=\\s*#\\s*endif\\b)", + "endCaptures": { + "0": { + "name": "punctuation.section.block.end.bracket.curly.c" + } + }, + "patterns": [ + { + "include": "#special_block" + }, + { + "include": "$base" + } + ] + }, + { + "include": "$base" + } + ] + } + ] + }, + "strings": { + "patterns": [ + { + "begin": "(u|u8|U|L)?\"", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.cpp" + }, + "1": { + "name": "meta.encoding.cpp" + } + }, + "end": "\"", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.cpp" + } + }, + "name": "string.quoted.double.cpp", + "patterns": [ + { + "match": "\\\\u\\h{4}|\\\\U\\h{8}", + "name": "constant.character.escape.cpp" + }, + { + "match": "\\\\['\"?\\\\abfnrtv]", + "name": "constant.character.escape.cpp" + }, + { + "match": "\\\\[0-7]{1,3}", + "name": "constant.character.escape.cpp" + }, + { + "match": "\\\\x\\h+", + "name": "constant.character.escape.cpp" + }, + { + "include": "source.c#string_placeholder" + } + ] + }, + { + "begin": "(u|u8|U|L)?R\"(?:([^ ()\\\\\\t]{0,16})|([^ ()\\\\\\t]*))\\(", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.cpp" + }, + "1": { + "name": "meta.encoding.cpp" + }, + "3": { + "name": "invalid.illegal.delimiter-too-long.cpp" + } + }, + "end": "\\)\\2(\\3)\"", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.cpp" + }, + "1": { + "name": "invalid.illegal.delimiter-too-long.cpp" + } + }, + "name": "string.quoted.double.raw.cpp" + } + ] + } + } +} diff --git a/data/source.graphql.json b/data/source.graphql.json new file mode 100644 index 0000000..29ec1fe --- /dev/null +++ b/data/source.graphql.json @@ -0,0 +1,599 @@ +{ + "name": "GraphQL", + "scopeName": "source.graphql", + "foldingStartMarker": "(/\\*|{|\\()", + "foldingEndMarker": "(\\*/|\\}|\\))", + "fileTypes": [ + "prisma", + "graphqls", + "graphql", + "gql" + ], + "patterns": [ + { "include": "#graphql" } + ], + "repository": { + "graphql": { + "patterns": [ + { "include": "#graphql-fragment-definition" }, + { "include": "#graphql-type-interface" }, + { "include": "#graphql-enum" }, + { "include": "#graphql-scalar" }, + { "include": "#graphql-union" }, + { "include": "#graphql-schema" }, + { "include": "#graphql-operation-def" }, + { "include": "#graphql-comment" }, + { "include": "#graphql-directive" }, + { "include": "#graphql-blockstring-value"}, + { "include": "#graphql-string-value"} + ] + }, + "graphql-operation-def": { + "patterns": [ + { "include": "#graphql-query-mutation" }, + { "include": "#graphql-name" }, + { "include": "#graphql-variable-definitions" }, + { "include": "#graphql-directive" }, + { "include": "#graphql-selection-set" } + ] + }, + "graphql-fragment-definition": { + "name": "meta.fragment.graphql", + "begin": "\\s*(?:(\\bfragment\\b)\\s*(?!\\bon\\b)([_A-Za-z][_0-9A-Za-z]*)\\s*(?:(\\bon\\b)\\s*([_A-Za-z][_0-9A-Za-z]*)))", + "end": "(?<=})", + "captures": { + "1": { "name": "keyword.fragment.graphql" }, + "2": { "name": "entity.name.fragment.graphql" }, + "3": { "name": "keyword.on.graphql" }, + "4": { "name": "support.type.graphql" } + }, + "patterns": [ + { "include": "#graphql-comment" }, + { "include": "#graphql-selection-set" }, + { "include": "#graphql-directive" }, + { "include": "#graphql-skip-newlines" } + ] + }, + "graphql-query-mutation": { + "match": "\\s*\\b(query|mutation)\\b", + "captures": { + "1": { "name": "keyword.operation.graphql" } + } + }, + "graphql-type-interface": { + "name": "meta.type.interface.graphql", + "begin": "\\s*\\b(?:(extends)?\\b\\s*\\b(type)|(interface)|(input))\\b\\s*([_A-Za-z][_0-9A-Za-z]*)?", + "end": "(?<=})", + "captures": { + "1": { "name": "keyword.type.graphql"}, + "2": { "name": "keyword.type.graphql"}, + "3": { "name": "keyword.interface.graphql"}, + "4": { "name": "keyword.input.graphql"}, + "5": { "name": "support.type.graphql"} + }, + "patterns": [ + { + "match": "\\s*(?:\\b(implements)\\b|(&))\\s*([_A-Za-z][_0-9A-Za-z]*)", + "captures": { + "1": { "name": "keyword.implements.graphql" }, + "2": { "name": "keyword.implements.graphql" }, + "3": { "name": "support.type.graphql" } + } + }, + { "include": "#graphql-comment" }, + { "include": "#graphql-directive" }, + { "include": "#graphql-type-object" } + ] + }, + "graphql-type-object": { + "name": "meta.type.object.graphql", + "begin": "\\s*({)", + "end": "\\s*(})", + "beginCaptures": { + "1": { "name": "punctuation.operation.graphql"} + }, + "endCaptures": { + "1": { "name": "punctuation.operation.graphql"} + }, + "patterns": [ + { "include": "#graphql-object-type" }, + { "include": "#graphql-comment" }, + { "include": "#graphql-type-definition" }, + { "include": "#graphql-blockstring-value"}, + { "include": "#graphql-string-value"} + ] + }, + "graphql-type-definition": { + "comment": "key (optionalArgs): Type", + "begin": "\\s*([_A-Za-z][_0-9A-Za-z]*)(?=\\s*\\(|:)", + "end": "(?=\\s*(([_A-Za-z][_0-9A-Za-z]*)\\s*(\\(|:)|(})))|\\s*(,)", + "beginCaptures": { + "1": { "name": "variable.graphql" } + }, + "endCaptures": { + "5": { "name": "punctuation.comma.graphql" } + }, + "patterns": [ + { "include": "#graphql-directive" }, + { "include": "#graphql-comment" }, + { "include": "#graphql-variable-definitions" }, + { "include": "#graphql-type-object" }, + { "include": "#graphql-colon"}, + { "include": "#graphql-input-types"} + ] + }, + "graphql-schema": { + "begin": "\\s*\\b(schema)\\b", + "end": "(?<=})", + "beginCaptures": { + "1": { "name": "keyword.schema.graphql" } + }, + "patterns": [ + { + "begin": "\\s*({)", + "end": "\\s*(})", + "beginCaptures": { + "1": { "name": "punctuation.operation.graphql"} + }, + "endCaptures": { + "1": { "name": "punctuation.operation.graphql"} + }, + "patterns": [ + { + "begin": "\\s*([_A-Za-z][_0-9A-Za-z]*)(?=\\s*\\(|:)", + "end": "(?=\\s*(([_A-Za-z][_0-9A-Za-z]*)\\s*(\\(|:)|(})))|\\s*(,)", + "beginCaptures": { + "1": { "name": "variable.arguments.graphql" } + }, + "endCaptures": { + "5": { "name": "punctuation.comma.graphql" } + }, + "patterns": [ + { + "match": "\\s*([_A-Za-z][_0-9A-Za-z]*)", + "captures": { + "1": { "name": "support.type.graphql" } + } + }, + { "include": "#graphql-colon" }, + { "include": "#graphql-comment" }, + { "include": "#graphql-directive" }, + { "include": "#graphql-skip-newlines" } + ] + }, + { "include": "#graphql-comment" }, + { "include": "#graphql-skip-newlines" } + ] + }, + { "include": "#graphql-directive" }, + { "include": "#graphql-comment" }, + { "include": "#graphql-skip-newlines" } + ] + }, + "graphql-comment": { + "comment": "need to prefix comment space with a scope else Atom's reflow cmd doesn't work", + "name": "comment.line.graphql.js", + "match": "(\\s*)(#).*", + "captures": { + "1": { "name": "punctuation.whitespace.comment.leading.graphql" } + } + }, + "graphql-variable-definitions": { + "begin": "\\s*(\\()", + "end": "\\s*(\\))", + "captures": { + "1": { "name": "meta.brace.round.graphql"} + }, + "patterns": [ + { "include": "#graphql-comment" }, + { "include": "#graphql-variable-definition"}, + { "include": "#graphql-blockstring-value"}, + { "include": "#graphql-string-value"} + ] + }, + "graphql-variable-definition": { + "comment": "variable: type = value,.... which may be a list", + "name": "meta.variables.graphql", + "begin": "\\s*(\\$?[_A-Za-z][_0-9A-Za-z]*)(?=\\s*\\(|:)", + "end": "(?=\\s*((\\$?[_A-Za-z][_0-9A-Za-z]*)\\s*(\\(|:)|(}|\\))))|\\s*(,)", + "beginCaptures": { + "1": { "name": "variable.graphql" } + }, + "endCaptures": { + "5": { "name": "punctuation.comma.graphql" } + }, + "patterns": [ + { "include": "#graphql-comment" }, + { "include": "#graphql-colon" }, + { "include": "#graphql-input-types"}, + { "include": "#graphql-variable-assignment"}, + { "include": "#graphql-skip-newlines" } + ] + }, + "graphql-input-types": { + "patterns": [ + { "include": "#graphql-scalar-type" }, + { + "match": "\\s*([_A-Za-z][_0-9A-Za-z]*)(?:\\s*(!))?", + "captures": { + "1": { "name": "support.type.graphql" }, + "2": { "name": "keyword.operator.nulltype.graphql" } + } + }, + { + "name": "meta.type.list.graphql", + "begin": "\\s*(\\[)", + "end": "\\s*(\\])(?:\\s*(!))?", + "captures": { + "1": { "name": "meta.brace.squart.graphql" }, + "2": { "name": "keyword.operator.nulltype.graphql" } + }, + "patterns": [ + { "include": "#graphql-input-types" }, + { "include": "#graphql-comment" }, + { "include": "#graphql-comma" } + ] + } + ] + }, + "graphql-scalar": { + "match": "\\s*\\b(scalar)\\b\\s*([_A-Za-z][_0-9A-Za-z]*)", + "captures": { + "1": { "name": "keyword.scalar.graphql" }, + "2": { "name": "entity.scalar.graphql" } + } + }, + "graphql-scalar-type": { + "match": "\\s*\\b(Int|Float|String|Boolean|ID)\\b(?:\\s*(!))?", + "captures": { + "1": { "name": "support.type.builtin.graphql" }, + "2": { "name": "keyword.operator.nulltype.graphql" } + } + }, + "graphql-variable-assignment": { + "begin": "\\s(=)", + "end": "(?=.)", + "applyEndPatternLast": 1, + "beginCaptures": { + "1": { "name": "punctuation.assignment.graphql" } + }, + "patterns": [ + { "include": "#graphql-value" } + ] + }, + "graphql-comma": { + "match": "\\s*(,)", + "captures": { + "1": { "name": "punctuation.comma.graphql" } + } + }, + "graphql-colon": { + "match": "\\s*(:)", + "captures": { + "1": { "name": "punctuation.colon.graphql" } + } + }, + "graphql-union-mark": { + "match": "\\s*(\\|)", + "captures": { + "1": { "name": "punctuation.union.graphql" } + } + }, + "graphql-name": { + "match": "\\s*([_A-Za-z][_0-9A-Za-z]*)", + "captures": { + "1": { "name": "entity.name.function.graphql" } + } + }, + "graphql-directive": { + "begin": "\\s*((@)\\s*([_A-Za-z][_0-9A-Za-z]*))", + "end": "(?=.)", + "applyEndPatternLast": 1, + "beginCaptures": { + "1": { "name": "entity.name.function.directive.graphql" } + }, + "patterns": [ + { "include": "#graphql-arguments"}, + { "include": "#graphql-comment" }, + { "include": "#graphql-skip-newlines" } + ] + }, + "graphql-selection-set": { + "name": "meta.selectionset.graphql", + "begin": "\\s*({)", + "end": "\\s*(})", + "beginCaptures": { + "1": { "name": "punctuation.operation.graphql"} + }, + "endCaptures": { + "1": { "name": "punctuation.operation.graphql"} + }, + "patterns": [ + { "include": "#graphql-field" }, + { "include": "#graphql-fragment-spread" }, + { "include": "#graphql-inline-fragment" }, + { "include": "#graphql-comma" }, + { "include": "#graphql-comment" } + ] + }, + "graphql-field": { + "patterns": [ + { + "match": "\\s*([_A-Za-z][_0-9A-Za-z]*)\\s*(:)", + "captures": { + "1": { "name": "string.unquoted.alias.graphql" }, + "2": { "name": "punctuation.colon.graphql" } + } + }, + { + "match": "\\s*([_A-Za-z][_0-9A-Za-z]*)", + "captures": { + "1": { "name": "variable.graphql" } + } + }, + { "include": "#graphql-arguments" }, + { "include": "#graphql-directive" }, + { "include": "#graphql-selection-set" }, + { "include": "#graphql-skip-newlines" } + ] + }, + "graphql-fragment-spread": { + "begin": "\\s*(\\.\\.\\.)\\s*(?!\\bon\\b)([_A-Za-z][_0-9A-Za-z]*)", + "end": "(?=.)", + "applyEndPatternLast": 1, + "captures": { + "1": { "name": "keyword.operator.spread.graphql" }, + "2": { "name": "variable.fragment.graphql" } + }, + "patterns": [ + { "include": "#graphql-comment" }, + { "include": "#graphql-selection-set" }, + { "include": "#graphql-directive" }, + { "include": "#graphql-skip-newlines" } + ] + }, + "graphql-inline-fragment": { + "begin": "\\s*(\\.\\.\\.)\\s*(?:(\\bon\\b)\\s*([_A-Za-z][_0-9A-Za-z]*))?", + "end": "(?=.)", + "applyEndPatternLast": 1, + "captures": { + "1": { "name": "keyword.operator.spread.graphql" }, + "2": { "name": "keyword.on.graphql" }, + "3": { "name": "support.type.graphql" } + }, + "patterns": [ + { "include": "#graphql-comment" }, + { "include": "#graphql-selection-set" }, + { "include": "#graphql-directive" }, + { "include": "#graphql-skip-newlines" } + ] + }, + "graphql-arguments": { + "name": "meta.arguments.graphql", + "begin": "\\s*(\\()", + "end": "\\s*(\\))", + "beginCaptures": { + "1": { "name": "meta.brace.round.directive.graphql" } + }, + "endCaptures": { + "1": { "name": "meta.brace.round.directive.graphql" } + }, + "patterns": [ + { "include": "#graphql-comment" }, + { + "begin": "\\s*([_A-Za-z][_0-9A-Za-z]*)(?:\\s*(:))?", + "end": "(?=\\s*(?:(?:([_A-Za-z][_0-9A-Za-z]*)\\s*(:))|\\)))|\\s*(,)", + "beginCaptures": { + "1": { "name": "variable.arguments.graphql" }, + "2": { "name": "punctuation.colon.graphql" } + }, + "endCaptures": { + "3": { "name": "punctuation.comma.graphql" } + }, + "patterns": [ + { "include": "#graphql-value" }, + { "include": "#graphql-comment" }, + { "include": "#graphql-skip-newlines" } + ] + } + ] + }, + "graphql-variable-name": { + "match": "\\s*(\\$[_A-Za-z][_0-9A-Za-z]*)", + "captures": { + "1": { "name": "variable.graphql" } + } + }, + "graphql-int-value": { + "match": "\\s*((-)?(0|[1-9][0-9]*))", + "captures": { + "1": { "name": "constant.int.graphql" } + } + }, + "graphql-float-value": { + "match": "\\s*((-)?(0|([1-9]\\d*)(\\.\\d*)?((e|E)(\\+|-)?\\d*)?))", + "captures": { + "1": { "name": "constant.float.graphql" } + } + }, + "graphql-boolean-value": { + "match": "\\s*\\b(true|false)\\b", + "captures": { + "1": { "name": "constant.boolean.graphql" } + } + }, + "graphql-blockstring-value": { + "contentName": "string.quoted.block.graphql", + "begin": "\\s*+((\"\"\"))", + "end": "\\s*+(?:((\"\"\")))", + "beginCaptures": { + "1": { "name": "string.quoted.block.graphql" }, + "2": { "name": "punctuation.definition.string.begin.graphql" } + }, + "endCaptures": { + "1": { "name": "string.quoted.block.graphql" }, + "2": { "name": "punctuation.definition.string.end.graphql" } + }, + "patterns": [ + { "include": "#graphql-string-content" } + ] + }, + "graphql-string-value": { + "contentName": "string.quoted.double.graphql", + "begin": "\\s*+((\"))", + "end": "\\s*+(?:((\"))|(\n))", + "beginCaptures": { + "1": { "name": "string.quoted.double.graphql" }, + "2": { "name": "punctuation.definition.string.begin.graphql" } + }, + "endCaptures": { + "1": { "name": "string.quoted.double.graphql" }, + "2": { "name": "punctuation.definition.string.end.graphql" }, + "3": { "name": "invalid.illegal.newline.graphql" } + }, + "patterns": [ + { "include": "#graphql-string-content" } + ] + }, + "graphql-string-content": { + "patterns": [ + { "name": "constant.character.escape.graphql", + "match": "\\\\[/'\"\\\\nrtbf]" + }, + { "name": "constant.character.escape.graphql", + "match": "\\\\u([0-9a-fA-F]{4})" + } + ] + }, + "graphql-enum": { + "name": "meta.enum.graphql", + "begin": "\\s*+\\b(enum)\\b\\s*([_A-Za-z][_0-9A-Za-z]*)", + "end": "(?<=})", + "beginCaptures": { + "1": { "name": "keyword.enum.graphql" }, + "2": { "name": "support.type.enum.graphql" } + }, + "patterns": [ + { + "name": "meta.type.object.graphql", + "begin": "\\s*({)", + "end": "\\s*(})", + "beginCaptures": { + "1": { "name": "punctuation.operation.graphql"} + }, + "endCaptures": { + "1": { "name": "punctuation.operation.graphql"} + }, + "patterns": [ + { "include": "#graphql-object-type" }, + { "include": "#graphql-comment" }, + { "include": "#graphql-enum-value" }, + { "include": "#graphql-blockstring-value"}, + { "include": "#graphql-string-value"} + ] + } + ] + }, + "graphql-enum-value": { + "name": "constant.character.enum.graphql", + "match":"\\s*(?!=\\b(true|false|null)\\b)([_A-Za-z][_0-9A-Za-z]*)" + }, + "graphql-value":{ + "patterns": [ + { "include": "#graphql-variable-name" }, + { "include": "#graphql-float-value" }, + { "include": "#graphql-int-value" }, + { "include": "#graphql-blockstring-value" }, + { "include": "#graphql-string-value" }, + { "include": "#graphql-boolean-value" }, + { "include": "#graphql-enum-value" }, + { "include": "#graphql-list-value" }, + { "include": "#graphql-object-value" }, + { "include": "#graphql-comment" }, + { "include": "#literal-quasi-embedded" } + ] + }, + "graphql-list-value": { + "patterns": [ + { + "name": "meta.listvalues.graphql", + "begin": "\\s*+(\\[)", + "end": "\\s*(\\])", + "endCaptures": { + "1": { "name": "meta.brace.square.graphql" } + }, + "beginCaptures": { + "1": { "name": "meta.brace.square.graphql" } + }, + "patterns": [ + { "include": "#graphql-value" } + ] + } + ] + }, + "graphql-object-value": { + "patterns": [ + { + "name": "meta.objectvalues.graphql", + "begin": "\\s*+({)", + "end": "\\s*(})", + "endCaptures": { + "1": { "name": "meta.brace.curly.graphql" } + }, + "beginCaptures": { + "1": { "name": "meta.brace.curly.graphql" } + }, + "patterns": [ + { "include": "#graphql-object-field" }, + { "include": "#graphql-value" } + ] + } + ] + }, + "graphql-object-field": { + "match": "\\s*(([_A-Za-z][_0-9A-Za-z]*))\\s*(:)", + "captures": { + "1": { "name": "constant.object.key.graphql" }, + "2": { "name": "string.unquoted.graphql" }, + "3": { "name": "punctuation.graphql" } + } + }, + "graphql-union": { + "begin": "\\s*\\b(union)\\b\\s*([_A-Za-z][_0-9A-Za-z]*)", + "end": "(?=.)", + "applyEndPatternLast": 1, + "captures": { + "1": { "name": "keyword.union.graphql" }, + "2": { "name": "support.type.graphql" } + }, + "patterns": [ + { + "begin": "\\s*(=)\\s*([_A-Za-z][_0-9A-Za-z]*)", + "end": "(?=.)", + "applyEndPatternLast": 1, + "captures": { + "1": { "name": "punctuation.assignment.graphql" }, + "2": { "name": "support.type.graphql" } + }, + "patterns": [ + { "include": "#graphql-skip-newlines" }, + { "include": "#graphql-comment" }, + { + "match": "\\s*(\\|)\\s*([_A-Za-z][_0-9A-Za-z]*)", + "captures": { + "1": { "name": "punctuation.or.graphql" }, + "2": { "name": "support.type.graphql" } + } + } + ] + }, + { "include": "#graphql-skip-newlines" }, + { "include": "#graphql-comment" }, + { "include": "#literal-quasi-embedded" } + ] + }, + "graphql-skip-newlines": { + "match": "\\s*\n" + } + } +} diff --git a/data/source.java-properties.json b/data/source.java-properties.json new file mode 100644 index 0000000..b218398 --- /dev/null +++ b/data/source.java-properties.json @@ -0,0 +1,85 @@ +{ + "scopeName": "source.java-properties", + "name": "Java Properties", + "fileTypes": [ + "properties" + ], + "foldingStartMarker": "^[a-zA-Z0-9.-_]+=.*\\\n", + "foldingStopMarker": "^(.*(?=|<|>)|\\b(eq|ne|le|ge|lt|gt)\\b)" + }, + { + "name": "keyword.operator.empty.java.el", + "match": "\\b(empty)\\b" + }, + { + "name": "keyword.operator.arithmetic.java.el", + "match": "(?:(\\-|\\+|\\*|\\/|%)|\\b(div|mod)\\b)" + }, + { + "name": "keyword.operator.logical.java.el", + "match": "(?:(!|&&|\\|\\|)|\\b(not|and|or)\\b)" + }, + { + "name": "namespace.java.el", + "match": "[a-zA-Z]+(:)", + "captures": { + "1": { + "name": "punctuation.separator.namespace.java.el" + } + } + }, + { + "match": ",", + "name": "meta.delimiter.java.el" + }, + { + "match": "\\(|\\)", + "name": "meta.brace.round.java.el" + }, + { + "match": "\\[|\\]", + "name": "meta.brace.square.java.el" + }, + { + "name": "constant.boolean.java.el", + "match": "\\b(true|false)\\b" + }, + { + "name": "constant.null.java.el", + "match": "\\bnull\\b" + }, + { + "name": "constant.numeric.java.el", + "match": "\\b([0-9]+\\.[0-9]+|[0-9]+)\\b" + }, + { + "name": "string.quoted.single.java.el", + "begin": "'", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.java.el" + } + }, + "end": "'", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.java.el" + } + }, + "patterns": [ + { + "name": "constant.character.escape.java.el", + "match": "\\\\." + } + ] + }, + { + "name": "string.quoted.double.java.el", + "begin": "\"", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.java.el" + } + }, + "end": "\"", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.java.el" + } + }, + "patterns": [ + { + "name": "constant.character.escape.java.el", + "match": "\\\\." + } + ] + } + ] +} diff --git a/data/source.java.json b/data/source.java.json new file mode 100644 index 0000000..0fd2a86 --- /dev/null +++ b/data/source.java.json @@ -0,0 +1,1853 @@ +{ + "scopeName": "source.java", + "name": "Java", + "fileTypes": [ + "java", + "bsh" + ], + "patterns": [ + { + "begin": "\\b(package)\\b\\s*", + "beginCaptures": { + "1": { + "name": "keyword.other.package.java" + } + }, + "end": "\\s*(;)", + "endCaptures": { + "1": { + "name": "punctuation.terminator.java" + } + }, + "name": "meta.package.java", + "contentName": "storage.modifier.package.java", + "patterns": [ + { + "include": "#comments" + }, + { + "match": "(?<=\\.)\\s*\\.|\\.(?=\\s*;)", + "name": "invalid.illegal.character_not_allowed_here.java" + }, + { + "match": "(?", + "endCaptures": { + "0": { + "name": "punctuation.bracket.angle.java" + } + }, + "patterns": [ + { + "match": "\\b(extends|super)\\b", + "name": "storage.modifier.$1.java" + }, + { + "match": "(?>>?|~|\\^)", + "name": "keyword.operator.bitwise.java" + }, + { + "match": "((&|\\^|\\||<<|>>>?)=)", + "name": "keyword.operator.assignment.bitwise.java" + }, + { + "match": "(===?|!=|<=|>=|<>|<|>)", + "name": "keyword.operator.comparison.java" + }, + { + "match": "([+*/%-]=)", + "name": "keyword.operator.assignment.arithmetic.java" + }, + { + "match": "(=)", + "name": "keyword.operator.assignment.java" + }, + { + "match": "(\\-\\-|\\+\\+)", + "name": "keyword.operator.increment-decrement.java" + }, + { + "match": "(\\-|\\+|\\*|\\/|%)", + "name": "keyword.operator.arithmetic.java" + }, + { + "match": "(!|&&|\\|\\|)", + "name": "keyword.operator.logical.java" + }, + { + "match": "(\\||&)", + "name": "keyword.operator.bitwise.java" + }, + { + "match": "\\b(const|goto)\\b", + "name": "keyword.reserved.java" + } + ] + }, + "lambda-expression": { + "patterns": [ + { + "match": "->", + "name": "storage.type.function.arrow.java" + } + ] + }, + "member-variables": { + "begin": "(?=private|protected|public|native|synchronized|abstract|threadsafe|transient|static|final)", + "end": "(?=\\=|;)", + "patterns": [ + { + "include": "#storage-modifiers" + }, + { + "include": "#variables" + }, + { + "include": "#primitive-arrays" + }, + { + "include": "#object-types" + } + ] + }, + "method-call": { + "begin": "(\\.)\\s*([A-Za-z_$][\\w$]*)\\s*(\\()", + "beginCaptures": { + "1": { + "name": "punctuation.separator.period.java" + }, + "2": { + "name": "entity.name.function.java" + }, + "3": { + "name": "punctuation.definition.parameters.begin.bracket.round.java" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.definition.parameters.end.bracket.round.java" + } + }, + "name": "meta.method-call.java", + "patterns": [ + { + "include": "#code" + } + ] + }, + "methods": { + "begin": "(?!new)(?=[\\w<].*\\s+)(?=([^=/]|/(?!/))+\\()", + "end": "(})|(?=;)", + "endCaptures": { + "1": { + "name": "punctuation.section.method.end.bracket.curly.java" + } + }, + "name": "meta.method.java", + "patterns": [ + { + "include": "#storage-modifiers" + }, + { + "begin": "(\\w+)\\s*(\\()", + "beginCaptures": { + "1": { + "name": "entity.name.function.java" + }, + "2": { + "name": "punctuation.definition.parameters.begin.bracket.round.java" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.definition.parameters.end.bracket.round.java" + } + }, + "name": "meta.method.identifier.java", + "patterns": [ + { + "include": "#parameters" + }, + { + "include": "#parens" + }, + { + "include": "#comments" + } + ] + }, + { + "include": "#generics" + }, + { + "begin": "(?=\\w.*\\s+\\w+\\s*\\()", + "end": "(?=\\s+\\w+\\s*\\()", + "name": "meta.method.return-type.java", + "patterns": [ + { + "include": "#all-types" + }, + { + "include": "#parens" + }, + { + "include": "#comments" + } + ] + }, + { + "include": "#throws" + }, + { + "begin": "{", + "beginCaptures": { + "0": { + "name": "punctuation.section.method.begin.bracket.curly.java" + } + }, + "end": "(?=})", + "contentName": "meta.method.body.java", + "patterns": [ + { + "include": "#code" + } + ] + }, + { + "include": "#comments" + } + ] + }, + "module": { + "begin": "((open)\\s)?(module)\\s+(\\w+)", + "end": "}", + "beginCaptures": { + "1": { + "name": "storage.modifier.java" + }, + "3": { + "name": "storage.modifier.java" + }, + "4": { + "name": "entity.name.type.module.java" + } + }, + "endCaptures": { + "0": { + "name": "punctuation.section.module.end.bracket.curly.java" + } + }, + "name": "meta.module.java", + "patterns": [ + { + "begin": "{", + "beginCaptures": { + "0": { + "name": "punctuation.section.module.begin.bracket.curly.java" + } + }, + "end": "(?=})", + "contentName": "meta.module.body.java", + "patterns": [ + { + "include": "#comments" + }, + { + "include": "#comments-javadoc" + }, + { + "match": "\\b(requires|transitive|exports|opens|to|uses|provides|with)\\b", + "name": "keyword.module.java" + } + ] + } + ] + }, + "numbers": { + "patterns": [ + { + "match": "(?x)\n\\b(?)?(\\()", + "beginCaptures": { + "1": { + "name": "storage.modifier.java" + }, + "2": { + "name": "entity.name.type.record.java" + }, + "3": { + "patterns": [ + { + "include": "#generics" + } + ] + }, + "4": { + "name": "punctuation.definition.parameters.begin.bracket.round.java" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.definition.parameters.end.bracket.round.java" + } + }, + "name": "meta.record.identifier.java", + "patterns": [ + { + "include": "#code" + } + ] + }, + { + "begin": "(implements)\\s", + "beginCaptures": { + "1": { + "name": "storage.modifier.implements.java" + } + }, + "end": "(?=\\s*\\{)", + "name": "meta.definition.class.implemented.interfaces.java", + "patterns": [ + { + "include": "#object-types-inherited" + }, + { + "include": "#comments" + } + ] + }, + { + "include": "#record-body" + } + ] + }, + "record-body": { + "begin": "{", + "beginCaptures": { + "0": { + "name": "punctuation.section.class.begin.bracket.curly.java" + } + }, + "end": "(?=})", + "name": "meta.record.body.java", + "patterns": [ + { + "include": "#record-constructor" + }, + { + "include": "#class-body" + } + ] + }, + "record-constructor": { + "begin": "(?!new)(?=[\\w<].*\\s+)(?=([^\\(=/]|/(?!/))+(?={))", + "end": "(})|(?=;)", + "endCaptures": { + "1": { + "name": "punctuation.section.method.end.bracket.curly.java" + } + }, + "name": "meta.method.java", + "patterns": [ + { + "include": "#storage-modifiers" + }, + { + "begin": "(\\w+)", + "beginCaptures": { + "1": { + "name": "entity.name.function.java" + } + }, + "end": "(?=\\s*{)", + "name": "meta.method.identifier.java", + "patterns": [ + { + "include": "#comments" + } + ] + }, + { + "include": "#comments" + }, + { + "begin": "{", + "beginCaptures": { + "0": { + "name": "punctuation.section.method.begin.bracket.curly.java" + } + }, + "end": "(?=})", + "contentName": "meta.method.body.java", + "patterns": [ + { + "include": "#code" + } + ] + } + ] + }, + "static-initializer": { + "patterns": [ + { + "include": "#anonymous-block-and-instance-initializer" + }, + { + "match": "static", + "name": "storage.modifier.java" + } + ] + }, + "storage-modifiers": { + "match": "\\b(public|private|protected|static|final|native|synchronized|abstract|threadsafe|transient|volatile|default|strictfp|sealed|non-sealed)\\b", + "name": "storage.modifier.java" + }, + "strings": { + "patterns": [ + { + "begin": "\"", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.java" + } + }, + "end": "\"", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.java" + } + }, + "name": "string.quoted.double.java", + "patterns": [ + { + "match": "\\\\.", + "name": "constant.character.escape.java" + } + ] + }, + { + "begin": "'", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.java" + } + }, + "end": "'", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.java" + } + }, + "name": "string.quoted.single.java", + "patterns": [ + { + "match": "\\\\.", + "name": "constant.character.escape.java" + } + ] + } + ] + }, + "throws": { + "begin": "throws", + "beginCaptures": { + "0": { + "name": "storage.modifier.java" + } + }, + "end": "(?={|;)", + "name": "meta.throwables.java", + "patterns": [ + { + "match": ",", + "name": "punctuation.separator.delimiter.java" + }, + { + "match": "[a-zA-Z$_][\\.a-zA-Z0-9$_]*", + "name": "storage.type.java" + } + ] + }, + "try-catch-finally": { + "patterns": [ + { + "begin": "\\btry\\b", + "beginCaptures": { + "0": { + "name": "keyword.control.try.java" + } + }, + "end": "}", + "endCaptures": { + "0": { + "name": "punctuation.section.try.end.bracket.curly.java" + } + }, + "name": "meta.try.java", + "patterns": [ + { + "begin": "\\(", + "beginCaptures": { + "0": { + "name": "punctuation.section.try.resources.begin.bracket.round.java" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.section.try.resources.end.bracket.round.java" + } + }, + "name": "meta.try.resources.java", + "patterns": [ + { + "include": "#code" + } + ] + }, + { + "begin": "{", + "beginCaptures": { + "0": { + "name": "punctuation.section.try.begin.bracket.curly.java" + } + }, + "end": "(?=})", + "contentName": "meta.try.body.java", + "patterns": [ + { + "include": "#code" + } + ] + } + ] + }, + { + "begin": "\\b(catch)\\b", + "beginCaptures": { + "1": { + "name": "keyword.control.catch.java" + } + }, + "end": "}", + "endCaptures": { + "0": { + "name": "punctuation.section.catch.end.bracket.curly.java" + } + }, + "name": "meta.catch.java", + "patterns": [ + { + "include": "#comments" + }, + { + "begin": "\\(", + "beginCaptures": { + "0": { + "name": "punctuation.definition.parameters.begin.bracket.round.java" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.definition.parameters.end.bracket.round.java" + } + }, + "contentName": "meta.catch.parameters.java", + "patterns": [ + { + "include": "#comments" + }, + { + "include": "#storage-modifiers" + }, + { + "begin": "[a-zA-Z$_][\\.a-zA-Z0-9$_]*", + "beginCaptures": { + "0": { + "name": "storage.type.java" + } + }, + "end": "(\\|)|(?=\\))", + "endCaptures": { + "1": { + "name": "punctuation.catch.separator.java" + } + }, + "patterns": [ + { + "include": "#comments" + }, + { + "match": "\\w+", + "captures": { + "0": { + "name": "variable.parameter.java" + } + } + } + ] + } + ] + }, + { + "begin": "{", + "beginCaptures": { + "0": { + "name": "punctuation.section.catch.begin.bracket.curly.java" + } + }, + "end": "(?=})", + "contentName": "meta.catch.body.java", + "patterns": [ + { + "include": "#code" + } + ] + } + ] + }, + { + "begin": "\\bfinally\\b", + "beginCaptures": { + "0": { + "name": "keyword.control.finally.java" + } + }, + "end": "}", + "endCaptures": { + "0": { + "name": "punctuation.section.finally.end.bracket.curly.java" + } + }, + "name": "meta.finally.java", + "patterns": [ + { + "begin": "{", + "beginCaptures": { + "0": { + "name": "punctuation.section.finally.begin.bracket.curly.java" + } + }, + "end": "(?=})", + "contentName": "meta.finally.body.java", + "patterns": [ + { + "include": "#code" + } + ] + } + ] + } + ] + }, + "variables": { + "begin": "(?x)\n(?=\n \\b\n (\n (void|boolean|byte|char|short|int|float|long|double)\n |\n (?>(\\w+\\.)*[A-Z_]+\\w*) # e.g. `javax.ws.rs.Response`, or `String`\n )\n \\b\n \\s*\n (\n <[\\w<>,\\.?\\s\\[\\]]*> # e.g. `HashMap`, or `List`\n )?\n \\s*\n (\n (\\[\\])* # int[][]\n )?\n \\s+\n [A-Za-z_$][\\w$]* # At least one identifier after space\n ([\\w\\[\\],$][\\w\\[\\],\\s]*)? # possibly primitive array or additional identifiers\n \\s*(=|:|;)\n)", + "end": "(?=\\=|:|;)", + "name": "meta.definition.variable.java", + "patterns": [ + { + "match": "([A-Za-z$_][\\w$]*)(?=\\s*(\\[\\])*\\s*(;|:|=|,))", + "captures": { + "1": { + "name": "variable.other.definition.java" + } + } + }, + { + "include": "#all-types" + }, + { + "include": "#code" + } + ] + }, + "variables-local": { + "begin": "(?=\\b(var)\\b\\s+[A-Za-z_$][\\w$]*\\s*(=|:|;))", + "end": "(?=\\=|:|;)", + "name": "meta.definition.variable.local.java", + "patterns": [ + { + "match": "\\bvar\\b", + "name": "storage.type.local.java" + }, + { + "match": "([A-Za-z$_][\\w$]*)(?=\\s*(\\[\\])*\\s*(=|:|;))", + "captures": { + "1": { + "name": "variable.other.definition.java" + } + } + }, + { + "include": "#code" + } + ] + } + } +} diff --git a/data/source.json.json b/data/source.json.json new file mode 100644 index 0000000..5cf2f4d --- /dev/null +++ b/data/source.json.json @@ -0,0 +1,182 @@ +{ + "scopeName": "source.json", + "name": "JSON", + "fileTypes": [ + "avsc", + "babelrc", + "bowerrc", + "composer.lock", + "geojson", + "gltf", + "htmlhintrc", + "ipynb", + "jscsrc", + "jshintrc", + "jslintrc", + "json", + "jsonl", + "jsonld", + "languagebabel", + "ldj", + "ldjson", + "Pipfile.lock", + "schema", + "stylintrc", + "template", + "tern-config", + "tern-project", + "tfstate", + "tfstate.backup", + "topojson", + "webapp", + "webmanifest" + ], + "patterns": [ + { + "include": "#value" + } + ], + "repository": { + "array": { + "begin": "\\[", + "beginCaptures": { + "0": { + "name": "punctuation.definition.array.begin.json" + } + }, + "end": "(,)?[\\s\\n]*(\\])", + "endCaptures": { + "1": { + "name": "invalid.illegal.trailing-array-separator.json" + }, + "2": { + "name": "punctuation.definition.array.end.json" + } + }, + "name": "meta.structure.array.json", + "patterns": [ + { + "include": "#value" + }, + { + "match": ",", + "name": "punctuation.separator.array.json" + }, + { + "match": "[^\\s\\]]", + "name": "invalid.illegal.expected-array-separator.json" + } + ] + }, + "constant": { + "match": "\\b(true|false|null)\\b", + "name": "constant.language.json" + }, + "number": { + "match": "-?(?=[1-9]|0(?!\\d))\\d+(\\.\\d+)?([eE][+-]?\\d+)?", + "name": "constant.numeric.json" + }, + "object": { + "begin": "{", + "beginCaptures": { + "0": { + "name": "punctuation.definition.dictionary.begin.json" + } + }, + "end": "}", + "endCaptures": { + "0": { + "name": "punctuation.definition.dictionary.end.json" + } + }, + "name": "meta.structure.dictionary.json", + "patterns": [ + { + "begin": "(?=\")", + "end": "(?<=\")", + "name": "meta.structure.dictionary.key.json", + "patterns": [ + { + "include": "#string" + } + ] + }, + { + "begin": ":", + "beginCaptures": { + "0": { + "name": "punctuation.separator.dictionary.key-value.json" + } + }, + "end": "(,)(?=[\\s\\n]*})|(,)|(?=})", + "endCaptures": { + "1": { + "name": "invalid.illegal.trailing-dictionary-separator.json" + }, + "2": { + "name": "punctuation.separator.dictionary.pair.json" + } + }, + "name": "meta.structure.dictionary.value.json", + "patterns": [ + { + "include": "#value" + }, + { + "match": "[^\\s,]", + "name": "invalid.illegal.expected-dictionary-separator.json" + } + ] + }, + { + "match": "[^\\s}]", + "name": "invalid.illegal.expected-dictionary-separator.json" + } + ] + }, + "string": { + "begin": "\"", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.json" + } + }, + "end": "\"", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.json" + } + }, + "name": "string.quoted.double.json", + "patterns": [ + { + "match": "(?x)\n\\\\ # a literal backslash\n( # followed by\n [\"\\\\/bfnrt] # one of these characters\n | # or\n u[0-9a-fA-F]{4} # a u and four hex digits\n)", + "name": "constant.character.escape.json" + }, + { + "match": "\\\\.", + "name": "invalid.illegal.unrecognized-string-escape.json" + } + ] + }, + "value": { + "patterns": [ + { + "include": "#constant" + }, + { + "include": "#number" + }, + { + "include": "#string" + }, + { + "include": "#array" + }, + { + "include": "#object" + } + ] + } + } +} diff --git a/data/source.litcoffee.json b/data/source.litcoffee.json new file mode 100644 index 0000000..9de44bf --- /dev/null +++ b/data/source.litcoffee.json @@ -0,0 +1,668 @@ +{ + "comment": "CoffeeScript (Literate)", + "fileTypes": [ + "litcoffee", + "litcoffee.erb", + "coffee.md" + ], + "name": "CoffeeScript (Literate)", + "scopeName": "source.litcoffee", + "firstLineMatch": "(?x)\n# Hashbang\n^\\#!.*(?:\\s|\\/)\n coffee(?:\\s.+?)?\\s(?:-l|--literate)\n(?:\\s|$)\n|\n# Modeline\n(?i:\n # Emacs\n -\\*-(?:\\s*(?=[^:;\\s]+\\s*-\\*-)|(?:.*?[;\\s]|(?<=-\\*-))mode\\s*:\\s*)\n litcoffee\n (?=[\\s;]|(?]?\\d+|m)?|\\sex)(?=:(?=\\s*set?\\s[^\\n:]+:)|:(?!\\s*set?\\s))(?:(?:\\s|\\s*:\\s*)\\w*(?:\\s*=(?:[^\\n\\\\\\s]|\\\\.)*)?)*[\\s:](?:filetype|ft|syntax)\\s*=\n litcoffee\n (?=\\s|:|$)\n)", + "patterns": [ + { + "begin": "^(?=([ ]{4}|\\t)(?!$))", + "end": "^(?!([ ]{4}|\\t))", + "name": "markup.raw.block.markdown", + "patterns": [ + { + "include": "#block_raw" + } + ] + }, + { + "begin": "(?x)^\n(?= [ ]{0,3}>.\n| [#]{1,6}\\s*+\n| [ ]{0,3}(?[-*_])([ ]{0,2}\\k){2,}[ \\t]*+$\n)", + "comment": "We could also use an empty end match and set applyEndPatternLast, but then we must be sure that the begin pattern will only match stuff matched by the sub-patterns.", + "end": "(?x)^\n(?! [ ]{0,3}>.\n| [#]{1,6}\\s*+\n| [ ]{0,3}(?[-*_])([ ]{0,2}\\k){2,}[ \\t]*+$\n)", + "name": "meta.block-level.markdown", + "patterns": [ + { + "include": "#block_quote" + }, + { + "include": "#heading" + }, + { + "include": "#separator" + } + ] + }, + { + "begin": "^[ ]{0,3}([*+-])(?=\\s)", + "captures": { + "1": { + "name": "punctuation.definition.list_item.markdown" + } + }, + "end": "^(?=\\S|[ ]{4,})|(?!\\G)", + "name": "markup.list.unnumbered.markdown", + "patterns": [ + { + "include": "#list-paragraph" + } + ] + }, + { + "begin": "^[ ]{0,3}([0-9]+\\.)(?=\\s)", + "captures": { + "1": { + "name": "punctuation.definition.list_item.markdown" + } + }, + "end": "^(?=\\S|[ ]{4,})|(?!\\G)", + "name": "markup.list.numbered.markdown", + "patterns": [ + { + "include": "#list-paragraph" + } + ] + }, + { + "begin": "^(?=<(p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math|ins|del)\\b)(?!.*?)", + "comment": "Markdown formatting is disabled inside block-level tags.", + "end": "(?<=^$\\n)", + "name": "meta.disable-markdown", + "patterns": [ + { + "include": "text.html.basic" + } + ] + }, + { + "begin": "^(?=<(p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math|ins|del)\\b)", + "comment": "Same rule but for one line disables.", + "end": "$\\n?", + "name": "meta.disable-markdown", + "patterns": [ + { + "include": "text.html.basic" + } + ] + }, + { + "captures": { + "1": { + "name": "punctuation.definition.constant.markdown" + }, + "2": { + "name": "constant.other.reference.link.markdown" + }, + "3": { + "name": "punctuation.definition.constant.markdown" + }, + "4": { + "name": "punctuation.separator.key-value.markdown" + }, + "5": { + "name": "punctuation.definition.link.markdown" + }, + "6": { + "name": "markup.underline.link.markdown" + }, + "7": { + "name": "punctuation.definition.link.markdown" + }, + "8": { + "name": "string.other.link.description.title.markdown" + }, + "9": { + "name": "punctuation.definition.string.begin.markdown" + }, + "10": { + "name": "punctuation.definition.string.end.markdown" + }, + "11": { + "name": "string.other.link.description.title.markdown" + }, + "12": { + "name": "punctuation.definition.string.begin.markdown" + }, + "13": { + "name": "punctuation.definition.string.end.markdown" + } + }, + "match": "(?x)\n\\s* # Leading whitespace\n(\\[)(.+?)(\\])(:) # Reference name\n[ \\t]* # Optional whitespace\n(?) # The url\n[ \\t]* # Optional whitespace\n(?:\n ((\\().+?(\\))) # Match title in quotes…\n | ((\").+?(\")) # or in parens.\n)? # Title is optional\n\\s* # Optional whitespace\n$", + "name": "meta.link.reference.def.markdown" + }, + { + "begin": "^(?=\\S)(?![=-]{3,}(?=$))", + "end": "^(?:\\s*$|(?=[ ]{0,3}>.))|(?=[ \\t]*\\n)(?<=^===|^====|=====|^---|^----|-----)[ \\t]*\\n|(?=^#)", + "name": "meta.paragraph.markdown", + "patterns": [ + { + "include": "#inline" + }, + { + "include": "text.html.basic" + }, + { + "captures": { + "1": { + "name": "punctuation.definition.heading.markdown" + } + }, + "match": "^(={3,})(?=[ \\t]*$)", + "name": "markup.heading.1.markdown" + }, + { + "captures": { + "1": { + "name": "punctuation.definition.heading.markdown" + } + }, + "match": "^(-{3,})(?=[ \\t]*$)", + "name": "markup.heading.2.markdown" + } + ] + } + ], + "repository": { + "ampersand": { + "comment": "Markdown will convert this for us. We match it so that the HTML grammar will not mark it up as invalid.", + "match": "&(?!([a-zA-Z0-9]+|#[0-9]+|#x[0-9a-fA-F]+);)", + "name": "meta.other.valid-ampersand.markdown" + }, + "block_quote": { + "begin": "\\G[ ]{0,3}(>)(?!$)[ ]?", + "beginCaptures": { + "1": { + "name": "punctuation.definition.blockquote.markdown" + } + }, + "comment": " We terminate the block quote when seeing an empty line, a separator or a line with leading > characters. The latter is to “reset” the quote level for quoted lines.", + "end": "(?x)^\n(?= \\s*$\n| [ ]{0,3}(?[-*_])([ ]{0,2}\\k){2,}[ \\t]*+$\n| [ ]{0,3}>.\n)", + "name": "markup.quote.markdown", + "patterns": [ + { + "begin": "(?x)\\G\n(?= [ ]{0,3}>.\n)", + "end": "^", + "patterns": [ + { + "include": "#block_quote" + } + ] + }, + { + "applyEndPatternLast": 1, + "begin": "(?x)\\G\n(?= ([ ]{4}|\\t)\n| [#]{1,6}\\s*+\n| [ ]{0,3}(?[-*_])([ ]{0,2}\\k){2,}[ \\t]*+$\n)", + "end": "^", + "patterns": [ + { + "include": "#block_raw" + }, + { + "include": "#heading" + }, + { + "include": "#separator" + } + ] + }, + { + "begin": "(?x)\\G\n(?! $\n| [ ]{0,3}>.\n| ([ ]{4}|\\t)\n| [#]{1,6}\\s*+\n| [ ]{0,3}(?[-*_])([ ]{0,2}\\k){2,}[ \\t]*+$\n)", + "end": "$|(?<=\\n)", + "patterns": [ + { + "include": "#inline" + } + ] + } + ] + }, + "block_raw": { + "name": "markup.raw.block.markdown", + "patterns": [ + { + "include": "#coffee_script" + } + ] + }, + "bold": { + "begin": "(?x)\n(\\*\\*|__)(?=\\S) # Open\n(?=\n (\n <[^>]*+> # HTML tags\n | (?`+)([^`]|(?!(?(?!`))`)*+\\k # Raw\n | \\\\[\\\\`*_{}\\[\\]()#.!+\\->]?+ # Escapes\n | \\[\n (\n (? # Named group\n [^\\[\\]\\\\] # Match most chars\n | \\\\. # Escaped chars\n | \\[ \\g*+ \\] # Nested brackets\n )*+\n \\]\n (\n ( # Reference Link\n [ ]? # Optional space\n \\[[^\\]]*+\\] # Ref name\n )\n |\n ( # Inline Link\n \\( # Opening paren\n [ \\t]*+ # Optional whitespace\n ? # URL\n [ \\t]*+ # Optional whitespace\n ( # Optional Title\n (?['\"])\n (.*?)\n \\k<title>\n )?\n \\)\n )\n )\n )\n | (?!(?<=\\S)\\1). # Everything besides\n )++\n (?<=\\S)\\1 # Close\n)", + "captures": { + "1": { + "name": "punctuation.definition.bold.markdown" + } + }, + "end": "(?<=\\S)(\\1)", + "name": "markup.bold.markdown", + "patterns": [ + { + "applyEndPatternLast": 1, + "begin": "(?=<[^>]*?>)", + "end": "(?<=>)", + "patterns": [ + { + "include": "text.html.basic" + } + ] + }, + { + "include": "#escape" + }, + { + "include": "#ampersand" + }, + { + "include": "#bracket" + }, + { + "include": "#raw" + }, + { + "include": "#italic" + }, + { + "include": "#image-inline" + }, + { + "include": "#link-inline" + }, + { + "include": "#link-inet" + }, + { + "include": "#link-email" + }, + { + "include": "#image-ref" + }, + { + "include": "#link-ref-literal" + }, + { + "include": "#link-ref" + } + ] + }, + "bracket": { + "comment": "Markdown will convert this for us. We match it so that the HTML grammar will not mark it up as invalid.", + "match": "<(?![a-z/?\\$!])", + "name": "meta.other.valid-bracket.markdown" + }, + "coffee_script": { + "patterns": [ + { + "include": "source.coffee" + } + ] + }, + "escape": { + "match": "\\\\[-`*_#+.!(){}\\[\\]\\\\>]", + "name": "constant.character.escape.markdown" + }, + "heading": { + "begin": "\\G(#{1,6})(?!#)\\s*(?=\\S)", + "captures": { + "1": { + "name": "punctuation.definition.heading.markdown" + } + }, + "contentName": "entity.name.section.markdown", + "end": "\\s*(#*)$\\n?", + "name": "markup.heading.markdown", + "patterns": [ + { + "include": "#inline" + } + ] + }, + "image-inline": { + "captures": { + "1": { + "name": "punctuation.definition.string.begin.markdown" + }, + "2": { + "name": "string.other.link.description.markdown" + }, + "3": { + "name": "punctuation.definition.string.end.markdown" + }, + "5": { + "name": "invalid.illegal.whitespace.markdown" + }, + "6": { + "name": "punctuation.definition.metadata.markdown" + }, + "7": { + "name": "punctuation.definition.link.markdown" + }, + "8": { + "name": "markup.underline.link.image.markdown" + }, + "9": { + "name": "punctuation.definition.link.markdown" + }, + "10": { + "name": "string.other.link.description.title.markdown" + }, + "11": { + "name": "punctuation.definition.string.markdown" + }, + "12": { + "name": "punctuation.definition.string.markdown" + }, + "13": { + "name": "string.other.link.description.title.markdown" + }, + "14": { + "name": "punctuation.definition.string.markdown" + }, + "15": { + "name": "punctuation.definition.string.markdown" + }, + "16": { + "name": "punctuation.definition.metadata.markdown" + } + }, + "match": "(?x)\n\\! # Images start with !\n(\\[)((?<square>[^\\[\\]\\\\]|\\\\.|\\[\\g<square>*+\\])*+)(\\]) # Match the link text\n([ ])? # Space not allowed\n(\\() # Opening paren for url\n(<?)(\\S+?)(>?) # The url\n[ \\t]* # Optional whitespace\n(?:\n ((\\().+?(\\))) # Match title in parens…\n | ((\").+?(\")) # or in quotes.\n)? # Title is optional\n\\s* # Optional whitespace\n(\\))", + "name": "meta.image.inline.markdown" + }, + "image-ref": { + "captures": { + "1": { + "name": "punctuation.definition.string.begin.markdown" + }, + "2": { + "name": "string.other.link.description.markdown" + }, + "4": { + "name": "punctuation.definition.string.begin.markdown" + }, + "5": { + "name": "punctuation.definition.constant.markdown" + }, + "6": { + "name": "constant.other.reference.link.markdown" + }, + "7": { + "name": "punctuation.definition.constant.markdown" + } + }, + "match": "\\!(\\[)((?<square>[^\\[\\]\\\\]|\\\\.|\\[\\g<square>*+\\])*+)(\\])[ ]?(\\[)(.*?)(\\])", + "name": "meta.image.reference.markdown" + }, + "inline": { + "patterns": [ + { + "include": "#escape" + }, + { + "include": "#ampersand" + }, + { + "include": "#bracket" + }, + { + "include": "#raw" + }, + { + "include": "#bold" + }, + { + "include": "#italic" + }, + { + "include": "#line-break" + }, + { + "include": "#image-inline" + }, + { + "include": "#link-inline" + }, + { + "include": "#link-inet" + }, + { + "include": "#link-email" + }, + { + "include": "#image-ref" + }, + { + "include": "#link-ref-literal" + }, + { + "include": "#link-ref" + } + ] + }, + "italic": { + "begin": "(?x)\n(\\*|_)(?=\\S) # Open\n(?=\n (\n <[^>]*+> # HTML tags\n | (?<raw>`+)([^`]|(?!(?<!`)\\k<raw>(?!`))`)*+\\k<raw> # Raw\n | \\\\[\\\\`*_{}\\[\\]()#.!+\\->]?+ # Escapes\n | \\[\n (\n (?<square> # Named group\n [^\\[\\]\\\\] # Match most chars\n | \\\\. # Escaped chars\n | \\[ \\g<square>*+ \\] # Nested brackets\n )*+\n \\]\n (\n ( # Reference Link\n [ ]? # Optional space\n \\[[^\\]]*+\\] # Ref name\n )\n |\n ( # Inline Link\n \\( # Opening paren\n [ \\t]*+ # Optional whitespace\n <?(.*?)>? # URL\n [ \\t]*+ # Optional whitespace\n ( # Optional Title\n (?<title>['\"])\n (.*?)\n \\k<title>\n )?\n \\)\n )\n )\n )\n | \\1\\1 # Must be bold closer\n | (?!(?<=\\S)\\1). # Everything besides\n )++\n (?<=\\S)\\1 # Close\n)", + "captures": { + "1": { + "name": "punctuation.definition.italic.markdown" + } + }, + "end": "(?<=\\S)(\\1)((?!\\1)|(?=\\1\\1))", + "name": "markup.italic.markdown", + "patterns": [ + { + "applyEndPatternLast": 1, + "begin": "(?=<[^>]*?>)", + "end": "(?<=>)", + "patterns": [ + { + "include": "text.html.basic" + } + ] + }, + { + "include": "#escape" + }, + { + "include": "#ampersand" + }, + { + "include": "#bracket" + }, + { + "include": "#raw" + }, + { + "include": "#bold" + }, + { + "include": "#image-inline" + }, + { + "include": "#link-inline" + }, + { + "include": "#link-inet" + }, + { + "include": "#link-email" + }, + { + "include": "#image-ref" + }, + { + "include": "#link-ref-literal" + }, + { + "include": "#link-ref" + } + ] + }, + "line-break": { + "match": " {2,}$", + "name": "meta.dummy.line-break" + }, + "link-email": { + "captures": { + "1": { + "name": "punctuation.definition.link.markdown" + }, + "2": { + "name": "markup.underline.link.markdown" + }, + "4": { + "name": "punctuation.definition.link.markdown" + } + }, + "match": "(<)((?:mailto:)?[-.\\w]+@[-a-z0-9]+(\\.[-a-z0-9]+)*\\.[a-z]+)(>)", + "name": "meta.link.email.lt-gt.markdown" + }, + "link-inet": { + "captures": { + "1": { + "name": "punctuation.definition.link.markdown" + }, + "2": { + "name": "markup.underline.link.markdown" + }, + "3": { + "name": "punctuation.definition.link.markdown" + } + }, + "match": "(<)((?:https?|ftp)://.*?)(>)", + "name": "meta.link.inet.markdown" + }, + "link-inline": { + "captures": { + "1": { + "name": "punctuation.definition.string.begin.markdown" + }, + "2": { + "name": "string.other.link.title.markdown" + }, + "4": { + "name": "punctuation.definition.string.end.markdown" + }, + "5": { + "name": "invalid.illegal.whitespace.markdown" + }, + "6": { + "name": "punctuation.definition.metadata.markdown" + }, + "7": { + "name": "punctuation.definition.link.markdown" + }, + "8": { + "name": "markup.underline.link.markdown" + }, + "9": { + "name": "punctuation.definition.link.markdown" + }, + "10": { + "name": "string.other.link.description.title.markdown" + }, + "11": { + "name": "punctuation.definition.string.begin.markdown" + }, + "12": { + "name": "punctuation.definition.string.end.markdown" + }, + "13": { + "name": "string.other.link.description.title.markdown" + }, + "14": { + "name": "punctuation.definition.string.begin.markdown" + }, + "15": { + "name": "punctuation.definition.string.end.markdown" + }, + "16": { + "name": "punctuation.definition.metadata.markdown" + } + }, + "match": "(?x)\n(\\[)((?<square>[^\\[\\]\\\\]|\\\\.|\\[\\g<square>*+\\])*+)(\\]) # Match the link text.\n([ ])? # Space not allowed\n(\\() # Opening paren for url\n(<?)(.*?)(>?) # The url\n[ \\t]* # Optional whitespace\n(?:\n ((\\().+?(\\))) # Match title in parens…\n | ((\").+?(\")) # or in quotes.\n)? # Title is optional\n\\s* # Optional whitespace\n(\\))", + "name": "meta.link.inline.markdown" + }, + "link-ref": { + "captures": { + "1": { + "name": "punctuation.definition.string.begin.markdown" + }, + "2": { + "name": "string.other.link.title.markdown" + }, + "4": { + "name": "punctuation.definition.string.end.markdown" + }, + "5": { + "name": "punctuation.definition.constant.begin.markdown" + }, + "6": { + "name": "constant.other.reference.link.markdown" + }, + "7": { + "name": "punctuation.definition.constant.end.markdown" + } + }, + "match": "(\\[)((?<square>[^\\[\\]\\\\]|\\\\.|\\[\\g<square>*+\\])*+)(\\])[ ]?(\\[)([^\\]]*+)(\\])", + "name": "meta.link.reference.markdown" + }, + "link-ref-literal": { + "captures": { + "1": { + "name": "punctuation.definition.string.begin.markdown" + }, + "2": { + "name": "string.other.link.title.markdown" + }, + "4": { + "name": "punctuation.definition.string.end.markdown" + }, + "5": { + "name": "punctuation.definition.constant.begin.markdown" + }, + "6": { + "name": "punctuation.definition.constant.end.markdown" + } + }, + "match": "(\\[)((?<square>[^\\[\\]\\\\]|\\\\.|\\[\\g<square>*+\\])*+)(\\])[ ]?(\\[)(\\])", + "name": "meta.link.reference.literal.markdown" + }, + "list-paragraph": { + "patterns": [ + { + "begin": "\\G\\s+(?=\\S)", + "end": "^\\s*$", + "name": "meta.paragraph.list.markdown", + "patterns": [ + { + "include": "#inline" + }, + { + "captures": { + "1": { + "name": "punctuation.definition.list_item.markdown" + } + }, + "comment": "Match the list punctuation", + "match": "^\\s*([*+-]|[0-9]+\\.)" + } + ] + } + ] + }, + "raw": { + "captures": { + "1": { + "name": "punctuation.definition.raw.markdown" + }, + "3": { + "name": "punctuation.definition.raw.markdown" + } + }, + "match": "(`+)([^`]|(?!(?<!`)\\1(?!`))`)*+(\\1)", + "name": "markup.raw.inline.markdown" + }, + "separator": { + "match": "\\G[ ]{0,3}([-*_])([ ]{0,2}\\1){2,}[ \\t]*$\\n?", + "name": "meta.separator.markdown" + } + } +} diff --git a/data/source.lua.json b/data/source.lua.json new file mode 100644 index 0000000..4b5e779 --- /dev/null +++ b/data/source.lua.json @@ -0,0 +1,145 @@ +{ + "scopeName": "source.lua", + "name": "Lua", + + "fileTypes": [ "lua" ], + + "patterns": [ + { + "begin": "\\b(function)\\b\\s+([a-zA-Z_][a-zA-Z0-9_]*([.:][a-zA-Z0-9_]+)*)\\s*(\\()", + "beginCaptures": { + "1": { "name": "storage.type.function.lua" }, + "2": { "name": "entity.name.function.lua" }, + "4": { "name": "punctuation.definition.parameters.begin.lua" } + }, + "end": "\\)", + "endCaptures": { + "0": { "name": "punctuation.definition.parameters.end.lua" } + }, + "name": "meta.function.lua", + "patterns": [ + { + "match": "[a-zA-Z_][a-zA-Z0-9_]*", + "name": "variable.parameter.lua" + } + ] + }, + { + "begin": "(?<!function)([a-zA-Z_][a-zA-Z0-9_]*([.:][a-zA-Z0-9_]+)*)\\s*(\\(|{)", + "beginCaptures": { + "1": { "name": "entity.name.function.lua" }, + "3": { "name": "punctuation.definition.parameters.begin.lua" } + }, + "end": "\\)|}", + "endCaptures": { + "0": { "name": "punctuation.definition.parameters.end.lua" } + }, + "name": "meta.functioncall.lua", + "patterns": [ + { + "include": "$self" + } + ] + }, + { + "match": "([a-zA-Z_][a-zA-Z0-9_]*([.:][a-zA-Z0-9_]+)*)\\s*('|\")((\\\\.)|[^']*)(\\3)", + "name": "meta.functioncall.lua", + "captures": { + "1": { "name": "entity.name.function.lua" }, + "3": { "name": "punctuation.definition.string.begin.lua" }, + "5": { "name": "constant.character.escape.lua" }, + "6": { "name": "punctuation.definition.string.end.lua" } + } + }, + + { + "match": "(--)(?!\\s*\\[=*\\[).*", + "captures": { + "1": { "name": "punctuation.definition.comment.lua" } + }, + "name": "comment.line.lua" + }, + { + "begin": "--\\s*\\[(=*)\\[", + "beginCaptures": { + "0": { "name": "punctuation.definition.comment.begin.lua" } + }, + "end": "\\]\\1\\]", + "endCaptures": { + "0": { "name": "punctuation.definition.comment.end.lua" } + }, + "name": "comment.block.lua" + }, + + { + "match": "('|\")((\\\\.)|[^']*)(\\1)", + "name": "string.line.lua", + "captures": { + "1": { "name": "punctuation.definition.string.begin.lua" }, + "3": { "name": "constant.character.escape.lua" }, + "4": { "name": "punctuation.definition.string.end.lua" } + } + }, + { + "begin": "(?!--\\s*)\\[(=*)\\[", + "beginCaptures": { + "0": { "name": "punctuation.definition.string.begin.lua" } + }, + "end": "\\]\\1\\]", + "endCaptures": { + "0": { "name": "punctuation.definition.string.end.lua" } + }, + "name": "string.block.lua" + }, + + { + "match": "(?<![0-9.])\\s0x[a-fA-F0-9]+|\\b[0-9]+(\\.[0-9]+)?([eE]-?[0-9]+)?|\\.[0-9]+([eE]-?[0-9]+)?", + "name": "constant.numeric.lua" + }, + + { + "match": "\\b(this|self|_G|_VERSION)\\b", + "name": "variable.language.lua" + }, + + { + "match": "\\b(nil|true|false)\\b", + "name": "constant.language.lua" + }, + + { + "match": "\\blocal\\b", + "name": "storage.type.lua" + }, + + { + "match": "::.*::", + "name": "storage.type.label.lua" + }, + + { + "match": "\\b(\\{)(\\})\\b", + "captures": { + "1": { "name": "punctuation.definition.table.begin.bracket.curly" }, + "2": { "name": "punctuation.definition.table.end.bracket.curly" } + } + }, + + { + "match": "\\b(do|return|if|then|elseif|else|while|repeat|until|for|in|goto|end)\\b", + "name": "keyword.control.lua" + }, + { + "match": "\\b(or|and|not)\\b", + "name": "keyword.operator.lua" + }, + { + "match": "=|<|<=|==|~=|>=|>|\\||~|&|<<|>>|\\+|-|\\*|\\/|\\/\\/|%|(?<!\\.)\\.\\.(?!\\.)|\\^|#", + "name": "keyword.operator.lua" + }, + { + "match": "\\.|,|;", + "name": "meta.delimiter.lua" + } + ] +} diff --git a/data/source.python.json b/data/source.python.json new file mode 100644 index 0000000..33c298b --- /dev/null +++ b/data/source.python.json @@ -0,0 +1,2805 @@ +{ + "scopeName": "source.python", + "name": "Python", + "fileTypes": [ + "cpy", + "gyp", + "gypi", + "kv", + "py", + "pyw", + "pyi", + "rpy", + "SConscript", + "SConstruct", + "Sconstruct", + "sconstruct", + "Snakefile", + "smk", + "tac", + "wscript", + "wsgi" + ], + "firstLineMatch": "^#![ \\t]*/.*\\bpython[\\d\\.]*\\b", + "injections": { + "L:source.python meta.embedded.sql": { + "patterns": [ + { + "include": "#string_formatting" + }, + { + "include": "#escaped_char" + } + ] + } + }, + "patterns": [ + { + "include": "#line_comments" + }, + { + "include": "#language_variables" + }, + { + "match": "\\b(?i:(0x\\h*)L)", + "name": "constant.numeric.integer.long.hexadecimal.python" + }, + { + "match": "\\b(?i:(0x\\h*))", + "name": "constant.numeric.integer.hexadecimal.python" + }, + { + "match": "\\b(?i:(0o?[0-7]+)L)", + "name": "constant.numeric.integer.long.octal.python" + }, + { + "match": "\\b(?i:(0o?[0-7]+))", + "name": "constant.numeric.integer.octal.python" + }, + { + "match": "\\b(?i:(0b[01]+)L)", + "name": "constant.numeric.integer.long.binary.python" + }, + { + "match": "\\b(?i:(0b[01]+))", + "name": "constant.numeric.integer.binary.python" + }, + { + "match": "\\b(?i:(((\\d+(\\.(?=[^a-zA-Z_])\\d*)?|(?<=[^0-9a-zA-Z_])\\.\\d+)(e[\\-\\+]?\\d+)?))J)", + "name": "constant.numeric.complex.python" + }, + { + "match": "\\b(?i:(\\d+\\.\\d*(e[\\-\\+]?\\d+)?))(?=[^a-zA-Z_])", + "name": "constant.numeric.float.python" + }, + { + "match": "(?<=[^0-9a-zA-Z_])(?i:(\\.\\d+(e[\\-\\+]?\\d+)?))", + "name": "constant.numeric.float.python" + }, + { + "match": "\\b(?i:(\\d+e[\\-\\+]?\\d+))", + "name": "constant.numeric.float.python" + }, + { + "match": "\\b(?i:([1-9]+[0-9]*|0)L)", + "name": "constant.numeric.integer.long.decimal.python" + }, + { + "match": "\\b([1-9]+[0-9]*|0)", + "name": "constant.numeric.integer.decimal.python" + }, + { + "captures": { + "1": { + "name": "storage.modifier.global.python" + } + }, + "match": "\\b(global)\\b" + }, + { + "captures": { + "1": { + "name": "storage.modifier.nonlocal.python" + } + }, + "match": "\\b(nonlocal)\\b" + }, + { + "captures": { + "1": { + "name": "keyword.control.import.python" + }, + "2": { + "name": "keyword.control.import.from.python" + } + }, + "match": "\\b(?:(import)|(from))\\b" + }, + { + "comment": "keywords that delimit flow conditionals", + "name": "keyword.control.conditional.python", + "match": "\\b(if|elif|else)\\b" + }, + { + "comment": "keywords that delimit an exception", + "name": "keyword.control.exception.python", + "match": "\\b(except|finally|try|raise)\\b" + }, + { + "comment": "keywords that delimit loops", + "name": "keyword.control.repeat.python", + "match": "\\b(for|while)\\b" + }, + { + "comment": "keywords that alter flow from within a block", + "name": "keyword.control.statement.python", + "match": "\\b(with|break|continue|pass|return|yield(\\s+from)?|await)\\b" + }, + { + "comment": "keyword operators that evaluate to True or False", + "match": "\\b(and|in|is|not|or)\\b", + "name": "keyword.operator.logical.python" + }, + { + "captures": { + "1": { + "name": "keyword.other.python" + } + }, + "comment": "keywords that haven't fit into other groups (yet).", + "match": "\\b(as|assert|del|exec|print)\\b" + }, + { + "match": "<>", + "name": "invalid.deprecated.operator.python" + }, + { + "match": "<\\=|>\\=|\\=\\=|<|>|\\!\\=", + "name": "keyword.operator.comparison.python" + }, + { + "match": "\\+\\=|-\\=|\\*\\=|/\\=|//\\=|%\\=|&\\=|\\|\\=|\\^\\=|>>\\=|<<\\=|\\*\\*\\=", + "name": "keyword.operator.assignment.augmented.python" + }, + { + "match": "\\+|\\-|\\*|\\*\\*|/|//|%|<<|>>|&|\\||\\^|~", + "name": "keyword.operator.arithmetic.python" + }, + { + "match": "\\=", + "name": "keyword.operator.assignment.python" + }, + { + "begin": "^\\s*(class)\\s+(?=[a-zA-Z_][a-zA-Z_0-9]*\\s*\\:)", + "beginCaptures": { + "1": { + "name": "storage.type.class.python" + } + }, + "contentName": "entity.name.type.class.python", + "end": "\\s*(:)", + "endCaptures": { + "1": { + "name": "punctuation.section.class.begin.python" + } + }, + "name": "meta.class.old-style.python", + "patterns": [ + { + "include": "#entity_name_class" + } + ] + }, + { + "begin": "^\\s*(class)\\s+(?=[a-zA-Z_][a-zA-Z_0-9]*\\s*\\()", + "beginCaptures": { + "1": { + "name": "storage.type.class.python" + } + }, + "end": "(\\))\\s*(?:(\\:)|(.*$\\n?))", + "endCaptures": { + "1": { + "name": "punctuation.definition.inheritance.end.python" + }, + "2": { + "name": "punctuation.section.class.begin.python" + }, + "3": { + "name": "invalid.illegal.missing-section-begin.python" + } + }, + "name": "meta.class.python", + "patterns": [ + { + "begin": "(?=[A-Za-z_][A-Za-z0-9_]*)", + "contentName": "entity.name.type.class.python", + "end": "(?![A-Za-z0-9_])", + "patterns": [ + { + "include": "#entity_name_class" + } + ] + }, + { + "begin": "(\\()", + "beginCaptures": { + "1": { + "name": "punctuation.definition.inheritance.begin.python" + } + }, + "contentName": "meta.class.inheritance.python", + "end": "(?=\\)|:)", + "patterns": [ + { + "begin": "(?<=\\(|,)\\s*", + "contentName": "entity.other.inherited-class.python", + "end": "\\s*(?:(,)|(?=\\)))", + "endCaptures": { + "1": { + "name": "punctuation.separator.inheritance.python" + } + }, + "patterns": [ + { + "include": "$self" + } + ] + } + ] + } + ] + }, + { + "begin": "^\\s*(class)\\s+(?=[a-zA-Z_][a-zA-Z_0-9])", + "beginCaptures": { + "1": { + "name": "storage.type.class.python" + } + }, + "end": "(\\()|(\\s*$\\n?|#.*$\\n?)", + "endCaptures": { + "1": { + "name": "punctuation.definition.inheritance.begin.python" + }, + "2": { + "name": "invalid.illegal.missing-inheritance.python" + } + }, + "name": "meta.class.python", + "patterns": [ + { + "begin": "(?=[A-Za-z_][A-Za-z0-9_]*)", + "contentName": "entity.name.type.class.python", + "end": "(?![A-Za-z0-9_])", + "patterns": [ + { + "include": "#entity_name_function" + } + ] + } + ] + }, + { + "begin": "^\\s*(?:(async)\\s+)?(def)\\s+(?=[A-Za-z_][A-Za-z0-9_]*)", + "beginCaptures": { + "1": { + "name": "storage.modifier.async.python" + }, + "2": { + "name": "storage.type.function.python" + } + }, + "end": ":", + "endCaptures": { + "0": { + "name": "punctuation.definition.function.begin.python" + } + }, + "name": "meta.function.python", + "patterns": [ + { + "begin": "(?=[A-Za-z_][A-Za-z0-9_]*)", + "contentName": "entity.name.function.python", + "end": "(?![A-Za-z0-9_])", + "patterns": [ + { + "include": "#entity_name_function" + } + ] + }, + { + "begin": "\\(", + "beginCaptures": { + "0": { + "name": "punctuation.definition.parameters.begin.python" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.definition.parameters.end.python" + } + }, + "contentName": "meta.function.parameters.python", + "patterns": [ + { + "include": "#line_comments" + }, + { + "begin": "(?:(\\*{0,2})|\\b)([a-zA-Z_][\\w_]*)\\s*(?:(:)\\s*([a-zA-Z_][\\w_]*))?\\s*(=)\\s*", + "beginCaptures": { + "1": { + "name": "keyword.operator.unpacking.arguments.python" + }, + "2": { + "name": "variable.parameter.function.python" + }, + "3": { + "name": "punctuation.separator.python" + }, + "4": { + "name": "storage.type.python" + }, + "5": { + "name": "keyword.operator.assignment.python" + } + }, + "end": "(?!\\G)", + "patterns": [ + { + "include": "$self" + } + ] + }, + { + "match": "(?:(\\*{0,2})|\\b)([a-zA-Z_][\\w_]*)\\s*(?:(:)\\s*([a-zA-Z_][\\w_]*))?", + "captures": { + "1": { + "name": "keyword.operator.unpacking.arguments.python" + }, + "2": { + "name": "variable.parameter.function.python" + }, + "3": { + "name": "punctuation.separator.python" + }, + "4": { + "name": "storage.type.python" + } + } + }, + { + "match": ",", + "name": "punctuation.separator.parameters.python" + } + ] + }, + { + "match": "(->)\\s*([A-Za-z_][\\w_]*)(?=\\s*:)", + "captures": { + "1": { + "name": "keyword.operator.function-annotation.python" + }, + "2": { + "name": "storage.type.python" + } + } + } + ] + }, + { + "begin": "\\b(lambda)\\b", + "beginCaptures": { + "1": { + "name": "storage.type.function.inline.python" + } + }, + "end": ":", + "endCaptures": { + "0": { + "name": "punctuation.definition.function.begin.python" + } + }, + "name": "meta.function.inline.python", + "patterns": [ + { + "begin": "\\G", + "end": "(?=\\:)", + "contentName": "meta.function.inline.parameters.python", + "patterns": [ + { + "begin": "(?:(\\*{0,2})|\\b)([a-zA-Z_][\\w_]*)\\s*(=)\\s*", + "beginCaptures": { + "1": { + "name": "keyword.operator.unpacking.arguments.python" + }, + "2": { + "name": "variable.parameter.function.python" + }, + "3": { + "name": "keyword.operator.assignment.python" + } + }, + "end": "(?!\\G)", + "patterns": [ + { + "include": "$self" + } + ] + }, + { + "match": "(?:(\\*{0,2})|\\b)([a-zA-Z_][\\w_]*)\\b", + "captures": { + "1": { + "name": "keyword.operator.unpacking.arguments.python" + }, + "2": { + "name": "variable.parameter.function.python" + } + } + }, + { + "match": ",", + "name": "punctuation.separator.parameters.python" + } + ] + } + ] + }, + { + "begin": "^\\s*(?=@\\s*[A-Za-z_][A-Za-z0-9_]*(?:\\.[a-zA-Z_][a-zA-Z_0-9]*)*\\s*\\()", + "comment": "a decorator may be a function call which returns a decorator.", + "end": "(\\))", + "endCaptures": { + "1": { + "name": "punctuation.definition.arguments.end.python" + } + }, + "name": "meta.function.decorator.python", + "patterns": [ + { + "begin": "(?=(@)\\s*[A-Za-z_][A-Za-z0-9_]*(?:\\.[A-Za-z_][A-Za-z0-9_]*)*\\s*\\()", + "beginCaptures": { + "1": { + "name": "punctuation.definition.decorator.python" + } + }, + "contentName": "entity.name.function.decorator.python", + "end": "(?=\\s*\\()", + "patterns": [ + { + "include": "#dotted_name" + } + ] + }, + { + "begin": "(\\()", + "beginCaptures": { + "1": { + "name": "punctuation.definition.arguments.begin.python" + } + }, + "contentName": "meta.function.decorator.arguments.python", + "end": "(?=\\))", + "patterns": [ + { + "include": "#keyword_arguments" + }, + { + "include": "$self" + } + ] + } + ] + }, + { + "begin": "^\\s*(?=@\\s*[A-Za-z_][A-Za-z0-9_]*(?:\\.[a-zA-Z_][a-zA-Z_0-9]*)*)", + "contentName": "entity.name.function.decorator.python", + "end": "(?=\\s|$\\n?|#)", + "name": "meta.function.decorator.python", + "patterns": [ + { + "begin": "(?=(@)\\s*[A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z_][A-Za-z0-9_]*)*)", + "beginCaptures": { + "1": { + "name": "punctuation.definition.decorator.python" + } + }, + "end": "(?=\\s|$\\n?|#)", + "patterns": [ + { + "include": "#dotted_name" + } + ] + } + ] + }, + { + "include": "#function_calls" + }, + { + "include": "#method_calls" + }, + { + "include": "#objects" + }, + { + "include": "#properties" + }, + { + "begin": "(?=[A-Za-z_][A-Za-z0-9_]*(?:\\.[a-zA-Z_][a-zA-Z_0-9]*)*\\s*\\[)", + "end": "(\\])", + "endCaptures": { + "1": { + "name": "punctuation.definition.arguments.end.python" + } + }, + "name": "meta.item-access.python", + "patterns": [ + { + "begin": "(?=[A-Za-z_][A-Za-z0-9_]*(?:\\.[A-Za-z_][A-Za-z0-9_]*)*\\s*\\[)", + "end": "(?=\\s*\\[)", + "patterns": [ + { + "include": "#dotted_name" + } + ] + }, + { + "begin": "(\\[)", + "beginCaptures": { + "1": { + "name": "punctuation.definition.arguments.begin.python" + } + }, + "contentName": "meta.item-access.arguments.python", + "end": "(?=\\])", + "patterns": [ + { + "include": "$self" + } + ] + } + ] + }, + { + "begin": "(?<=\\)|\\])\\s+(\\[)", + "beginCaptures": { + "1": { + "name": "punctuation.definition.arguments.begin.python" + } + }, + "contentName": "meta.item-access.arguments.python", + "end": "(\\])", + "endCaptures": { + "1": { + "name": "punctuation.definition.arguments.end.python" + } + }, + "name": "meta.item-access.python", + "patterns": [ + { + "include": "$self" + } + ] + }, + { + "captures": { + "1": { + "name": "storage.type.class.python" + } + }, + "match": "\\b(class)\\b" + }, + { + "include": "#line_continuation" + }, + { + "match": "\\b(None|True|False|Ellipsis|NotImplemented)\\b", + "name": "constant.language.python" + }, + { + "include": "#string_quoted_single" + }, + { + "include": "#string_quoted_double" + }, + { + "begin": "(\\()", + "end": "(\\))", + "patterns": [ + { + "include": "$self" + } + ] + }, + { + "captures": { + "1": { + "name": "punctuation.definition.list.begin.python" + }, + "2": { + "name": "meta.empty-list.python" + }, + "3": { + "name": "punctuation.definition.list.end.python" + } + }, + "match": "(\\[)(\\s*(\\]))\\b" + }, + { + "begin": "(\\[)", + "beginCaptures": { + "1": { + "name": "punctuation.definition.list.begin.python" + } + }, + "end": "(\\])", + "endCaptures": { + "1": { + "name": "punctuation.definition.list.end.python" + } + }, + "name": "meta.structure.list.python", + "patterns": [ + { + "begin": "(?<=\\[|\\,)\\s*(?![\\],])", + "contentName": "meta.structure.list.item.python", + "end": "\\s*(?:(,)|(?=\\]))", + "endCaptures": { + "1": { + "name": "punctuation.separator.list.python" + } + }, + "patterns": [ + { + "include": "$self" + } + ] + } + ] + }, + { + "captures": { + "1": { + "name": "punctuation.definition.tuple.begin.python" + }, + "2": { + "name": "meta.empty-tuple.python" + }, + "3": { + "name": "punctuation.definition.tuple.end.python" + } + }, + "match": "(\\()(\\s*(\\)))", + "name": "meta.structure.tuple.python" + }, + { + "captures": { + "1": { + "name": "punctuation.definition.dictionary.begin.python" + }, + "2": { + "name": "meta.empty-dictionary.python" + }, + "3": { + "name": "punctuation.definition.dictionary.end.python" + } + }, + "match": "(\\{)(\\s*(\\}))", + "name": "meta.structure.dictionary.python" + }, + { + "begin": "(\\{)", + "beginCaptures": { + "1": { + "name": "punctuation.definition.dictionary.begin.python" + } + }, + "end": "(\\})", + "endCaptures": { + "1": { + "name": "punctuation.definition.dictionary.end.python" + } + }, + "name": "meta.structure.dictionary.python", + "patterns": [ + { + "begin": "(?<=\\{|\\,|^)\\s*(?![\\},])", + "contentName": "meta.structure.dictionary.key.python", + "end": "\\s*(?:(?=\\})|(\\:))", + "endCaptures": { + "1": { + "name": "punctuation.separator.valuepair.dictionary.python" + } + }, + "patterns": [ + { + "include": "$self" + } + ] + }, + { + "begin": "(?<=\\:|^)\\s*", + "contentName": "meta.structure.dictionary.value.python", + "end": "\\s*(?:(?=\\})|(,))", + "endCaptures": { + "1": { + "name": "punctuation.separator.dictionary.python" + } + }, + "patterns": [ + { + "include": "$self" + } + ] + } + ] + } + ], + "repository": { + "builtin_exceptions": { + "match": "(?x)\\b(\n\t\t\t\t(\n\t\t\t\t\tArithmetic|Assertion|Attribute|BlockingIO|BrokenPipe|Buffer|ChildProcess|\n\t\t\t\t\tConnection(Aborted|Refused|Reset)?|EOF|Environment|FileExists|\n\t\t\t\t\tFileNotFound|FloatingPoint|Interrupted|IO|IsADirectoryError|\n\t\t\t\t\tImport|Indentation|Index|Key|Lookup|Memory|Name|NotADirectory|\n\t\t\t\t\tNotImplemented|OS|Overflow|Permission|ProcessLookup|Recursion|Reference|\n\t\t\t\t\tRuntime|Standard|Syntax|System|Tab|Timeout|Type|UnboundLocal|\n\t\t\t\t\tUnicode(Encode|Decode|Translate)?|Value|VMS|Windows|ZeroDivision\n\t\t\t\t)Error|\n\t\t\t\t((Pending)?Deprecation|Runtime|Syntax|User|Future|Import|Unicode|Bytes)?Warning|\n\t\t\t\t(Base)?Exception|\n\t\t\t\tSystemExit|StopAsyncIteration|StopIteration|NotImplemented|KeyboardInterrupt|GeneratorExit\n\t\t\t)\\b", + "name": "support.type.exception.python" + }, + "builtin_functions": { + "match": "(?x)\\b(__import__|abs|all|any|ascii|bin|bool|bytearray|bytes|callable|chr|classmethod|compile|complex|delattr|dict|dir|divmod|enumerate|eval|exec|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|isinstance|issubclass|iter|len|list|locals|map|max|memoryview|min|next|object|oct|open|ord|pow|print|property|range|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|vars|zip|file|long|raw_input|reduce|reload|unichr|unicode|xrange|apply|buffer|coerce|intern|execfile)\\b", + "name": "support.function.builtin.python" + }, + "builtin_types": { + "match": "(?x)\\b(\n\t\t\t\tbasestring|bool|buffer|bytearray|bytes|complex|dict|float|frozenset|int|\n\t\t\t\tlist|long|memoryview|object|range|set|slice|str|tuple|unicode|xrange\n\t\t\t)\\b", + "name": "support.type.python" + }, + "docstrings": { + "patterns": [ + { + "begin": "^\\s*(?=[uU]?[rR]?\"\"\")", + "end": "(?<=\"\"\")", + "name": "comment.block.python", + "patterns": [ + { + "include": "#string_quoted_double" + } + ] + }, + { + "begin": "^\\s*(?=[uU]?[rR]?''')", + "end": "(?<=''')", + "name": "comment.block.python", + "patterns": [ + { + "include": "#string_quoted_single" + } + ] + } + ] + }, + "function_calls": { + "patterns": [ + { + "begin": "(?:([A-Za-z_][A-Za-z0-9_]*)|(?<=\\)|\\]))\\s*(\\()", + "beginCaptures": { + "1": { + "patterns": [ + { + "include": "#builtin_functions" + }, + { + "include": "#function_names" + } + ] + }, + "2": { + "name": "punctuation.definition.arguments.begin.bracket.round.python" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.definition.arguments.end.bracket.round.python" + } + }, + "name": "meta.function-call.python", + "contentName": "meta.function-call.arguments.python", + "patterns": [ + { + "include": "#keyword_arguments" + }, + { + "match": ",", + "name": "punctuation.separator.arguments.python" + }, + { + "include": "$self" + } + ] + } + ] + }, + "dotted_name": { + "begin": "(?=[A-Za-z_][A-Za-z0-9_]*(?:\\.[A-Za-z_][A-Za-z0-9_]*)*)", + "end": "(?![A-Za-z0-9_\\.])", + "patterns": [ + { + "begin": "(\\.)(?=[A-Za-z_][A-Za-z0-9_]*)", + "end": "(?![A-Za-z0-9_])", + "patterns": [ + { + "include": "#magic_function_names" + }, + { + "include": "#magic_variable_names" + }, + { + "include": "#illegal_names" + }, + { + "include": "#generic_names" + } + ] + }, + { + "begin": "(?<!\\.)(?=[A-Za-z_][A-Za-z0-9_]*)", + "end": "(?![A-Za-z0-9_])", + "patterns": [ + { + "include": "#builtin_functions" + }, + { + "include": "#builtin_types" + }, + { + "include": "#builtin_exceptions" + }, + { + "include": "#illegal_names" + }, + { + "include": "#magic_function_names" + }, + { + "include": "#magic_variable_names" + }, + { + "include": "#language_variables" + }, + { + "include": "#generic_names" + } + ] + } + ] + }, + "entity_name_class": { + "patterns": [ + { + "include": "#illegal_names" + }, + { + "include": "#generic_names" + } + ] + }, + "entity_name_function": { + "patterns": [ + { + "include": "#magic_function_names" + }, + { + "include": "#illegal_names" + }, + { + "include": "#generic_names" + } + ] + }, + "escaped_char": { + "match": "(?x)\n(\\\\x[0-9A-Fa-f]{2})|\n(\\\\[0-7]{3})|(\\\\\\n)|\n(\\\\\\\\)|\n(\\\\\\\")|\n(\\\\')|\n(\\\\a)|\n(\\\\b)|\n(\\\\f)|\n(\\\\n)|\n(\\\\r)|\n(\\\\t)|\n(\\\\v)|\n({{|}})", + "captures": { + "1": { + "name": "constant.character.escape.hex.python" + }, + "2": { + "name": "constant.character.escape.octal.python" + }, + "3": { + "name": "constant.character.escape.newline.python" + }, + "4": { + "name": "constant.character.escape.backlash.python" + }, + "5": { + "name": "constant.character.escape.double-quote.python" + }, + "6": { + "name": "constant.character.escape.single-quote.python" + }, + "7": { + "name": "constant.character.escape.bell.python" + }, + "8": { + "name": "constant.character.escape.backspace.python" + }, + "9": { + "name": "constant.character.escape.formfeed.python" + }, + "10": { + "name": "constant.character.escape.linefeed.python" + }, + "11": { + "name": "constant.character.escape.return.python" + }, + "12": { + "name": "constant.character.escape.tab.python" + }, + "13": { + "name": "constant.character.escape.vertical-tab.python" + }, + "14": { + "name": "constant.character.escape.curly-bracket.python" + } + } + }, + "escaped_unicode_char": { + "captures": { + "1": { + "name": "constant.character.escape.unicode.16-bit-hex.python" + }, + "2": { + "name": "constant.character.escape.unicode.32-bit-hex.python" + }, + "3": { + "name": "constant.character.escape.unicode.name.python" + } + }, + "match": "(\\\\U[0-9A-Fa-f]{8})|(\\\\u[0-9A-Fa-f]{4})|(\\\\N\\{[a-zA-Z ]+\\})" + }, + "function_names": { + "patterns": [ + { + "include": "#magic_function_names" + }, + { + "include": "#illegal_names" + }, + { + "match": "[a-zA-Z_][a-zA-Z0-9_]*", + "name": "entity.name.function.python" + } + ] + }, + "generic_names": { + "match": "[A-Za-z_][A-Za-z0-9_]*" + }, + "illegal_names": { + "match": "\\b(and|as|assert|break|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|nonlocal|not|or|pass|print|raise|return|try|while|with|yield|await|async)\\b", + "name": "invalid.illegal.name.python" + }, + "keyword_arguments": { + "begin": "\\b([a-zA-Z_][a-zA-Z_0-9]*)\\s*(=)(?!=)", + "beginCaptures": { + "1": { + "name": "variable.parameter.function.python" + }, + "2": { + "name": "keyword.operator.assignment.python" + } + }, + "end": "\\s*(?:(,)|(?=$\\n?|[\\)\\:]))", + "endCaptures": { + "1": { + "name": "punctuation.separator.parameters.python" + } + }, + "patterns": [ + { + "include": "$self" + } + ] + }, + "language_variables": { + "match": "\\b(self|cls)\\b", + "name": "variable.language.self.python" + }, + "line_comments": { + "begin": "(^[ \\t]+)?(?=#)", + "beginCaptures": { + "1": { + "name": "punctuation.whitespace.comment.leading.python" + } + }, + "end": "(?!\\G)", + "patterns": [ + { + "begin": "#", + "beginCaptures": { + "0": { + "name": "punctuation.definition.comment.python" + } + }, + "end": "\\n", + "name": "comment.line.number-sign.python" + } + ] + }, + "line_continuation": { + "captures": { + "1": { + "name": "punctuation.separator.continuation.line.python" + }, + "2": { + "name": "invalid.illegal.unexpected-text.python" + } + }, + "match": "(\\\\)(.*)$\\n?" + }, + "magic_function_names": { + "comment": "these methods have magic interpretation by python and are generally called indirectly through syntactic constructs", + "match": "(?x)\\b(__(?:abs|add|and|bool|bytes|call|cmp|coerce|complex|contains|del|delattr|delete|delitem|delslice|dir|div|divmod|enter|eq|exit|float|floordiv|format|ge|get|getattr|getattribute|getitem|getslice|gt|hash|hex|iadd|iand|idiv|ifloordiv|ilshift|imatmul|imod|imul|index|init|instancecheck|int|invert|ior|ipow|irshift|isub|iter|itruediv|ixor|le|len|length_hint|long|lshift|lt|matmul|missing|mod|mul|ne|neg|next|new|nonzero|oct|or|pos|pow|radd|rand|rdiv|rdivmod|repr|reversed|rfloordiv|rlshift|rmatmul|rmod|rmul|ror|round|rpow|rrshift|rshift|rsub|rtruediv|rxor|set|setattr|setitem|setslice|str|sub|subclasscheck|truediv|unicode|xor)__)\\b", + "name": "support.function.magic.python" + }, + "magic_variable_names": { + "comment": "magic variables which a class/module may have.", + "match": "\\b__(all|annotations|bases|class|closure|code|debug|dict|doc|file|func|globals|kwdefaults|members|metaclass|methods|module|name|qualname|self|slots|weakref)__\\b", + "name": "support.variable.magic.python" + }, + "method_calls": { + "patterns": [ + { + "begin": "(\\.)([a-zA-Z_][a-zA-Z0-9_]*)\\s*(\\()", + "beginCaptures": { + "1": { + "name": "punctuation.separator.method.period.python" + }, + "2": { + "patterns": [ + { + "include": "#function_names" + } + ] + }, + "3": { + "name": "punctuation.definition.arguments.begin.bracket.round.python" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.definition.arguments.end.bracket.round.python" + } + }, + "name": "meta.method-call.python", + "contentName": "meta.method-call.arguments.python", + "patterns": [ + { + "include": "#keyword_arguments" + }, + { + "match": ",", + "name": "punctuation.separator.arguments.python" + }, + { + "include": "$self" + } + ] + } + ] + }, + "objects": { + "patterns": [ + { + "match": "[A-Z][A-Z0-9_]*(?=\\s*\\.\\s*[a-zA-Z_][a-zA-Z0-9_]*)", + "name": "constant.other.object.python" + }, + { + "match": "[a-zA-Z_][a-zA-Z0-9_]*(?=\\s*\\.\\s*[a-zA-Z_][a-zA-Z0-9_]*)", + "name": "variable.other.object.python" + } + ] + }, + "properties": { + "patterns": [ + { + "match": "(\\.)\\s*([A-Z][A-Z0-9_]*\\b\\$*)(?=\\s*\\.\\s*[a-zA-Z_][a-zA-Z0-9_]*)", + "captures": { + "1": { + "name": "punctuation.separator.property.period.python" + }, + "2": { + "name": "constant.other.object.property.python" + } + } + }, + { + "match": "(\\.)\\s*(\\$*[a-zA-Z_][a-zA-Z0-9_]*)(?=\\s*\\.\\s*[a-zA-Z_][a-zA-Z0-9_]*)", + "captures": { + "1": { + "name": "punctuation.separator.property.period.python" + }, + "2": { + "name": "variable.other.object.property.python" + } + } + }, + { + "match": "(\\.)\\s*([A-Z][A-Z0-9_$]*\\b\\$*)", + "captures": { + "1": { + "name": "punctuation.separator.property.period.python" + }, + "2": { + "name": "constant.other.property.python" + } + } + }, + { + "match": "(\\.)\\s*(\\$*[a-zA-Z_][a-zA-Z0-9_]*)", + "captures": { + "1": { + "name": "punctuation.separator.property.period.python" + }, + "2": { + "name": "variable.other.property.python" + } + } + }, + { + "match": "(\\.)\\s*([0-9][a-zA-Z0-9_]*)", + "captures": { + "1": { + "name": "punctuation.separator.property.period.python" + }, + "2": { + "name": "invalid.illegal.identifier.python" + } + } + } + ] + }, + "nested_replacement_field": { + "match": "(?x)\n{\n (\n (\n \\d # integer\n |\n [a-zA-Z_]\\w* # identifier\n )\n (\n \\.[a-zA-Z_]\\w* # attribute name\n |\n \\[[^\\]]+\\] # element index\n )*\n )?\n (![rsa])? # conversion\n (\n :\n (.?[<>=^])? # fill followed by align\n [+\\- ]? # sign (space at the end is intentional)\n \\#? # alternate form\n 0?\n \\d* # width\n [_,]? # grouping option\n (\\.\\d+)? # precision\n [bcdeEfFgGnosxX%]? # type\n )?\n}", + "name": "constant.other.placeholder.python" + }, + "regular_expressions": { + "comment": "Changed disabled to 1 to turn off syntax highlighting in “r” strings.", + "disabled": 0, + "patterns": [ + { + "include": "source.regexp.python" + } + ] + }, + "string_formatting": { + "patterns": [ + { + "match": "(?x)\n%\n(\\([a-zA-Z_]+\\))? # mapping key\n[#0+\\- ]? # conversion flags (space at the end is intentional)\n(\\d+|\\*)? # minimum field width\n(\\.(\\d+|\\*))? # precision\n[hlL]? # length modifier\n[diouxXeEfFgGcrs%] # conversion type", + "name": "constant.other.placeholder.python" + }, + { + "match": "(?x)\n{\n (?:\n (?:\n \\d # integer\n |\n [a-zA-Z_]\\w* # identifier\n )\n (?:\n \\.[a-zA-Z_]\\w* # attribute name\n |\n \\[[^\\]]+\\] # element index\n )*\n )?\n (?:![rsa])? # conversion\n (?:\n # Yup, this is disgusting. But top-level format specifiers can have nested replacement fields.\n :\n (?:(?:.|({[^}]*}))?(?:[<>=^]|({[^}]*})))? # fill followed by align\n (?:[+\\- ]|({[^}]*}))? # sign (space at the end is intentional)\n (?:\\#|({[^}]*}))? # alternate form\n (?:0|({[^}]*}))?\n (?:\\d+|({[^}]*}))? # width\n (?:[_,]|({[^}]*}))? # grouping option\n (?:\\.(?:\\d+|({[^}]*}))|({[^}]*}))? # precision\n (?:[bcdeEfFgGnosxX%]|({[^}]*}))? # type\n )?\n}", + "name": "constant.other.placeholder.python", + "captures": { + "1": { + "patterns": [ + { + "include": "#nested_replacement_field" + } + ] + }, + "2": { + "patterns": [ + { + "include": "#nested_replacement_field" + } + ] + }, + "3": { + "patterns": [ + { + "include": "#nested_replacement_field" + } + ] + }, + "4": { + "patterns": [ + { + "include": "#nested_replacement_field" + } + ] + }, + "5": { + "patterns": [ + { + "include": "#nested_replacement_field" + } + ] + }, + "6": { + "patterns": [ + { + "include": "#nested_replacement_field" + } + ] + }, + "7": { + "patterns": [ + { + "include": "#nested_replacement_field" + } + ] + }, + "8": { + "patterns": [ + { + "include": "#nested_replacement_field" + } + ] + }, + "9": { + "patterns": [ + { + "include": "#nested_replacement_field" + } + ] + }, + "10": { + "patterns": [ + { + "include": "#nested_replacement_field" + } + ] + } + } + } + ] + }, + "string_interpolation": { + "begin": "{", + "beginCaptures": { + "0": { + "name": "punctuation.definition.interpolation.begin.bracket.curly.python" + } + }, + "end": "(?x)(?!\\G)\n(\n (?:![rsa])? # conversion\n (?:\n # Yup, this is disgusting. But top-level format specifiers can have nested replacement fields.\n :\n (?:(?:.|({[^}]*}))?(?:[<>=^]|({[^}]*})))? # fill followed by align\n (?:[+\\- ]|({[^}]*}))? # sign (space at the end is intentional)\n (?:\\#|({[^}]*}))? # alternate form\n (?:0|({[^}]*}))?\n (?:\\d+|({[^}]*}))? # width\n (?:[_,]|({[^}]*}))? # grouping option\n (?:\\.(?:\\d+|({[^}]*}))|({[^}]*}))? # precision\n (?:[bcdeEfFgGnosxX%]|({[^}]*}))? # type\n )?\n)\n(})", + "endCaptures": { + "1": { + "name": "constant.other.placeholder.python" + }, + "2": { + "patterns": [ + { + "include": "#nested_replacement_field" + } + ] + }, + "3": { + "patterns": [ + { + "include": "#nested_replacement_field" + } + ] + }, + "4": { + "patterns": [ + { + "include": "#nested_replacement_field" + } + ] + }, + "5": { + "patterns": [ + { + "include": "#nested_replacement_field" + } + ] + }, + "6": { + "patterns": [ + { + "include": "#nested_replacement_field" + } + ] + }, + "7": { + "patterns": [ + { + "include": "#nested_replacement_field" + } + ] + }, + "8": { + "patterns": [ + { + "include": "#nested_replacement_field" + } + ] + }, + "9": { + "patterns": [ + { + "include": "#nested_replacement_field" + } + ] + }, + "10": { + "patterns": [ + { + "include": "#nested_replacement_field" + } + ] + }, + "11": { + "patterns": [ + { + "include": "#nested_replacement_field" + } + ] + }, + "12": { + "name": "punctuation.definition.interpolation.end.bracket.curly.python" + } + }, + "name": "meta.interpolation.python", + "contentName": "meta.embedded.python", + "patterns": [ + { + "match": "\\\\", + "name": "invalid.illegal.backslash.python" + }, + { + "include": "$self" + } + ] + }, + "string_quoted_double": { + "patterns": [ + { + "begin": "([uU]r)(\"\"\")", + "beginCaptures": { + "1": { + "name": "storage.type.string.python" + }, + "2": { + "name": "punctuation.definition.string.begin.python" + } + }, + "comment": "single quoted unicode-raw string", + "end": "((?<=\"\"\")(\")\"\"|\"\"\")", + "endCaptures": { + "1": { + "name": "punctuation.definition.string.end.python" + }, + "2": { + "name": "meta.empty-string.double.python" + } + }, + "name": "string.quoted.double.block.unicode-raw-regex.python", + "patterns": [ + { + "include": "#string_formatting" + }, + { + "include": "#escaped_unicode_char" + }, + { + "include": "#escaped_char" + }, + { + "include": "#regular_expressions" + } + ] + }, + { + "begin": "([uU]R)(\"\"\")", + "beginCaptures": { + "1": { + "name": "storage.type.string.python" + }, + "2": { + "name": "punctuation.definition.string.begin.python" + } + }, + "comment": "single quoted unicode-raw string without regular expression highlighting", + "end": "((?<=\"\"\")(\")\"\"|\"\"\")", + "endCaptures": { + "1": { + "name": "punctuation.definition.string.end.python" + }, + "2": { + "name": "meta.empty-string.double.python" + } + }, + "name": "string.quoted.double.block.unicode-raw.python", + "patterns": [ + { + "include": "#string_formatting" + }, + { + "include": "#escaped_unicode_char" + }, + { + "include": "#escaped_char" + } + ] + }, + { + "begin": "(r)(\"\"\")", + "beginCaptures": { + "1": { + "name": "storage.type.string.python" + }, + "2": { + "name": "punctuation.definition.string.begin.python" + } + }, + "comment": "double quoted raw string", + "end": "((?<=\"\"\")(\")\"\"|\"\"\")", + "endCaptures": { + "1": { + "name": "punctuation.definition.string.end.python" + }, + "2": { + "name": "meta.empty-string.double.python" + } + }, + "name": "string.quoted.double.block.raw-regex.python", + "patterns": [ + { + "include": "#string_formatting" + }, + { + "include": "#escaped_char" + }, + { + "include": "#regular_expressions" + } + ] + }, + { + "begin": "(R)(\"\"\")", + "beginCaptures": { + "1": { + "name": "storage.type.string.python" + }, + "2": { + "name": "punctuation.definition.string.begin.python" + } + }, + "comment": "double quoted raw string", + "end": "((?<=\"\"\")(\")\"\"|\"\"\")", + "endCaptures": { + "1": { + "name": "punctuation.definition.string.end.python" + }, + "2": { + "name": "meta.empty-string.double.python" + } + }, + "name": "string.quoted.double.block.raw.python", + "patterns": [ + { + "include": "#string_formatting" + }, + { + "include": "#escaped_char" + } + ] + }, + { + "begin": "([uU])(\"\"\")", + "beginCaptures": { + "1": { + "name": "storage.type.string.python" + }, + "2": { + "name": "punctuation.definition.string.begin.python" + } + }, + "comment": "double quoted unicode string", + "end": "((?<=\"\"\")(\")\"\"|\"\"\")", + "endCaptures": { + "1": { + "name": "punctuation.definition.string.end.python" + }, + "2": { + "name": "meta.empty-string.double.python" + } + }, + "name": "string.quoted.double.block.unicode.python", + "patterns": [ + { + "include": "#string_formatting" + }, + { + "include": "#escaped_unicode_char" + }, + { + "include": "#escaped_char" + } + ] + }, + { + "begin": "([fF])(\"\"\")", + "beginCaptures": { + "1": { + "name": "storage.type.string.python" + }, + "2": { + "name": "punctuation.definition.string.begin.python" + } + }, + "end": "((?<=\"\"\")(\")\"\"|\"\"\")", + "endCaptures": { + "1": { + "name": "punctuation.definition.string.end.python" + }, + "2": { + "name": "meta.empty-string.double.python" + } + }, + "name": "string.quoted.double.block.format.python", + "patterns": [ + { + "include": "#escaped_char" + }, + { + "include": "#string_interpolation" + }, + { + "match": "}", + "name": "invalid.illegal.closing-curly-bracket.python" + } + ] + }, + { + "begin": "([rR][fF]|[fF][rR])(\"\"\")", + "beginCaptures": { + "1": { + "name": "storage.type.string.python" + }, + "2": { + "name": "punctuation.definition.string.begin.python" + } + }, + "end": "((?<=\"\"\")(\")\"\"|\"\"\")", + "endCaptures": { + "1": { + "name": "punctuation.definition.string.end.python" + }, + "2": { + "name": "meta.empty-string.double.python" + } + }, + "name": "string.quoted.double.block.raw-format.python", + "patterns": [ + { + "include": "#escaped_char" + }, + { + "include": "#string_interpolation" + }, + { + "match": "}", + "name": "invalid.illegal.closing-curly-bracket.python" + } + ] + }, + { + "begin": "([bB])(\"\"\")", + "beginCaptures": { + "1": { + "name": "storage.type.string.python" + }, + "2": { + "name": "punctuation.definition.string.begin.python" + } + }, + "end": "((?<=\"\"\")(\")\"\"|\"\"\")", + "endCaptures": { + "1": { + "name": "punctuation.definition.string.end.python" + }, + "2": { + "name": "meta.empty-string.double.python" + } + }, + "name": "string.quoted.double.block.binary.python", + "patterns": [ + { + "include": "#escaped_char" + }, + { + "include": "#string_formatting" + }, + { + "match": "[^\\x{01}-\\x{7f}]", + "name": "invalid.illegal.character-out-of-range.python" + } + ] + }, + { + "begin": "([rR][bB]|[bB][rR])(\"\"\")", + "beginCaptures": { + "1": { + "name": "storage.type.string.python" + }, + "2": { + "name": "punctuation.definition.string.begin.python" + } + }, + "end": "((?<=\"\"\")(\")\"\"|\"\"\")", + "endCaptures": { + "1": { + "name": "punctuation.definition.string.end.python" + }, + "2": { + "name": "meta.empty-string.double.python" + } + }, + "name": "string.quoted.double.block.raw-binary.python", + "patterns": [ + { + "include": "#escaped_char" + }, + { + "include": "#string_formatting" + }, + { + "match": "[^\\x{01}-\\x{7f}]", + "name": "invalid.illegal.character-out-of-range.python" + } + ] + }, + { + "captures": { + "1": { + "name": "storage.type.string.python" + }, + "2": { + "name": "punctuation.definition.string.begin.python" + }, + "3": { + "patterns": [ + { + "include": "#string_formatting" + }, + { + "include": "#escaped_unicode_char" + }, + { + "include": "#escaped_char" + }, + { + "include": "#regular_expressions" + } + ] + }, + "4": { + "name": "punctuation.definition.string.end.python" + } + }, + "comment": "double-quoted raw string", + "match": "([uU]r)(\")((?:[^\"\\\\]|\\\\.)*)(\")", + "name": "string.quoted.double.single-line.unicode-raw-regex.python" + }, + { + "begin": "([uU]R)(\")", + "beginCaptures": { + "1": { + "name": "storage.type.string.python" + }, + "2": { + "name": "punctuation.definition.string.begin.python" + } + }, + "comment": "double-quoted raw string", + "end": "((?<=\")(\")|\")|(\\n)", + "endCaptures": { + "1": { + "name": "punctuation.definition.string.end.python" + }, + "2": { + "name": "meta.empty-string.double.python" + }, + "3": { + "name": "invalid.illegal.unclosed-string.python" + } + }, + "name": "string.quoted.double.single-line.unicode-raw.python", + "patterns": [ + { + "include": "#string_formatting" + }, + { + "include": "#escaped_unicode_char" + }, + { + "include": "#escaped_char" + } + ] + }, + { + "captures": { + "1": { + "name": "storage.type.string.python" + }, + "2": { + "name": "punctuation.definition.string.begin.python" + }, + "3": { + "patterns": [ + { + "include": "#string_formatting" + }, + { + "include": "#escaped_char" + }, + { + "include": "#regular_expressions" + } + ] + }, + "4": { + "name": "punctuation.definition.string.end.python" + } + }, + "comment": "double-quoted raw string", + "match": "(r)(\")((?:[^\"\\\\]|\\\\.)*)(\")", + "name": "string.quoted.double.single-line.raw-regex.python" + }, + { + "begin": "(R)(\")", + "beginCaptures": { + "1": { + "name": "storage.type.string.python" + }, + "2": { + "name": "punctuation.definition.string.begin.python" + } + }, + "comment": "double-quoted raw string", + "end": "((?<=\")(\")|\")|(\\n)", + "endCaptures": { + "1": { + "name": "punctuation.definition.string.end.python" + }, + "2": { + "name": "meta.empty-string.double.python" + }, + "3": { + "name": "invalid.illegal.unclosed-string.python" + } + }, + "name": "string.quoted.double.single-line.raw.python", + "patterns": [ + { + "include": "#string_formatting" + }, + { + "include": "#escaped_char" + } + ] + }, + { + "begin": "([uU])(\")", + "beginCaptures": { + "1": { + "name": "storage.type.string.python" + }, + "2": { + "name": "punctuation.definition.string.begin.python" + } + }, + "comment": "double quoted unicode string", + "end": "((?<=\")(\")|\")|(\\n)", + "endCaptures": { + "1": { + "name": "punctuation.definition.string.end.python" + }, + "2": { + "name": "meta.empty-string.double.python" + }, + "3": { + "name": "invalid.illegal.unclosed-string.python" + } + }, + "name": "string.quoted.double.single-line.unicode.python", + "patterns": [ + { + "include": "#string_formatting" + }, + { + "include": "#escaped_unicode_char" + }, + { + "include": "#escaped_char" + } + ] + }, + { + "begin": "([fF])(\")", + "beginCaptures": { + "1": { + "name": "storage.type.string.python" + }, + "2": { + "name": "punctuation.definition.string.begin.python" + } + }, + "end": "((?<=\")(\")|\")|(\\n)", + "endCaptures": { + "1": { + "name": "punctuation.definition.string.end.python" + }, + "2": { + "name": "meta.empty-string.double.python" + }, + "3": { + "name": "invalid.illegal.unclosed-string.python" + } + }, + "name": "string.quoted.double.single-line.format.python", + "patterns": [ + { + "include": "#escaped_char" + }, + { + "include": "#string_interpolation" + }, + { + "match": "}", + "name": "invalid.illegal.closing-curly-bracket.python" + } + ] + }, + { + "begin": "([rR][fF]|[fF][rR])(\")", + "beginCaptures": { + "1": { + "name": "storage.type.string.python" + }, + "2": { + "name": "punctuation.definition.string.begin.python" + } + }, + "end": "((?<=\")(\")|\")|(\\n)", + "endCaptures": { + "1": { + "name": "punctuation.definition.string.end.python" + }, + "2": { + "name": "meta.empty-string.double.python" + }, + "3": { + "name": "invalid.illegal.unclosed-string.python" + } + }, + "name": "string.quoted.double.single-line.raw-format.python", + "patterns": [ + { + "include": "#escaped_char" + }, + { + "include": "#string_interpolation" + }, + { + "match": "}", + "name": "invalid.illegal.closing-curly-bracket.python" + } + ] + }, + { + "begin": "([bB])(\")", + "beginCaptures": { + "1": { + "name": "storage.type.string.python" + }, + "2": { + "name": "punctuation.definition.string.begin.python" + } + }, + "end": "((?<=\")(\")|\")|(\\n)", + "endCaptures": { + "1": { + "name": "punctuation.definition.string.end.python" + }, + "2": { + "name": "meta.empty-string.double.python" + }, + "3": { + "name": "invalid.illegal.unclosed-string.python" + } + }, + "name": "string.quoted.double.single-line.binary.python", + "patterns": [ + { + "include": "#escaped_char" + }, + { + "include": "#string_formatting" + }, + { + "match": "[^\\x{01}-\\x{7f}]", + "name": "invalid.illegal.character-out-of-range.python" + } + ] + }, + { + "begin": "([rR][bB]|[bB][rR])(\")", + "beginCaptures": { + "1": { + "name": "storage.type.string.python" + }, + "2": { + "name": "punctuation.definition.string.begin.python" + } + }, + "end": "((?<=\")(\")|\")|(\\n)", + "endCaptures": { + "1": { + "name": "punctuation.definition.string.end.python" + }, + "2": { + "name": "meta.empty-string.double.python" + }, + "3": { + "name": "invalid.illegal.unclosed-string.python" + } + }, + "name": "string.quoted.double.single-line.raw-binary.python", + "patterns": [ + { + "include": "#escaped_char" + }, + { + "include": "#string_formatting" + }, + { + "match": "[^\\x{01}-\\x{7f}]", + "name": "invalid.illegal.character-out-of-range.python" + } + ] + }, + { + "begin": "(\"\"\")", + "beginCaptures": { + "1": { + "name": "punctuation.definition.string.begin.python" + } + }, + "comment": "double quoted string", + "end": "((?<=\"\"\")(\")\"\"|\"\"\")", + "endCaptures": { + "1": { + "name": "punctuation.definition.string.end.python" + }, + "2": { + "name": "meta.empty-string.double.python" + } + }, + "name": "string.quoted.double.block.python", + "patterns": [ + { + "begin": "(?=\\s*(SELECT|INSERT|UPDATE|DELETE(?! /)|CREATE|REPLACE|ALTER|WITH))", + "name": "meta.embedded.sql", + "end": "(?=\\s*\"\"\")", + "patterns": [ + { + "include": "source.sql" + } + ] + } + ] + }, + { + "begin": "(\")(?=\\s*(SELECT|INSERT|UPDATE|DELETE(?! /)|CREATE|REPLACE|ALTER|WITH))", + "beginCaptures": { + "1": { + "name": "punctuation.definition.string.begin.python" + } + }, + "comment": "double quoted string", + "end": "((?<=\")(\")|\")|(\\n)", + "endCaptures": { + "1": { + "name": "punctuation.definition.string.end.python" + }, + "2": { + "name": "meta.empty-string.double.python" + }, + "3": { + "name": "invalid.illegal.unclosed-string.python" + } + }, + "name": "string.quoted.double.single-line.sql.python", + "contentName": "meta.embedded.sql", + "patterns": [ + { + "include": "source.sql" + } + ] + }, + { + "begin": "(\"\"\")", + "beginCaptures": { + "1": { + "name": "punctuation.definition.string.begin.python" + } + }, + "comment": "double quoted string", + "end": "((?<=\"\"\")(\")\"\"|\"\"\")", + "endCaptures": { + "1": { + "name": "punctuation.definition.string.end.python" + }, + "2": { + "name": "meta.empty-string.double.python" + } + }, + "name": "string.quoted.double.block.python", + "patterns": [ + { + "include": "#string_formatting" + }, + { + "include": "#escaped_char" + } + ] + }, + { + "begin": "(\")", + "beginCaptures": { + "1": { + "name": "punctuation.definition.string.begin.python" + } + }, + "comment": "double quoted string", + "end": "((?<=\")(\")|\")|(\\n)", + "endCaptures": { + "1": { + "name": "punctuation.definition.string.end.python" + }, + "2": { + "name": "meta.empty-string.double.python" + }, + "3": { + "name": "invalid.illegal.unclosed-string.python" + } + }, + "name": "string.quoted.double.single-line.python", + "patterns": [ + { + "include": "#string_formatting" + }, + { + "include": "#escaped_char" + } + ] + } + ] + }, + "string_quoted_single": { + "patterns": [ + { + "captures": { + "1": { + "name": "punctuation.definition.string.begin.python" + }, + "2": { + "name": "punctuation.definition.string.end.python" + }, + "3": { + "name": "meta.empty-string.single.python" + } + }, + "match": "(?<!')(')(('))(?!')", + "name": "string.quoted.single.single-line.python" + }, + { + "begin": "([uU]r)(''')", + "beginCaptures": { + "1": { + "name": "storage.type.string.python" + }, + "2": { + "name": "punctuation.definition.string.begin.python" + } + }, + "comment": "single quoted unicode-raw string", + "end": "((?<=''')(')''|''')", + "endCaptures": { + "1": { + "name": "punctuation.definition.string.end.python" + }, + "2": { + "name": "meta.empty-string.single.python" + } + }, + "name": "string.quoted.single.block.unicode-raw-regex.python", + "patterns": [ + { + "include": "#string_formatting" + }, + { + "include": "#escaped_unicode_char" + }, + { + "include": "#escaped_char" + }, + { + "include": "#regular_expressions" + } + ] + }, + { + "begin": "([uU]R)(''')", + "beginCaptures": { + "1": { + "name": "storage.type.string.python" + }, + "2": { + "name": "punctuation.definition.string.begin.python" + } + }, + "comment": "single quoted unicode-raw string", + "end": "((?<=''')(')''|''')", + "endCaptures": { + "1": { + "name": "punctuation.definition.string.end.python" + }, + "2": { + "name": "meta.empty-string.single.python" + } + }, + "name": "string.quoted.single.block.unicode-raw.python", + "patterns": [ + { + "include": "#string_formatting" + }, + { + "include": "#escaped_unicode_char" + }, + { + "include": "#escaped_char" + } + ] + }, + { + "begin": "(r)(''')", + "beginCaptures": { + "1": { + "name": "storage.type.string.python" + }, + "2": { + "name": "punctuation.definition.string.begin.python" + } + }, + "comment": "single quoted raw string", + "end": "((?<=''')(')''|''')", + "endCaptures": { + "1": { + "name": "punctuation.definition.string.end.python" + }, + "2": { + "name": "meta.empty-string.single.python" + } + }, + "name": "string.quoted.single.block.raw-regex.python", + "patterns": [ + { + "include": "#string_formatting" + }, + { + "include": "#escaped_char" + }, + { + "include": "#regular_expressions" + } + ] + }, + { + "begin": "(R)(''')", + "beginCaptures": { + "1": { + "name": "storage.type.string.python" + }, + "2": { + "name": "punctuation.definition.string.begin.python" + } + }, + "comment": "single quoted raw string", + "end": "((?<=''')(')''|''')", + "endCaptures": { + "1": { + "name": "punctuation.definition.string.end.python" + }, + "2": { + "name": "meta.empty-string.single.python" + } + }, + "name": "string.quoted.single.block.raw.python", + "patterns": [ + { + "include": "#string_formatting" + }, + { + "include": "#escaped_char" + } + ] + }, + { + "begin": "([uU])(''')", + "beginCaptures": { + "1": { + "name": "storage.type.string.python" + }, + "2": { + "name": "punctuation.definition.string.begin.python" + } + }, + "comment": "single quoted unicode string", + "end": "((?<=''')(')''|''')", + "endCaptures": { + "1": { + "name": "punctuation.definition.string.end.python" + }, + "2": { + "name": "meta.empty-string.single.python" + } + }, + "name": "string.quoted.single.block.unicode.python", + "patterns": [ + { + "include": "#string_formatting" + }, + { + "include": "#escaped_char" + } + ] + }, + { + "begin": "([fF])(''')", + "beginCaptures": { + "1": { + "name": "storage.type.string.python" + }, + "2": { + "name": "punctuation.definition.string.begin.python" + } + }, + "end": "((?<=''')(')''|''')", + "endCaptures": { + "1": { + "name": "punctuation.definition.string.end.python" + }, + "2": { + "name": "meta.empty-string.single.python" + } + }, + "name": "string.quoted.single.block.format.python", + "patterns": [ + { + "include": "#escaped_char" + }, + { + "include": "#string_interpolation" + }, + { + "match": "}", + "name": "invalid.illegal.closing-curly-bracket.python" + } + ] + }, + { + "begin": "([rR][fF]|[fF][rR])(''')", + "beginCaptures": { + "1": { + "name": "storage.type.string.python" + }, + "2": { + "name": "punctuation.definition.string.begin.python" + } + }, + "end": "((?<=''')(')''|''')", + "endCaptures": { + "1": { + "name": "punctuation.definition.string.end.python" + }, + "2": { + "name": "meta.empty-string.single.python" + } + }, + "name": "string.quoted.single.block.raw-format.python", + "patterns": [ + { + "include": "#escaped_char" + }, + { + "include": "#string_interpolation" + }, + { + "match": "}", + "name": "invalid.illegal.closing-curly-bracket.python" + } + ] + }, + { + "begin": "([bB])(''')", + "beginCaptures": { + "1": { + "name": "storage.type.string.python" + }, + "2": { + "name": "punctuation.definition.string.begin.python" + } + }, + "end": "((?<=''')(')''|''')", + "endCaptures": { + "1": { + "name": "punctuation.definition.string.end.python" + }, + "2": { + "name": "meta.empty-string.single.python" + } + }, + "name": "string.quoted.single.block.binary.python", + "patterns": [ + { + "include": "#escaped_char" + }, + { + "include": "#string_formatting" + }, + { + "match": "[^\\x{01}-\\x{7f}]", + "name": "invalid.illegal.character-out-of-range.python" + } + ] + }, + { + "begin": "([rR][bB]|[bB][rR])(''')", + "beginCaptures": { + "1": { + "name": "storage.type.string.python" + }, + "2": { + "name": "punctuation.definition.string.begin.python" + } + }, + "end": "((?<=''')(')''|''')", + "endCaptures": { + "1": { + "name": "punctuation.definition.string.end.python" + }, + "2": { + "name": "meta.empty-string.single.python" + } + }, + "name": "string.quoted.single.block.raw-binary.python", + "patterns": [ + { + "include": "#escaped_char" + }, + { + "include": "#string_formatting" + }, + { + "match": "[^\\x{01}-\\x{7f}]", + "name": "invalid.illegal.character-out-of-range.python" + } + ] + }, + { + "captures": { + "1": { + "name": "storage.type.string.python" + }, + "2": { + "name": "punctuation.definition.string.begin.python" + }, + "3": { + "patterns": [ + { + "include": "#string_formatting" + }, + { + "include": "#escaped_unicode_char" + }, + { + "include": "#escaped_char" + }, + { + "include": "#regular_expressions" + } + ] + }, + "4": { + "name": "punctuation.definition.string.end.python" + } + }, + "comment": "single quoted raw string", + "match": "([uU]r)(')((?:[^'\\\\]|\\\\.)*)(')", + "name": "string.quoted.single.single-line.unicode-raw-regex.python" + }, + { + "begin": "([uU]R)(')", + "beginCaptures": { + "1": { + "name": "storage.type.string.python" + }, + "2": { + "name": "punctuation.definition.string.begin.python" + } + }, + "comment": "single quoted raw string", + "end": "(')|(\\n)", + "endCaptures": { + "1": { + "name": "punctuation.definition.string.end.python" + }, + "2": { + "name": "invalid.illegal.unclosed-string.python" + } + }, + "name": "string.quoted.single.single-line.unicode-raw.python", + "patterns": [ + { + "include": "#string_formatting" + }, + { + "include": "#escaped_unicode_char" + }, + { + "include": "#escaped_char" + } + ] + }, + { + "captures": { + "1": { + "name": "storage.type.string.python" + }, + "2": { + "name": "punctuation.definition.string.begin.python" + }, + "3": { + "patterns": [ + { + "include": "#string_formatting" + }, + { + "include": "#escaped_char" + }, + { + "include": "#regular_expressions" + } + ] + }, + "4": { + "name": "punctuation.definition.string.end.python" + } + }, + "comment": "single quoted raw string", + "match": "(r)(')((?:[^'\\\\]|\\\\.)*)(')", + "name": "string.quoted.single.single-line.raw-regex.python" + }, + { + "begin": "(R)(')", + "beginCaptures": { + "1": { + "name": "storage.type.string.python" + }, + "2": { + "name": "punctuation.definition.string.begin.python" + } + }, + "comment": "single quoted raw string", + "end": "(')|(\\n)", + "endCaptures": { + "1": { + "name": "punctuation.definition.string.end.python" + }, + "2": { + "name": "invalid.illegal.unclosed-string.python" + } + }, + "name": "string.quoted.single.single-line.raw.python", + "patterns": [ + { + "include": "#string_formatting" + }, + { + "include": "#escaped_char" + } + ] + }, + { + "begin": "([uU])(')", + "beginCaptures": { + "1": { + "name": "storage.type.string.python" + }, + "2": { + "name": "punctuation.definition.string.begin.python" + } + }, + "comment": "single quoted unicode string", + "end": "(')|(\\n)", + "endCaptures": { + "1": { + "name": "punctuation.definition.string.end.python" + }, + "2": { + "name": "invalid.illegal.unclosed-string.python" + } + }, + "name": "string.quoted.single.single-line.unicode.python", + "patterns": [ + { + "include": "#string_formatting" + }, + { + "include": "#escaped_unicode_char" + }, + { + "include": "#escaped_char" + } + ] + }, + { + "begin": "([fF])(')", + "beginCaptures": { + "1": { + "name": "storage.type.string.python" + }, + "2": { + "name": "punctuation.definition.string.begin.python" + } + }, + "end": "(')|(\\n)", + "endCaptures": { + "1": { + "name": "punctuation.definition.string.end.python" + }, + "2": { + "name": "invalid.illegal.unclosed-string.python" + } + }, + "name": "string.quoted.single.single-line.format.python", + "patterns": [ + { + "include": "#escaped_char" + }, + { + "include": "#string_interpolation" + }, + { + "match": "}", + "name": "invalid.illegal.closing-curly-bracket.python" + } + ] + }, + { + "begin": "([rR][fF]|[fF][rR])(')", + "beginCaptures": { + "1": { + "name": "storage.type.string.python" + }, + "2": { + "name": "punctuation.definition.string.begin.python" + } + }, + "end": "(')|(\\n)", + "endCaptures": { + "1": { + "name": "punctuation.definition.string.end.python" + }, + "2": { + "name": "invalid.illegal.unclosed-string.python" + } + }, + "name": "string.quoted.single.single-line.raw-format.python", + "patterns": [ + { + "include": "#escaped_char" + }, + { + "include": "#string_interpolation" + }, + { + "match": "}", + "name": "invalid.illegal.closing-curly-bracket.python" + } + ] + }, + { + "begin": "([bB])(')", + "beginCaptures": { + "1": { + "name": "storage.type.string.python" + }, + "2": { + "name": "punctuation.definition.string.begin.python" + } + }, + "end": "(')|(\\n)", + "endCaptures": { + "1": { + "name": "punctuation.definition.string.end.python" + }, + "2": { + "name": "invalid.illegal.unclosed-string.python" + } + }, + "name": "string.quoted.single.single-line.binary.python", + "patterns": [ + { + "include": "#escaped_char" + }, + { + "include": "#string_formatting" + }, + { + "match": "[^\\x{01}-\\x{7f}]", + "name": "invalid.illegal.character-out-of-range.python" + } + ] + }, + { + "begin": "([rR][bB]|[bB][rR])(')", + "beginCaptures": { + "1": { + "name": "storage.type.string.python" + }, + "2": { + "name": "punctuation.definition.string.begin.python" + } + }, + "end": "(')|(\\n)", + "endCaptures": { + "1": { + "name": "punctuation.definition.string.end.python" + }, + "2": { + "name": "invalid.illegal.unclosed-string.python" + } + }, + "name": "string.quoted.single.single-line.raw-binary.python", + "patterns": [ + { + "include": "#escaped_char" + }, + { + "include": "#string_formatting" + }, + { + "match": "[^\\x{01}-\\x{7f}]", + "name": "invalid.illegal.character-out-of-range.python" + } + ] + }, + { + "begin": "(''')", + "beginCaptures": { + "1": { + "name": "punctuation.definition.string.begin.python" + } + }, + "comment": "single quoted string", + "end": "((?<=''')(')''|''')", + "endCaptures": { + "1": { + "name": "punctuation.definition.string.end.python" + }, + "2": { + "name": "meta.empty-string.single.python" + } + }, + "name": "string.quoted.single.block.python", + "patterns": [ + { + "begin": "(?=\\s*(SELECT|INSERT|UPDATE|DELETE(?! /)|CREATE|REPLACE|ALTER|WITH))", + "end": "(?=\\s*''')", + "name": "meta.embedded.sql", + "patterns": [ + { + "include": "source.sql" + } + ] + } + ] + }, + { + "begin": "(')(?=\\s*(SELECT|INSERT|UPDATE|DELETE(?! /)|CREATE|REPLACE|ALTER|WITH))", + "beginCaptures": { + "1": { + "name": "punctuation.definition.string.begin.python" + } + }, + "comment": "single quoted string", + "end": "(')|(\\n)", + "endCaptures": { + "1": { + "name": "punctuation.definition.string.end.python" + }, + "2": { + "name": "invalid.illegal.unclosed-string.python" + } + }, + "name": "string.quoted.single.single-line.sql.python", + "contentName": "meta.embedded.sql", + "patterns": [ + { + "include": "source.sql" + } + ] + }, + { + "begin": "(''')", + "beginCaptures": { + "1": { + "name": "punctuation.definition.string.begin.python" + } + }, + "comment": "single quoted string", + "end": "((?<=''')(')''|''')", + "endCaptures": { + "1": { + "name": "punctuation.definition.string.end.python" + }, + "2": { + "name": "meta.empty-string.single.python" + } + }, + "name": "string.quoted.single.block.python", + "patterns": [ + { + "include": "#string_formatting" + }, + { + "include": "#escaped_char" + } + ] + }, + { + "begin": "(')", + "beginCaptures": { + "1": { + "name": "punctuation.definition.string.begin.python" + } + }, + "comment": "single quoted string", + "end": "(')|(\\n)", + "endCaptures": { + "1": { + "name": "punctuation.definition.string.end.python" + }, + "2": { + "name": "invalid.illegal.unclosed-string.python" + } + }, + "name": "string.quoted.single.single-line.python", + "patterns": [ + { + "include": "#string_formatting" + }, + { + "include": "#escaped_char" + } + ] + } + ] + }, + "strings": { + "patterns": [ + { + "include": "#string_quoted_double" + }, + { + "include": "#string_quoted_single" + } + ] + } + } +} diff --git a/data/source.regexp.python.json b/data/source.regexp.python.json new file mode 100644 index 0000000..9498ce2 --- /dev/null +++ b/data/source.regexp.python.json @@ -0,0 +1,178 @@ +{ + "name": "Regular Expressions (Python)", + "scopeName": "source.regexp.python", + "foldingStartMarker": "(/\\*|\\{|\\()", + "foldingStopMarker": "(\\*/|\\}|\\))", + "fileTypes": [ + "re" + ], + "patterns": [ + { + "match": "\\\\[bBAZzG]|\\^|\\$", + "name": "keyword.control.anchor.regexp" + }, + { + "match": "\\\\[1-9][0-9]?", + "name": "keyword.other.back-reference.regexp" + }, + { + "match": "\\\\.", + "name": "constant.character.escape.backslash.regexp" + }, + { + "match": "[?+*][?+]?|\\{(\\d+,\\d+|\\d+,|,\\d+|\\d+)\\}\\??", + "name": "keyword.operator.quantifier.regexp" + }, + { + "match": "\\|", + "name": "keyword.operator.or.regexp" + }, + { + "begin": "\\(\\?\\#", + "end": "\\)", + "name": "comment.block.regexp" + }, + { + "comment": "We are restrictive in what we allow to go after the comment character to avoid false positives, since the availability of comments depend on regexp flags.", + "match": "(?<=^|\\s)#\\s[[a-zA-Z0-9,. \\t?!-:][^\\x{00}-\\x{7F}]]*$", + "name": "comment.line.number-sign.regexp" + }, + { + "match": "\\(\\?[iLmsux]+\\)", + "name": "keyword.other.option-toggle.regexp" + }, + { + "match": "(\\()(\\?P=([a-zA-Z_][a-zA-Z_0-9]*\\w*))(\\))", + "name": "keyword.other.back-reference.named.regexp" + }, + { + "begin": "(\\()((\\?=)|(\\?!)|(\\?<=)|(\\?<!))", + "beginCaptures": { + "1": { + "name": "punctuation.definition.group.regexp" + }, + "2": { + "name": "punctuation.definition.group.assertion.regexp" + }, + "3": { + "name": "meta.assertion.look-ahead.regexp" + }, + "4": { + "name": "meta.assertion.negative-look-ahead.regexp" + }, + "5": { + "name": "meta.assertion.look-behind.regexp" + }, + "6": { + "name": "meta.assertion.negative-look-behind.regexp" + } + }, + "end": "(\\))", + "endCaptures": { + "1": { + "name": "punctuation.definition.group.regexp" + } + }, + "name": "meta.group.assertion.regexp", + "patterns": [ + { + "include": "$self" + } + ] + }, + { + "begin": "(\\()(\\?\\(([1-9][0-9]?|[a-zA-Z_][a-zA-Z_0-9]*)\\))", + "beginCaptures": { + "1": { + "name": "punctuation.definition.group.regexp" + }, + "2": { + "name": "punctuation.definition.group.assertion.conditional.regexp" + }, + "3": { + "name": "entity.name.section.back-reference.regexp" + } + }, + "comment": "we can make this more sophisticated to match the | character that separates yes-pattern from no-pattern, but it's not really necessary.", + "end": "(\\))", + "name": "meta.group.assertion.conditional.regexp", + "patterns": [ + { + "include": "$self" + } + ] + }, + { + "begin": "(\\()((\\?P<)([a-z]\\w*)(>)|(\\?:))?", + "beginCaptures": { + "1": { + "name": "punctuation.definition.group.regexp" + }, + "3": { + "name": "punctuation.definition.group.capture.regexp" + }, + "4": { + "name": "entity.name.section.group.regexp" + }, + "5": { + "name": "punctuation.definition.group.capture.regexp" + }, + "6": { + "name": "punctuation.definition.group.no-capture.regexp" + } + }, + "end": "(\\))", + "endCaptures": { + "1": { + "name": "punctuation.definition.group.regexp" + } + }, + "name": "meta.group.regexp", + "patterns": [ + { + "include": "$self" + } + ] + }, + { + "begin": "(\\[)(\\^)?", + "beginCaptures": { + "1": { + "name": "punctuation.definition.character-class.begin.regexp" + }, + "2": { + "name": "keyword.operator.negation.regexp" + } + }, + "end": "(?!\\G)\\]", + "endCaptures": { + "0": { + "name": "punctuation.definition.character-class.end.regexp" + } + }, + "name": "constant.other.character-class.set.regexp", + "patterns": [ + { + "match": "\\\\[wWsSdDhH]", + "name": "constant.character.character-class.regexp" + }, + { + "match": "\\\\.", + "name": "constant.character.escape.backslash.regexp" + }, + { + "captures": { + "2": { + "name": "constant.character.escape.backslash.regexp" + }, + "4": { + "name": "constant.character.escape.backslash.regexp" + } + }, + "match": "((\\\\.)|.)\\-((\\\\.)|[^\\]])", + "name": "constant.other.character-class.range.regexp" + } + ] + } + ] +} diff --git a/data/source.ruby.gemfile.json b/data/source.ruby.gemfile.json new file mode 100644 index 0000000..cf6a61a --- /dev/null +++ b/data/source.ruby.gemfile.json @@ -0,0 +1,27 @@ +{ + "name": "Gemfile", + "scopeName": "source.ruby.gemfile", + "fileTypes": [ + "Gemfile" + ], + "patterns": [ + { + "include": "source.ruby" + }, + { + "begin": "\\b(?<!\\.|::)(gem|git|group|platforms|ruby|source)\\b(?![?!])", + "captures": { + "1": { + "name": "keyword.other.special-method.ruby.gemfile" + } + }, + "end": "$|(?=#|})", + "name": "meta.declaration.ruby.gemfile", + "patterns": [ + { + "include": "$self" + } + ] + } + ] +} diff --git a/data/source.ruby.json b/data/source.ruby.json new file mode 100644 index 0000000..8b06f74 --- /dev/null +++ b/data/source.ruby.json @@ -0,0 +1,2829 @@ +{ + "name": "Ruby", + "scopeName": "source.ruby", + "fileTypes": [ + "Appfile", + "Appraisals", + "arb", + "Berksfile", + "Brewfile", + "cap", + "Capfile", + "capfile", + "cgi", + "cr", + "Dangerfile", + "Deliverfile", + "Fastfile", + "fcgi", + "gemspec", + "Guardfile", + "irbrc", + "opal", + "Podfile", + "podspec", + "prawn", + "pryrc", + "Puppetfile", + "rabl", + "rake", + "Rakefile", + "Rantfile", + "rb", + "rbx", + "rjs", + "ru", + "ruby", + "Schemafile", + "Snapfile", + "thor", + "Thorfile", + "Vagrantfile" + ], + "firstLineMatch": "(?x)\n# Hashbang\n^\\#!.*(?:\\s|\\/)\n (?:ruby|macruby|rake|jruby|rbx|ruby_executable_hooks)\n(?:$|\\s)\n|\n# Modeline\n(?i:\n # Emacs\n -\\*-(?:\\s*(?=[^:;\\s]+\\s*-\\*-)|(?:.*?[;\\s]|(?<=-\\*-))mode\\s*:\\s*)\n ruby\n (?=[\\s;]|(?<![-*])-\\*-).*?-\\*-\n |\n # Vim\n (?:(?:\\s|^)vi(?:m[<=>]?\\d+|m)?|\\sex)(?=:(?=\\s*set?\\s[^\\n:]+:)|:(?!\\s*set?\\s))(?:(?:\\s|\\s*:\\s*)\\w*(?:\\s*=(?:[^\\n\\\\\\s]|\\\\.)*)?)*[\\s:](?:filetype|ft|syntax)\\s*=\n ruby\n (?=\\s|:|$)\n)", + "patterns": [ + { + "begin": "\\bclass\\b", + "beginCaptures": { + "0": { + "name": "keyword.control.class.ruby" + } + }, + "end": "\\s*$|(?![\\s\\w.:<])", + "name": "meta.class.ruby", + "patterns": [ + { + "match": "[A-Z]\\w*", + "name": "entity.name.type.class.ruby" + }, + { + "include": "#separators" + }, + { + "begin": "(<<)\\s*", + "beginCaptures": { + "1": { + "name": "punctuation.definition.variable.ruby" + } + }, + "contentName": "variable.other.object.ruby", + "end": "(?=$)|(?![\\s\\w.:])", + "patterns": [ + { + "match": "[A-Z]\\w*", + "name": "entity.name.type.class.ruby" + }, + { + "include": "#separators" + } + ] + }, + { + "begin": "(<)\\s*", + "beginCaptures": { + "1": { + "name": "punctuation.separator.inheritance.ruby" + } + }, + "contentName": "entity.other.inherited-class.ruby", + "end": "(?=$)|(?![\\s\\w.:])", + "patterns": [ + { + "match": "[A-Z]\\w*", + "name": "entity.name.type.class.ruby" + }, + { + "include": "#separators" + } + ] + } + ] + }, + { + "begin": "\\bmodule\\b", + "beginCaptures": { + "0": { + "name": "keyword.control.module.ruby" + } + }, + "end": "\\s*$|(?![\\s\\w.:])", + "name": "meta.module.ruby", + "patterns": [ + { + "match": "[A-Z]\\w*(?=::)", + "name": "entity.other.inherited-class.module.ruby" + }, + { + "match": "[A-Z]\\w*", + "name": "entity.name.type.module.ruby" + }, + { + "include": "#separators" + } + ] + }, + { + "comment": "else if is a common mistake carried over from other languages. it works if you put in a second end, but it’s never what you want.", + "match": "(?<!\\.)\\belse(\\s)+if\\b", + "name": "invalid.deprecated.ruby" + }, + { + "captures": { + "1": { + "name": "punctuation.definition.constant.hashkey.ruby" + } + }, + "comment": "symbols as hash key (1.9 syntax)", + "match": "(?>[a-zA-Z_]\\w*(?>[?!])?)(:)(?!:)", + "name": "constant.other.symbol.hashkey.ruby" + }, + { + "captures": { + "1": { + "name": "punctuation.definition.constant.ruby" + } + }, + "comment": "symbols as hash key (1.8 syntax)", + "match": "(?<!:)(:)(?>[a-zA-Z_]\\w*(?>[?!])?)(?=\\s*=>)", + "name": "constant.other.symbol.hashkey.ruby" + }, + { + "comment": "everything being a reserved word, not a value and needing a 'end' is a..", + "match": "(?<!\\.)\\b(BEGIN|begin|case|class|else|elsif|END|end|ensure|for|if|in|module|rescue|then|unless|until|when|while)\\b(?![?!])", + "name": "keyword.control.ruby" + }, + { + "comment": "contextual smart pair support for block parameters", + "match": "(?<!\\.)\\bdo\\b", + "name": "keyword.control.start-block.ruby" + }, + { + "comment": "contextual smart pair support", + "match": "(?<={)(\\s+)", + "name": "meta.syntax.ruby.start-block" + }, + { + "match": "(?<!\\.)\\b(alias|alias_method|break|next|redo|retry|return|super|undef|yield)\\b(?![?!])|\\bdefined\\?|\\b(block_given|iterator)\\?", + "name": "keyword.control.pseudo-method.ruby" + }, + { + "match": "\\bnil\\b(?![?!])", + "name": "constant.language.nil.ruby" + }, + { + "match": "\\b(true|false)\\b(?![?!])", + "name": "constant.language.boolean.ruby" + }, + { + "match": "\\b(__(FILE|LINE)__)\\b(?![?!])", + "name": "variable.language.ruby" + }, + { + "match": "\\bself\\b(?![?!])", + "name": "variable.language.self.ruby" + }, + { + "comment": " everything being a method but having a special function is a..", + "match": "\\b(initialize|new|loop|include|extend|prepend|raise|fail|attr_reader|attr_writer|attr_accessor|attr|catch|throw|private|private_class_method|module_function|public|public_class_method|protected|refine|using)\\b(?![?!])", + "name": "keyword.other.special-method.ruby" + }, + { + "begin": "\\b(?<!\\.|::)(require|require_relative)\\b(?![?!])", + "captures": { + "1": { + "name": "keyword.other.special-method.ruby" + } + }, + "end": "$|(?=#|})", + "name": "meta.require.ruby", + "patterns": [ + { + "include": "$self" + } + ] + }, + { + "captures": { + "1": { + "name": "punctuation.definition.variable.ruby" + } + }, + "match": "(@)[a-zA-Z_]\\w*", + "name": "variable.other.readwrite.instance.ruby" + }, + { + "captures": { + "1": { + "name": "punctuation.definition.variable.ruby" + } + }, + "match": "(@@)[a-zA-Z_]\\w*", + "name": "variable.other.readwrite.class.ruby" + }, + { + "captures": { + "1": { + "name": "punctuation.definition.variable.ruby" + } + }, + "match": "(\\$)[a-zA-Z_]\\w*", + "name": "variable.other.readwrite.global.ruby" + }, + { + "captures": { + "1": { + "name": "punctuation.definition.variable.ruby" + } + }, + "match": "(\\$)(!|@|&|`|'|\\+|\\d+|~|=|/|\\\\|,|;|\\.|<|>|_|\\*|\\$|\\?|:|\"|-[0adFiIlpv])", + "name": "variable.other.readwrite.global.pre-defined.ruby" + }, + { + "begin": "\\b(ENV)\\[", + "beginCaptures": { + "1": { + "name": "variable.other.constant.ruby" + } + }, + "end": "]", + "name": "meta.environment-variable.ruby", + "patterns": [ + { + "include": "$self" + } + ] + }, + { + "match": "\\b[A-Z]\\w*(?=((\\.|::)[A-Za-z]|\\[))", + "name": "support.class.ruby" + }, + { + "match": "\\b((abort|at_exit|autoload|binding|callcc|caller|caller_locations|chomp|chop|eval|exec|exit|fork|format|gets|global_variables|gsub|lambda|load|local_variables|open|p|print|printf|proc|putc|puts|rand|readline|readlines|select|set_trace_func|sleep|spawn|sprintf|srand|sub|syscall|system|test|trace_var|trap|untrace_var|warn)\\b(?![?!])|autoload\\?|exit!)", + "name": "support.function.kernel.ruby" + }, + { + "match": "\\b[_A-Z]\\w*\\b", + "name": "variable.other.constant.ruby" + }, + { + "begin": "(?x)\n(?=def\\b) # optimization to help Oniguruma fail fast\n(?<=^|\\s)(def)\\s+\n(\n (?:(self)(\\.|::))?\n (?>[a-zA-Z_]\\w*(?>(\\.|::)))* # method prefix\n (?> # method name\n [a-zA-Z_]\\w*(?>[?!]|=(?!>))?\n |\n ===?|!=|>[>=]?|<=>|<[<=]?|[%&`/\\|]|\\*\\*?|=?~|[-+]@?|\\[]=?\n )\n)\n\\s*(\\()", + "beginCaptures": { + "1": { + "name": "keyword.control.def.ruby" + }, + "2": { + "name": "entity.name.function.ruby" + }, + "3": { + "name": "variable.language.self.ruby" + }, + "4": { + "name": "punctuation.separator.method.ruby" + }, + "5": { + "comment": "Unfortunately, the repeated pattern (\\.|::)* only captures the last occurring separator", + "name": "punctuation.separator.method.ruby" + }, + "6": { + "name": "punctuation.definition.parameters.ruby" + } + }, + "comment": "The method pattern comes from the symbol pattern. See there for an explanation.", + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.definition.parameters.ruby" + } + }, + "name": "meta.function.method.with-arguments.ruby", + "patterns": [ + { + "begin": "(?![\\s,)])", + "end": "(?=,|\\)\\s*$)", + "patterns": [ + { + "captures": { + "1": { + "name": "storage.type.variable.ruby" + }, + "2": { + "name": "constant.other.symbol.hashkey.parameter.function.ruby" + }, + "3": { + "name": "punctuation.definition.constant.hashkey.ruby" + }, + "4": { + "name": "variable.parameter.function.ruby" + } + }, + "match": "\\G([&*]?)(?:([_a-zA-Z]\\w*(:))|([_a-zA-Z]\\w*))" + }, + { + "include": "$self" + } + ] + }, + { + "match": ",", + "name": "punctuation.separator.delimiter.ruby" + } + ] + }, + { + "begin": "(?x)\n(?=def\\b) # optimization to help Oniguruma fail fast\n(?<=^|\\s)(def)\\s+\n(\n (?:(self)(\\.|::))?\n (?>[a-zA-Z_]\\w*(?>(\\.|::)))* # method prefix\n (?> # method name\n [a-zA-Z_]\\w*(?>[?!]|=(?!>))?\n |\n ===?|!=|>[>=]?|<=>|<[<=]?|[%&`/\\|]|\\*\\*?|=?~|[-+]@?|\\[]=?\n )\n)\n[ \\t]\n(?=[ \\t]*[^\\s#;]) # make sure the following is not comment", + "beginCaptures": { + "1": { + "name": "keyword.control.def.ruby" + }, + "2": { + "name": "entity.name.function.ruby" + }, + "3": { + "name": "variable.language.self.ruby" + }, + "4": { + "name": "punctuation.separator.method.ruby" + }, + "5": { + "comment": "Unfortunately, the repeated pattern (\\.|::)* only captures the last occurring separator", + "name": "punctuation.separator.method.ruby" + } + }, + "comment": "same as the previous rule, but without parentheses around the arguments", + "end": "$", + "name": "meta.function.method.with-arguments.ruby", + "patterns": [ + { + "begin": "(?![\\s,])", + "end": "(?=,|$)", + "patterns": [ + { + "captures": { + "1": { + "name": "storage.type.variable.ruby" + }, + "2": { + "name": "constant.other.symbol.hashkey.parameter.function.ruby" + }, + "3": { + "name": "punctuation.definition.constant.hashkey.ruby" + }, + "4": { + "name": "variable.parameter.function.ruby" + } + }, + "match": "\\G([&*]?)(?:([_a-zA-Z]\\w*(:))|([_a-zA-Z]\\w*))" + }, + { + "include": "$self" + } + ] + }, + { + "match": ",", + "name": "punctuation.separator.delimiter.ruby" + } + ] + }, + { + "captures": { + "1": { + "name": "keyword.control.def.ruby" + }, + "3": { + "name": "entity.name.function.ruby" + }, + "4": { + "name": "variable.language.self.ruby" + }, + "5": { + "name": "punctuation.separator.method.ruby" + }, + "6": { + "comment": "Unfortunately, the repeated pattern (\\.|::)* only captures the last occurring separator", + "name": "punctuation.separator.method.ruby" + } + }, + "comment": " the optional name is just to catch the def also without a method-name", + "match": "(?x)\n(?=def\\b) # optimization to help Oniguruma fail fast\n(?<=^|\\s)(def)\\b\n(\n \\s+\n (\n (?:(self)(\\.|::))?\n (?>[a-zA-Z_]\\w*(?>(\\.|::)))* # method prefix\n (?> # method name\n [a-zA-Z_]\\w*(?>[?!]|=(?!>))?\n |\n ===?|!=|>[>=]?|<=>|<[<=]?|[%&`/\\|]|\\*\\*?|=?~|[-+]@?|\\[]=?\n )\n )\n)?", + "name": "meta.function.method.without-arguments.ruby" + }, + { + "match": "(?x)\n\\b\n(\n [\\d](?>_?\\d)* # 100_000\n (\\.(?![^[:space:][:digit:]])(?>_?\\d)*)? # fractional part\n ([eE][-+]?\\d(?>_?\\d)*)? # 1.23e-4\n |\n 0\n (?:\n [xX]\\h(?>_?\\h)*|\n [oO]?[0-7](?>_?[0-7])*|\n [bB][01](?>_?[01])*|\n [dD]\\d(?>_?\\d)*\n ) # A base indicator can only be used with an integer\n)\\b", + "name": "constant.numeric.ruby" + }, + { + "begin": ":'", + "beginCaptures": { + "0": { + "name": "punctuation.definition.symbol.begin.ruby" + } + }, + "comment": "symbol literal with '' delimitor", + "end": "'", + "endCaptures": { + "0": { + "name": "punctuation.definition.symbol.end.ruby" + } + }, + "name": "constant.other.symbol.ruby", + "patterns": [ + { + "match": "\\\\['\\\\]", + "name": "constant.character.escape.ruby" + } + ] + }, + { + "begin": ":\"", + "beginCaptures": { + "0": { + "name": "punctuation.section.symbol.begin.ruby" + } + }, + "comment": "symbol literal with \"\" delimitor", + "end": "\"", + "endCaptures": { + "0": { + "name": "punctuation.section.symbol.end.ruby" + } + }, + "name": "constant.other.symbol.interpolated.ruby", + "patterns": [ + { + "include": "#interpolated_ruby" + }, + { + "include": "#escaped_char" + } + ] + }, + { + "comment": "Needs higher precidence than regular expressions.", + "match": "(?<!\\()/=", + "name": "keyword.operator.assignment.augmented.ruby" + }, + { + "begin": "'", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.ruby" + } + }, + "comment": "string literal with '' delimitor", + "end": "'", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.ruby" + } + }, + "name": "string.quoted.single.ruby", + "patterns": [ + { + "match": "\\\\'|\\\\\\\\", + "name": "constant.character.escape.ruby" + } + ] + }, + { + "begin": "\"", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.ruby" + } + }, + "comment": "string literal with interpolation and \"\" delimitor", + "end": "\"", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.ruby" + } + }, + "name": "string.quoted.double.interpolated.ruby", + "patterns": [ + { + "include": "#interpolated_ruby" + }, + { + "include": "#escaped_char" + } + ] + }, + { + "begin": "`", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.ruby" + } + }, + "comment": "execute string (allows for interpolation)", + "end": "`", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.ruby" + } + }, + "name": "string.interpolated.ruby", + "patterns": [ + { + "include": "#interpolated_ruby" + }, + { + "include": "#escaped_char" + } + ] + }, + { + "begin": "(?x)\n(?<![\\w)])((/))(?![?*+])\n(?=\n (?:\\\\/|[^/])*+ # Do NOT change the order\n /[eimnosux]*\\s*\n (?:\n [)\\]}#.,?:]|\\|\\||&&|<=>|=>|==|=~|!~|!=|;|$|\n if|else|elsif|then|do|end|unless|while|until|or|and\n )\n |\n $\n)", + "captures": { + "1": { + "name": "string.regexp.interpolated.ruby" + }, + "2": { + "name": "punctuation.section.regexp.ruby" + } + }, + "comment": "regular expression literal with interpolation", + "contentName": "string.regexp.interpolated.ruby", + "end": "((/[eimnosux]*))", + "patterns": [ + { + "include": "#regex_sub" + } + ] + }, + { + "begin": "%r{", + "beginCaptures": { + "0": { + "name": "punctuation.section.regexp.begin.ruby" + } + }, + "end": "}[eimnosux]*", + "endCaptures": { + "0": { + "name": "punctuation.section.regexp.end.ruby" + } + }, + "name": "string.regexp.interpolated.ruby", + "patterns": [ + { + "include": "#regex_sub" + }, + { + "include": "#nest_curly_r" + } + ] + }, + { + "begin": "%r\\[", + "beginCaptures": { + "0": { + "name": "punctuation.section.regexp.begin.ruby" + } + }, + "end": "][eimnosux]*", + "endCaptures": { + "0": { + "name": "punctuation.section.regexp.end.ruby" + } + }, + "name": "string.regexp.interpolated.ruby", + "patterns": [ + { + "include": "#regex_sub" + }, + { + "include": "#nest_brackets_r" + } + ] + }, + { + "begin": "%r\\(", + "beginCaptures": { + "0": { + "name": "punctuation.section.regexp.begin.ruby" + } + }, + "end": "\\)[eimnosux]*", + "endCaptures": { + "0": { + "name": "punctuation.section.regexp.end.ruby" + } + }, + "name": "string.regexp.interpolated.ruby", + "patterns": [ + { + "include": "#regex_sub" + }, + { + "include": "#nest_parens_r" + } + ] + }, + { + "begin": "%r<", + "beginCaptures": { + "0": { + "name": "punctuation.section.regexp.begin.ruby" + } + }, + "end": ">[eimnosux]*", + "endCaptures": { + "0": { + "name": "punctuation.section.regexp.end.ruby" + } + }, + "name": "string.regexp.interpolated.ruby", + "patterns": [ + { + "include": "#regex_sub" + }, + { + "include": "#nest_ltgt_r" + } + ] + }, + { + "begin": "%r([^\\w])", + "beginCaptures": { + "0": { + "name": "punctuation.section.regexp.begin.ruby" + } + }, + "end": "\\1[eimnosux]*", + "endCaptures": { + "0": { + "name": "punctuation.section.regexp.end.ruby" + } + }, + "name": "string.regexp.interpolated.ruby", + "patterns": [ + { + "include": "#regex_sub" + } + ] + }, + { + "begin": "%I\\[", + "beginCaptures": { + "0": { + "name": "punctuation.section.array.begin.ruby" + } + }, + "end": "]", + "endCaptures": { + "0": { + "name": "punctuation.section.array.end.ruby" + } + }, + "name": "constant.other.symbol.interpolated.ruby", + "patterns": [ + { + "include": "#interpolated_ruby" + }, + { + "include": "#escaped_char" + }, + { + "include": "#nest_brackets_i" + } + ] + }, + { + "begin": "%I\\(", + "beginCaptures": { + "0": { + "name": "punctuation.section.array.begin.ruby" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.section.array.end.ruby" + } + }, + "name": "constant.other.symbol.interpolated.ruby", + "patterns": [ + { + "include": "#interpolated_ruby" + }, + { + "include": "#escaped_char" + }, + { + "include": "#nest_parens_i" + } + ] + }, + { + "begin": "%I<", + "beginCaptures": { + "0": { + "name": "punctuation.section.array.begin.ruby" + } + }, + "end": ">", + "endCaptures": { + "0": { + "name": "punctuation.section.array.end.ruby" + } + }, + "name": "constant.other.symbol.interpolated.ruby", + "patterns": [ + { + "include": "#interpolated_ruby" + }, + { + "include": "#escaped_char" + }, + { + "include": "#nest_ltgt_i" + } + ] + }, + { + "begin": "%I{", + "beginCaptures": { + "0": { + "name": "punctuation.section.array.begin.ruby" + } + }, + "end": "}", + "endCaptures": { + "0": { + "name": "punctuation.section.array.end.ruby" + } + }, + "name": "constant.other.symbol.interpolated.ruby", + "patterns": [ + { + "include": "#interpolated_ruby" + }, + { + "include": "#escaped_char" + }, + { + "include": "#nest_curly_i" + } + ] + }, + { + "begin": "%I([^\\w])", + "beginCaptures": { + "0": { + "name": "punctuation.section.array.begin.ruby" + } + }, + "end": "\\1", + "endCaptures": { + "0": { + "name": "punctuation.section.array.end.ruby" + } + }, + "name": "constant.other.symbol.interpolated.ruby", + "patterns": [ + { + "include": "#interpolated_ruby" + }, + { + "include": "#escaped_char" + } + ] + }, + { + "begin": "%i\\[", + "beginCaptures": { + "0": { + "name": "punctuation.section.array.begin.ruby" + } + }, + "end": "]", + "endCaptures": { + "0": { + "name": "punctuation.section.array.end.ruby" + } + }, + "name": "constant.other.symbol.ruby", + "patterns": [ + { + "match": "\\\\]|\\\\\\\\", + "name": "constant.character.escape.ruby" + }, + { + "include": "#nest_brackets" + } + ] + }, + { + "begin": "%i\\(", + "beginCaptures": { + "0": { + "name": "punctuation.section.array.begin.ruby" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.section.array.end.ruby" + } + }, + "name": "constant.other.symbol.ruby", + "patterns": [ + { + "match": "\\\\\\)|\\\\\\\\", + "name": "constant.character.escape.ruby" + }, + { + "include": "#nest_parens" + } + ] + }, + { + "begin": "%i<", + "beginCaptures": { + "0": { + "name": "punctuation.section.array.begin.ruby" + } + }, + "end": ">", + "endCaptures": { + "0": { + "name": "punctuation.section.array.end.ruby" + } + }, + "name": "constant.other.symbol.ruby", + "patterns": [ + { + "match": "\\\\>|\\\\\\\\", + "name": "constant.character.escape.ruby" + }, + { + "include": "#nest_ltgt" + } + ] + }, + { + "begin": "%i{", + "beginCaptures": { + "0": { + "name": "punctuation.section.array.begin.ruby" + } + }, + "end": "}", + "endCaptures": { + "0": { + "name": "punctuation.section.array.end.ruby" + } + }, + "name": "constant.other.symbol.ruby", + "patterns": [ + { + "match": "\\\\}|\\\\\\\\", + "name": "constant.character.escape.ruby" + }, + { + "include": "#nest_curly" + } + ] + }, + { + "begin": "%i([^\\w])", + "beginCaptures": { + "0": { + "name": "punctuation.section.array.begin.ruby" + } + }, + "end": "\\1", + "endCaptures": { + "0": { + "name": "punctuation.section.array.end.ruby" + } + }, + "name": "constant.other.symbol.ruby", + "patterns": [ + { + "comment": "Cant be named because its not neccesarily an escape.", + "match": "\\\\." + } + ] + }, + { + "begin": "%W\\[", + "beginCaptures": { + "0": { + "name": "punctuation.section.array.begin.ruby" + } + }, + "end": "]", + "endCaptures": { + "0": { + "name": "punctuation.section.array.end.ruby" + } + }, + "name": "string.quoted.other.interpolated.ruby", + "patterns": [ + { + "include": "#interpolated_ruby" + }, + { + "include": "#escaped_char" + }, + { + "include": "#nest_brackets_i" + } + ] + }, + { + "begin": "%W\\(", + "beginCaptures": { + "0": { + "name": "punctuation.section.array.begin.ruby" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.section.array.end.ruby" + } + }, + "name": "string.quoted.other.interpolated.ruby", + "patterns": [ + { + "include": "#interpolated_ruby" + }, + { + "include": "#escaped_char" + }, + { + "include": "#nest_parens_i" + } + ] + }, + { + "begin": "%W<", + "beginCaptures": { + "0": { + "name": "punctuation.section.array.begin.ruby" + } + }, + "end": ">", + "endCaptures": { + "0": { + "name": "punctuation.section.array.end.ruby" + } + }, + "name": "string.quoted.other.interpolated.ruby", + "patterns": [ + { + "include": "#interpolated_ruby" + }, + { + "include": "#escaped_char" + }, + { + "include": "#nest_ltgt_i" + } + ] + }, + { + "begin": "%W{", + "beginCaptures": { + "0": { + "name": "punctuation.section.array.begin.ruby" + } + }, + "end": "}", + "endCaptures": { + "0": { + "name": "punctuation.section.array.end.ruby" + } + }, + "name": "string.quoted.other.interpolated.ruby", + "patterns": [ + { + "include": "#interpolated_ruby" + }, + { + "include": "#escaped_char" + }, + { + "include": "#nest_curly_i" + } + ] + }, + { + "begin": "%W([^\\w])", + "beginCaptures": { + "0": { + "name": "punctuation.section.array.begin.ruby" + } + }, + "end": "\\1", + "endCaptures": { + "0": { + "name": "punctuation.section.array.end.ruby" + } + }, + "name": "string.quoted.other.interpolated.ruby", + "patterns": [ + { + "include": "#interpolated_ruby" + }, + { + "include": "#escaped_char" + } + ] + }, + { + "begin": "%w\\[", + "beginCaptures": { + "0": { + "name": "punctuation.section.array.begin.ruby" + } + }, + "end": "]", + "endCaptures": { + "0": { + "name": "punctuation.section.array.end.ruby" + } + }, + "name": "string.quoted.other.ruby", + "patterns": [ + { + "match": "\\\\]|\\\\\\\\", + "name": "constant.character.escape.ruby" + }, + { + "include": "#nest_brackets" + } + ] + }, + { + "begin": "%w\\(", + "beginCaptures": { + "0": { + "name": "punctuation.section.array.begin.ruby" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.section.array.end.ruby" + } + }, + "name": "string.quoted.other.ruby", + "patterns": [ + { + "match": "\\\\\\)|\\\\\\\\", + "name": "constant.character.escape.ruby" + }, + { + "include": "#nest_parens" + } + ] + }, + { + "begin": "%w<", + "beginCaptures": { + "0": { + "name": "punctuation.section.array.begin.ruby" + } + }, + "end": ">", + "endCaptures": { + "0": { + "name": "punctuation.section.array.end.ruby" + } + }, + "name": "string.quoted.other.ruby", + "patterns": [ + { + "match": "\\\\>|\\\\\\\\", + "name": "constant.character.escape.ruby" + }, + { + "include": "#nest_ltgt" + } + ] + }, + { + "begin": "%w{", + "beginCaptures": { + "0": { + "name": "punctuation.section.array.begin.ruby" + } + }, + "end": "}", + "endCaptures": { + "0": { + "name": "punctuation.section.array.end.ruby" + } + }, + "name": "string.quoted.other.ruby", + "patterns": [ + { + "match": "\\\\}|\\\\\\\\", + "name": "constant.character.escape.ruby" + }, + { + "include": "#nest_curly" + } + ] + }, + { + "begin": "%w([^\\w])", + "beginCaptures": { + "0": { + "name": "punctuation.section.array.begin.ruby" + } + }, + "end": "\\1", + "endCaptures": { + "0": { + "name": "punctuation.section.array.end.ruby" + } + }, + "name": "string.quoted.other.ruby", + "patterns": [ + { + "comment": "Cant be named because its not neccesarily an escape.", + "match": "\\\\." + } + ] + }, + { + "begin": "%[Qx]?\\(", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.ruby" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.ruby" + } + }, + "name": "string.quoted.other.interpolated.ruby", + "patterns": [ + { + "include": "#interpolated_ruby" + }, + { + "include": "#escaped_char" + }, + { + "include": "#nest_parens_i" + } + ] + }, + { + "begin": "%[Qx]?\\[", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.ruby" + } + }, + "end": "]", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.ruby" + } + }, + "name": "string.quoted.other.interpolated.ruby", + "patterns": [ + { + "include": "#interpolated_ruby" + }, + { + "include": "#escaped_char" + }, + { + "include": "#nest_brackets_i" + } + ] + }, + { + "begin": "%[Qx]?{", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.ruby" + } + }, + "end": "}", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.ruby" + } + }, + "name": "string.quoted.other.interpolated.ruby", + "patterns": [ + { + "include": "#interpolated_ruby" + }, + { + "include": "#escaped_char" + }, + { + "include": "#nest_curly_i" + } + ] + }, + { + "begin": "%[Qx]?<", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.ruby" + } + }, + "end": ">", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.ruby" + } + }, + "name": "string.quoted.other.interpolated.ruby", + "patterns": [ + { + "include": "#interpolated_ruby" + }, + { + "include": "#escaped_char" + }, + { + "include": "#nest_ltgt_i" + } + ] + }, + { + "begin": "%[Qx]([^\\w])", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.ruby" + } + }, + "end": "\\1", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.ruby" + } + }, + "name": "string.quoted.other.interpolated.ruby", + "patterns": [ + { + "include": "#interpolated_ruby" + }, + { + "include": "#escaped_char" + } + ] + }, + { + "begin": "%([^\\w\\s=])", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.ruby" + } + }, + "end": "\\1", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.ruby" + } + }, + "name": "string.quoted.other.interpolated.ruby", + "patterns": [ + { + "include": "#interpolated_ruby" + }, + { + "include": "#escaped_char" + } + ] + }, + { + "begin": "%q\\(", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.ruby" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.ruby" + } + }, + "name": "string.quoted.other.ruby", + "patterns": [ + { + "match": "\\\\\\)|\\\\\\\\", + "name": "constant.character.escape.ruby" + }, + { + "include": "#nest_parens" + } + ] + }, + { + "begin": "%q<", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.ruby" + } + }, + "end": ">", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.ruby" + } + }, + "name": "string.quoted.other.ruby", + "patterns": [ + { + "match": "\\\\>|\\\\\\\\", + "name": "constant.character.escape.ruby" + }, + { + "include": "#nest_ltgt" + } + ] + }, + { + "begin": "%q\\[", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.ruby" + } + }, + "end": "]", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.ruby" + } + }, + "name": "string.quoted.other.ruby", + "patterns": [ + { + "match": "\\\\]|\\\\\\\\", + "name": "constant.character.escape.ruby" + }, + { + "include": "#nest_brackets" + } + ] + }, + { + "begin": "%q{", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.ruby" + } + }, + "end": "}", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.ruby" + } + }, + "name": "string.quoted.other.ruby", + "patterns": [ + { + "match": "\\\\}|\\\\\\\\", + "name": "constant.character.escape.ruby" + }, + { + "include": "#nest_curly" + } + ] + }, + { + "begin": "%q([^\\w])", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.ruby" + } + }, + "end": "\\1", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.ruby" + } + }, + "name": "string.quoted.other.ruby", + "patterns": [ + { + "comment": "Cant be named because its not neccesarily an escape.", + "match": "\\\\." + } + ] + }, + { + "begin": "%s\\(", + "beginCaptures": { + "0": { + "name": "punctuation.definition.symbol.begin.ruby" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.definition.symbol.end.ruby" + } + }, + "name": "constant.other.symbol.ruby", + "patterns": [ + { + "match": "\\\\\\)|\\\\\\\\", + "name": "constant.character.escape.ruby" + }, + { + "include": "#nest_parens" + } + ] + }, + { + "begin": "%s<", + "beginCaptures": { + "0": { + "name": "punctuation.definition.symbol.begin.ruby" + } + }, + "end": ">", + "endCaptures": { + "0": { + "name": "punctuation.definition.symbol.end.ruby" + } + }, + "name": "constant.other.symbol.ruby", + "patterns": [ + { + "match": "\\\\>|\\\\\\\\", + "name": "constant.character.escape.ruby" + }, + { + "include": "#nest_ltgt" + } + ] + }, + { + "begin": "%s\\[", + "beginCaptures": { + "0": { + "name": "punctuation.definition.symbol.begin.ruby" + } + }, + "end": "]", + "endCaptures": { + "0": { + "name": "punctuation.definition.symbol.end.ruby" + } + }, + "name": "constant.other.symbol.ruby", + "patterns": [ + { + "match": "\\\\]|\\\\\\\\", + "name": "constant.character.escape.ruby" + }, + { + "include": "#nest_brackets" + } + ] + }, + { + "begin": "%s{", + "beginCaptures": { + "0": { + "name": "punctuation.definition.symbol.begin.ruby" + } + }, + "end": "}", + "endCaptures": { + "0": { + "name": "punctuation.definition.symbol.end.ruby" + } + }, + "name": "constant.other.symbol.ruby", + "patterns": [ + { + "match": "\\\\}|\\\\\\\\", + "name": "constant.character.escape.ruby" + }, + { + "include": "#nest_curly" + } + ] + }, + { + "begin": "%s([^\\w])", + "beginCaptures": { + "0": { + "name": "punctuation.definition.symbol.begin.ruby" + } + }, + "end": "\\1", + "endCaptures": { + "0": { + "name": "punctuation.definition.symbol.end.ruby" + } + }, + "name": "constant.other.symbol.ruby", + "patterns": [ + { + "comment": "Cant be named because its not neccesarily an escape.", + "match": "\\\\." + } + ] + }, + { + "captures": { + "1": { + "name": "punctuation.definition.constant.ruby" + } + }, + "comment": "symbols", + "match": "(?x)\n(?<!:)(:)\n(?>\n [$a-zA-Z_]\\w*(?>[?!]|=(?![>=]))?\n |\n ===?|<=>|>[>=]?|<[<=]?|[%&`/\\|]|\\*\\*?|=?~|[-+]@?|\\[]=?\n |\n @@?[a-zA-Z_]\\w*\n)", + "name": "constant.other.symbol.ruby" + }, + { + "begin": "^=begin", + "captures": { + "0": { + "name": "punctuation.definition.comment.ruby" + } + }, + "comment": "multiline comments", + "end": "^=end", + "name": "comment.block.documentation.ruby" + }, + { + "include": "#yard" + }, + { + "begin": "(^[ \\t]+)?(?=#)", + "beginCaptures": { + "1": { + "name": "punctuation.whitespace.comment.leading.ruby" + } + }, + "end": "(?!\\G)", + "patterns": [ + { + "begin": "#", + "beginCaptures": { + "0": { + "name": "punctuation.definition.comment.ruby" + } + }, + "end": "\\n", + "name": "comment.line.number-sign.ruby" + } + ] + }, + { + "comment": "\n\t\t\tmatches questionmark-letters.\n\n\t\t\texamples (1st alternation = hex):\n\t\t\t?\\x1 ?\\x61\n\n\t\t\texamples (2nd alternation = octal):\n\t\t\t?\\0 ?\\07 ?\\017\n\n\t\t\texamples (3rd alternation = escaped):\n\t\t\t?\\n ?\\b\n\n\t\t\texamples (4th alternation = meta-ctrl):\n\t\t\t?\\C-a ?\\M-a ?\\C-\\M-\\C-\\M-a\n\n\t\t\texamples (4th alternation = normal):\n\t\t\t?a ?A ?0 \n\t\t\t?* ?\" ?( \n\t\t\t?. ?#\n\t\t\t\n\t\t\t\n\t\t\tthe negative lookbehind prevents against matching\n\t\t\tp(42.tainted?)\n\t\t\t", + "match": "(?<!\\w)\\?(\\\\(x\\h{1,2}(?!\\h)\\b|0[0-7]{0,2}(?![0-7])\\b|[^x0MC])|(\\\\[MC]-)+\\w|[^\\s\\\\])", + "name": "constant.numeric.ruby" + }, + { + "begin": "^__END__\\n", + "captures": { + "0": { + "name": "string.unquoted.program-block.ruby" + } + }, + "comment": "__END__ marker", + "contentName": "text.plain", + "end": "(?=not)impossible", + "patterns": [ + { + "begin": "(?=<?xml|<(?i:html\\b)|!DOCTYPE (?i:html\\b))", + "end": "(?=not)impossible", + "name": "text.html.embedded.ruby", + "patterns": [ + { + "include": "text.html.basic" + } + ] + } + ] + }, + { + "begin": "(?=(?><<[-~]([\"'`]?)((?:[_\\w]+_|)HTML)\\b\\1))", + "comment": "Heredoc with embedded html", + "end": "(?!\\G)", + "name": "meta.embedded.block.html", + "patterns": [ + { + "begin": "(?><<[-~]([\"'`]?)((?:[_\\w]+_|)HTML)\\b\\1)", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.ruby" + } + }, + "contentName": "text.html", + "end": "^\\s*\\2$\\n?", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.ruby" + } + }, + "name": "string.unquoted.heredoc.ruby", + "patterns": [ + { + "include": "#heredoc" + }, + { + "include": "#interpolated_ruby" + }, + { + "include": "text.html.basic" + }, + { + "include": "#escaped_char" + } + ] + } + ] + }, + { + "begin": "(?=(?><<[-~]([\"'`]?)((?:[_\\w]+_|)XML)\\b\\1))", + "comment": "Heredoc with embedded xml", + "end": "(?!\\G)", + "name": "meta.embedded.block.xml", + "patterns": [ + { + "begin": "(?><<[-~]([\"'`]?)((?:[_\\w]+_|)XML)\\b\\1)", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.ruby" + } + }, + "contentName": "text.xml", + "end": "^\\s*\\2$\\n?", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.ruby" + } + }, + "name": "string.unquoted.heredoc.ruby", + "patterns": [ + { + "include": "#heredoc" + }, + { + "include": "#interpolated_ruby" + }, + { + "include": "text.xml" + }, + { + "include": "#escaped_char" + } + ] + } + ] + }, + { + "begin": "(?=(?><<[-~]([\"'`]?)((?:[_\\w]+_|)SQL)\\b\\1))", + "comment": "Heredoc with embedded sql", + "end": "(?!\\G)", + "name": "meta.embedded.block.sql", + "patterns": [ + { + "begin": "(?><<[-~]([\"'`]?)((?:[_\\w]+_|)SQL)\\b\\1)", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.ruby" + } + }, + "contentName": "source.sql", + "end": "^\\s*\\2$\\n?", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.ruby" + } + }, + "name": "string.unquoted.heredoc.ruby", + "patterns": [ + { + "include": "#heredoc" + }, + { + "include": "#interpolated_ruby" + }, + { + "include": "source.sql" + }, + { + "include": "#escaped_char" + } + ] + } + ] + }, + { + "begin": "(?=(?><<[-~]([\"'`]?)((?:[_\\w]+_|)GRAPHQL)\\b\\1))", + "comment": "Heredoc with embedded GraphQL", + "end": "(?!\\G)", + "name": "meta.embedded.block.graphql", + "patterns": [ + { + "begin": "(?><<[-~]([\"'`]?)((?:[_\\w]+_|)GRAPHQL)\\b\\1)", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.ruby" + } + }, + "contentName": "source.graphql", + "end": "^\\s*\\2$\\n?", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.ruby" + } + }, + "name": "string.unquoted.heredoc.ruby", + "patterns": [ + { + "include": "#heredoc" + }, + { + "include": "#interpolated_ruby" + }, + { + "include": "source.graphql" + }, + { + "include": "#escaped_char" + } + ] + } + ] + }, + { + "begin": "(?=(?><<[-~]([\"'`]?)((?:[_\\w]+_|)CSS)\\b\\1))", + "comment": "Heredoc with embedded css", + "end": "(?!\\G)", + "name": "meta.embedded.block.css", + "patterns": [ + { + "begin": "(?><<[-~]([\"'`]?)((?:[_\\w]+_|)CSS)\\b\\1)", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.ruby" + } + }, + "contentName": "source.css", + "end": "^\\s*\\2$\\n?", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.ruby" + } + }, + "name": "string.unquoted.heredoc.ruby", + "patterns": [ + { + "include": "#heredoc" + }, + { + "include": "#interpolated_ruby" + }, + { + "include": "source.css" + }, + { + "include": "#escaped_char" + } + ] + } + ] + }, + { + "begin": "(?=(?><<[-~]([\"'`]?)((?:[_\\w]+_|)CPP)\\b\\1))", + "comment": "Heredoc with embedded c++", + "end": "(?!\\G)", + "name": "meta.embedded.block.cpp", + "patterns": [ + { + "begin": "(?><<[-~]([\"'`]?)((?:[_\\w]+_|)CPP)\\b\\1)", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.ruby" + } + }, + "contentName": "source.cpp", + "end": "^\\s*\\2$\\n?", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.ruby" + } + }, + "name": "string.unquoted.heredoc.ruby", + "patterns": [ + { + "include": "#heredoc" + }, + { + "include": "#interpolated_ruby" + }, + { + "include": "source.cpp" + }, + { + "include": "#escaped_char" + } + ] + } + ] + }, + { + "begin": "(?=(?><<[-~]([\"'`]?)((?:[_\\w]+_|)C)\\b\\1))", + "comment": "Heredoc with embedded c", + "end": "(?!\\G)", + "name": "meta.embedded.block.c", + "patterns": [ + { + "begin": "(?><<[-~]([\"'`]?)((?:[_\\w]+_|)C)\\b\\1)", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.ruby" + } + }, + "contentName": "source.c", + "end": "^\\s*\\2$\\n?", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.ruby" + } + }, + "name": "string.unquoted.heredoc.ruby", + "patterns": [ + { + "include": "#heredoc" + }, + { + "include": "#interpolated_ruby" + }, + { + "include": "source.c" + }, + { + "include": "#escaped_char" + } + ] + } + ] + }, + { + "begin": "(?=(?><<[-~]([\"'`]?)((?:[_\\w]+_|)(?:JS|JAVASCRIPT))\\b\\1))", + "comment": "Heredoc with embedded javascript", + "end": "(?!\\G)", + "name": "meta.embedded.block.js", + "patterns": [ + { + "begin": "(?><<[-~]([\"'`]?)((?:[_\\w]+_|)(?:JS|JAVASCRIPT))\\b\\1)", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.ruby" + } + }, + "contentName": "source.js", + "end": "^\\s*\\2$\\n?", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.ruby" + } + }, + "name": "string.unquoted.heredoc.ruby", + "patterns": [ + { + "include": "#heredoc" + }, + { + "include": "#interpolated_ruby" + }, + { + "include": "source.js" + }, + { + "include": "#escaped_char" + } + ] + } + ] + }, + { + "begin": "(?=(?><<[-~]([\"'`]?)((?:[_\\w]+_|)JQUERY)\\b\\1))", + "comment": "Heredoc with embedded jQuery javascript", + "end": "(?!\\G)", + "name": "meta.embedded.block.js.jquery", + "patterns": [ + { + "begin": "(?><<[-~]([\"'`]?)((?:[_\\w]+_|)JQUERY)\\b\\1)", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.ruby" + } + }, + "contentName": "source.js.jquery", + "end": "^\\s*\\2$\\n?", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.ruby" + } + }, + "name": "string.unquoted.heredoc.ruby", + "patterns": [ + { + "include": "#heredoc" + }, + { + "include": "#interpolated_ruby" + }, + { + "include": "source.js.jquery" + }, + { + "include": "#escaped_char" + } + ] + } + ] + }, + { + "begin": "(?=(?><<[-~]([\"'`]?)((?:[_\\w]+_|)(?:SH|SHELL))\\b\\1))", + "comment": "Heredoc with embedded shell", + "end": "(?!\\G)", + "name": "meta.embedded.block.shell", + "patterns": [ + { + "begin": "(?><<[-~]([\"'`]?)((?:[_\\w]+_|)(?:SH|SHELL))\\b\\1)", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.ruby" + } + }, + "contentName": "source.shell", + "end": "^\\s*\\2$\\n?", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.ruby" + } + }, + "name": "string.unquoted.heredoc.ruby", + "patterns": [ + { + "include": "#heredoc" + }, + { + "include": "#interpolated_ruby" + }, + { + "include": "source.shell" + }, + { + "include": "#escaped_char" + } + ] + } + ] + }, + { + "begin": "(?=(?><<[-~]([\"'`]?)((?:[_\\w]+_|)LUA)\\b\\1))", + "comment": "Heredoc with embedded lua", + "end": "(?!\\G)", + "name": "meta.embedded.block.lua", + "patterns": [ + { + "begin": "(?><<[-~]([\"'`]?)((?:[_\\w]+_|)LUA)\\b\\1)", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.ruby" + } + }, + "contentName": "source.lua", + "end": "^\\s*\\2$\\n?", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.ruby" + } + }, + "name": "string.unquoted.heredoc.ruby", + "patterns": [ + { + "include": "#heredoc" + }, + { + "include": "#interpolated_ruby" + }, + { + "include": "source.lua" + }, + { + "include": "#escaped_char" + } + ] + } + ] + }, + { + "begin": "(?=(?><<[-~]([\"'`]?)((?:[_\\w]+_|)RUBY)\\b\\1))", + "comment": "Heredoc with embedded ruby", + "end": "(?!\\G)", + "name": "meta.embedded.block.ruby", + "patterns": [ + { + "begin": "(?><<[-~]([\"'`]?)((?:[_\\w]+_|)RUBY)\\b\\1)", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.ruby" + } + }, + "contentName": "source.ruby", + "end": "^\\s*\\2$\\n?", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.ruby" + } + }, + "name": "string.unquoted.heredoc.ruby", + "patterns": [ + { + "include": "#heredoc" + }, + { + "include": "#interpolated_ruby" + }, + { + "include": "source.ruby" + }, + { + "include": "#escaped_char" + } + ] + } + ] + }, + { + "begin": "(?>=\\s*<<([\"'`]?)(\\w+)\\1)", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.ruby" + } + }, + "end": "^\\2$", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.ruby" + } + }, + "name": "string.unquoted.heredoc.ruby", + "patterns": [ + { + "include": "#heredoc" + }, + { + "include": "#interpolated_ruby" + }, + { + "include": "#escaped_char" + } + ] + }, + { + "begin": "(?>((<<[-~]([\"'`]?)(\\w+)\\3,\\s?)*<<[-~]([\"'`]?)(\\w+)\\5))", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.ruby" + } + }, + "comment": "heredoc with multiple inputs and indented terminator", + "end": "^\\s*\\6$", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.ruby" + } + }, + "name": "string.unquoted.heredoc.ruby", + "patterns": [ + { + "include": "#heredoc" + }, + { + "include": "#interpolated_ruby" + }, + { + "include": "#escaped_char" + } + ] + }, + { + "begin": "(?<={|{\\s|[^A-Za-z0-9_]do|^do|[^A-Za-z0-9_]do\\s|^do\\s)(\\|)", + "captures": { + "1": { + "name": "punctuation.separator.variable.ruby" + } + }, + "end": "(?<!\\|)(\\|)(?!\\|)", + "patterns": [ + { + "include": "source.ruby" + }, + { + "match": "[_a-zA-Z][_a-zA-Z0-9]*", + "name": "variable.other.block.ruby" + }, + { + "match": ",", + "name": "punctuation.separator.variable.ruby" + } + ] + }, + { + "include": "#separators" + }, + { + "match": "->", + "name": "support.function.kernel.arrow.ruby" + }, + { + "match": "<<=|%=|&{1,2}=|\\*=|\\*\\*=|\\+=|-=|\\^=|\\|{1,2}=|<<", + "name": "keyword.operator.assignment.augmented.ruby" + }, + { + "match": "<=>|<(?!<|=)|>(?!<|=|>)|<=|>=|===|==|=~|!=|!~|(?<=[ \\t])\\?", + "name": "keyword.operator.comparison.ruby" + }, + { + "match": "(?<!\\.)\\b(and|not|or)\\b(?![?!])", + "name": "keyword.operator.logical.ruby" + }, + { + "match": "(?<=^|[ \\t])!|&&|\\|\\||\\^", + "name": "keyword.operator.logical.ruby" + }, + { + "match": "(%|&|\\*\\*|\\*|\\+|-|/)", + "name": "keyword.operator.arithmetic.ruby" + }, + { + "match": "=", + "name": "keyword.operator.assignment.ruby" + }, + { + "match": "\\||~|>>", + "name": "keyword.operator.other.ruby" + }, + { + "match": "{", + "name": "punctuation.section.scope.begin.ruby" + }, + { + "match": "}", + "name": "punctuation.section.scope.end.ruby" + }, + { + "match": "\\[", + "name": "punctuation.section.array.begin.ruby" + }, + { + "match": "]", + "name": "punctuation.section.array.end.ruby" + }, + { + "match": "\\(|\\)", + "name": "punctuation.section.function.ruby" + } + ], + "repository": { + "escaped_char": { + "match": "\\\\(?:[0-7]{1,3}|x[\\da-fA-F]{1,2}|.)", + "name": "constant.character.escape.ruby" + }, + "heredoc": { + "begin": "^<<[-~]?\\w+", + "end": "$", + "patterns": [ + { + "include": "$self" + } + ] + }, + "interpolated_ruby": { + "patterns": [ + { + "begin": "#{", + "beginCaptures": { + "0": { + "name": "punctuation.section.embedded.begin.ruby" + } + }, + "contentName": "source.ruby", + "end": "}", + "endCaptures": { + "0": { + "name": "punctuation.section.embedded.end.ruby" + } + }, + "name": "meta.embedded.line.ruby", + "patterns": [ + { + "include": "#nest_curly_and_self" + }, + { + "include": "$self" + } + ] + }, + { + "captures": { + "1": { + "name": "punctuation.definition.variable.ruby" + } + }, + "match": "(#@)[a-zA-Z_]\\w*", + "name": "variable.other.readwrite.instance.ruby" + }, + { + "captures": { + "1": { + "name": "punctuation.definition.variable.ruby" + } + }, + "match": "(#@@)[a-zA-Z_]\\w*", + "name": "variable.other.readwrite.class.ruby" + }, + { + "captures": { + "1": { + "name": "punctuation.definition.variable.ruby" + } + }, + "match": "(#\\$)[a-zA-Z_]\\w*", + "name": "variable.other.readwrite.global.ruby" + } + ] + }, + "nest_brackets": { + "begin": "\\[", + "captures": { + "0": { + "name": "punctuation.section.scope.ruby" + } + }, + "end": "]", + "patterns": [ + { + "include": "#nest_brackets" + } + ] + }, + "nest_brackets_i": { + "begin": "\\[", + "captures": { + "0": { + "name": "punctuation.section.scope.ruby" + } + }, + "end": "]", + "patterns": [ + { + "include": "#interpolated_ruby" + }, + { + "include": "#escaped_char" + }, + { + "include": "#nest_brackets_i" + } + ] + }, + "nest_brackets_r": { + "begin": "\\[", + "captures": { + "0": { + "name": "punctuation.section.scope.ruby" + } + }, + "end": "]", + "patterns": [ + { + "include": "#regex_sub" + }, + { + "include": "#nest_brackets_r" + } + ] + }, + "nest_curly": { + "begin": "{", + "captures": { + "0": { + "name": "punctuation.section.scope.ruby" + } + }, + "end": "}", + "patterns": [ + { + "include": "#nest_curly" + } + ] + }, + "nest_curly_and_self": { + "patterns": [ + { + "begin": "{", + "captures": { + "0": { + "name": "punctuation.section.scope.ruby" + } + }, + "end": "}", + "patterns": [ + { + "include": "#nest_curly_and_self" + } + ] + }, + { + "include": "$self" + } + ] + }, + "nest_curly_i": { + "begin": "{", + "captures": { + "0": { + "name": "punctuation.section.scope.ruby" + } + }, + "end": "}", + "patterns": [ + { + "include": "#interpolated_ruby" + }, + { + "include": "#escaped_char" + }, + { + "include": "#nest_curly_i" + } + ] + }, + "nest_curly_r": { + "begin": "{", + "captures": { + "0": { + "name": "punctuation.section.scope.ruby" + } + }, + "end": "}", + "patterns": [ + { + "include": "#regex_sub" + }, + { + "include": "#nest_curly_r" + } + ] + }, + "nest_ltgt": { + "begin": "<", + "captures": { + "0": { + "name": "punctuation.section.scope.ruby" + } + }, + "end": ">", + "patterns": [ + { + "include": "#nest_ltgt" + } + ] + }, + "nest_ltgt_i": { + "begin": "<", + "captures": { + "0": { + "name": "punctuation.section.scope.ruby" + } + }, + "end": ">", + "patterns": [ + { + "include": "#interpolated_ruby" + }, + { + "include": "#escaped_char" + }, + { + "include": "#nest_ltgt_i" + } + ] + }, + "nest_ltgt_r": { + "begin": "<", + "captures": { + "0": { + "name": "punctuation.section.scope.ruby" + } + }, + "end": ">", + "patterns": [ + { + "include": "#regex_sub" + }, + { + "include": "#nest_ltgt_r" + } + ] + }, + "nest_parens": { + "begin": "\\(", + "captures": { + "0": { + "name": "punctuation.section.scope.ruby" + } + }, + "end": "\\)", + "patterns": [ + { + "include": "#nest_parens" + } + ] + }, + "nest_parens_i": { + "begin": "\\(", + "captures": { + "0": { + "name": "punctuation.section.scope.ruby" + } + }, + "end": "\\)", + "patterns": [ + { + "include": "#interpolated_ruby" + }, + { + "include": "#escaped_char" + }, + { + "include": "#nest_parens_i" + } + ] + }, + "nest_parens_r": { + "begin": "\\(", + "captures": { + "0": { + "name": "punctuation.section.scope.ruby" + } + }, + "end": "\\)", + "patterns": [ + { + "include": "#regex_sub" + }, + { + "include": "#nest_parens_r" + } + ] + }, + "regex_sub": { + "patterns": [ + { + "include": "#interpolated_ruby" + }, + { + "include": "#escaped_char" + }, + { + "captures": { + "1": { + "name": "punctuation.definition.arbitrary-repetition.ruby" + }, + "3": { + "name": "punctuation.definition.arbitrary-repetition.ruby" + } + }, + "match": "({)\\d+(,\\d+)?(})", + "name": "string.regexp.arbitrary-repetition.ruby" + }, + { + "begin": "\\[(?:\\^?])?", + "captures": { + "0": { + "name": "punctuation.definition.character-class.ruby" + } + }, + "end": "]", + "name": "string.regexp.character-class.ruby", + "patterns": [ + { + "include": "#escaped_char" + } + ] + }, + { + "begin": "\\(\\?#", + "beginCaptures": { + "0": { + "name": "punctuation.definition.comment.begin.ruby" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.definition.comment.end.ruby" + } + }, + "name": "comment.line.number-sign.ruby", + "patterns": [ + { + "include": "#escaped_char" + } + ] + }, + { + "begin": "\\(", + "captures": { + "0": { + "name": "punctuation.definition.group.ruby" + } + }, + "end": "\\)", + "name": "string.regexp.group.ruby", + "patterns": [ + { + "include": "#regex_sub" + } + ] + }, + { + "begin": "(?<=^|\\s)(#)\\s(?=[[a-zA-Z0-9,. \\t?!-][^\\x{00}-\\x{7F}]]*$)", + "beginCaptures": { + "1": { + "name": "punctuation.definition.comment.ruby" + } + }, + "comment": "We are restrictive in what we allow to go after the comment character to avoid false positives, since the availability of comments depend on regexp flags.", + "end": "$\\n?", + "endCaptures": { + "0": { + "name": "punctuation.definition.comment.ruby" + } + }, + "name": "comment.line.number-sign.ruby" + } + ] + }, + "separators": { + "patterns": [ + { + "match": "=>", + "name": "punctuation.separator.key-value.ruby" + }, + { + "match": ";", + "name": "punctuation.terminator.statement.ruby" + }, + { + "match": ",", + "name": "punctuation.separator.delimiter.ruby" + }, + { + "match": "(::)(?=\\s*[A-Z])", + "captures": { + "1": { + "name": "punctuation.separator.namespace.ruby" + } + } + }, + { + "match": "&?\\.|::", + "name": "punctuation.separator.method.ruby" + }, + { + "match": ":", + "name": "punctuation.separator.other.ruby" + } + ] + }, + "yard": { + "patterns": [ + { + "include": "#yard_comment" + }, + { + "include": "#yard_name_types" + }, + { + "include": "#yard_tag" + }, + { + "include": "#yard_types" + }, + { + "include": "#yard_directive" + } + ] + }, + "yard_comment": { + "comment": "For YARD tags that follow the tag-comment pattern", + "begin": "^(\\s*)(#)(\\s*)(@)(abstract|api|author|deprecated|example|macro|note|overload|since|todo|version)(?=\\s|$)", + "beginCaptures": { + "1": { + "name": "" + }, + "2": { + "name": "punctuation.definition.comment.ruby" + }, + "3": { + "name": "" + }, + "4": { + "name": "comment.line.keyword.punctuation.yard.ruby" + }, + "5": { + "name": "comment.line.keyword.yard.ruby" + } + }, + "end": "^(?!\\s*#\\3\\s{2,})", + "contentName": "comment.line.string.yard.ruby", + "name": "comment.line.number-sign.ruby", + "patterns": [ + { + "include": "#yard" + }, + { + "include": "#yard_continuation" + } + ] + }, + "yard_name_types": { + "comment": "For YARD tags that follow the tag-name-types-comment pattern", + "begin": "^(\\s*)(#)(\\s*)(@)(attr|attr_reader|attr_writer|option|param|see|yieldparam)(?=\\s)(\\s+([a-z_][a-zA-Z_]*))?(\\s+((\\[).+(])))?", + "beginCaptures": { + "1": { + "name": "" + }, + "2": { + "name": "punctuation.definition.comment.ruby" + }, + "3": { + "name": "" + }, + "4": { + "name": "comment.line.keyword.punctuation.yard.ruby" + }, + "5": { + "name": "comment.line.keyword.yard.ruby" + }, + "6": { + "name": "comment.line.yard.ruby" + }, + "7": { + "name": "comment.line.parameter.yard.ruby" + }, + "8": { + "name": "comment.line.yard.ruby" + }, + "9": { + "name": "comment.line.type.yard.ruby" + }, + "10": { + "name": "comment.line.punctuation.yard.ruby" + }, + "11": { + "name": "comment.line.punctuation.yard.ruby" + } + }, + "end": "^(?!\\s*#\\3\\s{2,})", + "contentName": "comment.line.string.yard.ruby", + "name": "comment.line.number-sign.ruby", + "patterns": [ + { + "include": "#yard" + }, + { + "include": "#yard_continuation" + } + ] + }, + "yard_tag": { + "comment": "For YARD tags that are just the tag", + "match": "^(\\s*)(#)(\\s*)(@)(private)$", + "captures": { + "1": { + "name": "" + }, + "2": { + "name": "punctuation.definition.comment.ruby" + }, + "3": { + "name": "" + }, + "4": { + "name": "comment.line.keyword.punctuation.yard.ruby" + }, + "5": { + "name": "comment.line.keyword.yard.ruby" + } + }, + "name": "comment.line.number-sign.ruby" + }, + "yard_types": { + "comment": "For YARD tags that follow the tag-types-comment pattern", + "begin": "^(\\s*)(#)(\\s*)(@)(raise|return|yield(?:return)?)(?=\\s)(\\s+((\\[).+(])))?", + "beginCaptures": { + "1": { + "name": "" + }, + "2": { + "name": "punctuation.definition.comment.ruby" + }, + "3": { + "name": "" + }, + "4": { + "name": "comment.line.keyword.punctuation.yard.ruby" + }, + "5": { + "name": "comment.line.keyword.yard.ruby" + }, + "6": { + "name": "comment.line.yard.ruby" + }, + "7": { + "name": "comment.line.type.yard.ruby" + }, + "8": { + "name": "comment.line.punctuation.yard.ruby" + }, + "9": { + "name": "comment.line.punctuation.yard.ruby" + } + }, + "end": "^(?!\\s*#\\3\\s{2,})", + "contentName": "comment.line.string.yard.ruby", + "name": "comment.line.number-sign.ruby", + "patterns": [ + { + "include": "#yard" + }, + { + "include": "#yard_continuation" + } + ] + }, + "yard_directive": { + "comment": "For YARD directives", + "begin": "^(\\s*)(#)(\\s*)(@!)(attribute|endgroup|group|macro|method|parse|scope|visibility)(\\s+((\\[).+(])))?(?=\\s)", + "beginCaptures": { + "1": { + "name": "" + }, + "2": { + "name": "punctuation.definition.comment.ruby" + }, + "3": { + "name": "" + }, + "4": { + "name": "comment.line.keyword.punctuation.yard.ruby" + }, + "5": { + "name": "comment.line.keyword.yard.ruby" + }, + "6": { + "name": "comment.line.yard.ruby" + }, + "7": { + "name": "comment.line.type.yard.ruby" + }, + "8": { + "name": "comment.line.punctuation.yard.ruby" + }, + "9": { + "name": "comment.line.punctuation.yard.ruby" + } + }, + "end": "^(?!\\s*#\\3\\s{2,})", + "contentName": "comment.line.string.yard.ruby", + "name": "comment.line.number-sign.ruby", + "patterns": [ + { + "include": "#yard" + }, + { + "include": "#yard_continuation" + } + ] + }, + "yard_continuation": { + "match": "^\\s*#", + "name": "punctuation.definition.comment.ruby" + } + } +} diff --git a/data/source.ts.json b/data/source.ts.json new file mode 100644 index 0000000..05b869f --- /dev/null +++ b/data/source.ts.json @@ -0,0 +1,5408 @@ +{ + "information_for_contributors": [ + "This file has been converted from https://github.com/Microsoft/TypeScript-TmLanguage/blob/master/TypeScript.tmLanguage", + "If you want to provide a fix or improvement, please create a pull request against the original repository.", + "Once accepted there, we are happy to receive an update request." + ], + "version": "https://github.com/Microsoft/TypeScript-TmLanguage/commit/4daff7b8904bc549dfbee8df1e2f7c82194b9f45", + "name": "TypeScript", + "scopeName": "source.ts", + "fileTypes": [ + "ts" + ], + "patterns": [ + { + "include": "#directives" + }, + { + "include": "#statements" + }, + { + "name": "comment.line.shebang.ts", + "match": "\\A(#!).*(?=$)", + "captures": { + "1": { + "name": "punctuation.definition.comment.ts" + } + } + } + ], + "repository": { + "statements": { + "patterns": [ + { + "include": "#string" + }, + { + "include": "#comment" + }, + { + "include": "#declaration" + }, + { + "include": "#control-statement" + }, + { + "include": "#after-operator-block-as-object-literal" + }, + { + "include": "#decl-block" + }, + { + "include": "#label" + }, + { + "include": "#expression" + }, + { + "include": "#punctuation-semicolon" + } + ] + }, + "declaration": { + "patterns": [ + { + "include": "#decorator" + }, + { + "include": "#var-expr" + }, + { + "include": "#function-declaration" + }, + { + "include": "#class-declaration" + }, + { + "include": "#interface-declaration" + }, + { + "include": "#enum-declaration" + }, + { + "include": "#namespace-declaration" + }, + { + "include": "#type-alias-declaration" + }, + { + "include": "#import-equals-declaration" + }, + { + "include": "#import-declaration" + }, + { + "include": "#export-declaration" + }, + { + "name": "storage.modifier.ts", + "match": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(declare|export)(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))" + } + ] + }, + "control-statement": { + "patterns": [ + { + "include": "#switch-statement" + }, + { + "include": "#for-loop" + }, + { + "name": "keyword.control.trycatch.ts", + "match": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(catch|finally|throw|try)(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))" + }, + { + "match": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(break|continue|goto)\\s+([_$[:alpha:]][_$[:alnum:]]*)(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))", + "captures": { + "1": { + "name": "keyword.control.loop.ts" + }, + "2": { + "name": "entity.name.label.ts" + } + } + }, + { + "name": "keyword.control.loop.ts", + "match": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(break|continue|do|goto|while)(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))" + }, + { + "name": "keyword.control.flow.ts", + "match": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(return)(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))" + }, + { + "name": "keyword.control.switch.ts", + "match": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(case|default|switch)(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))" + }, + { + "include": "#if-statement" + }, + { + "name": "keyword.control.conditional.ts", + "match": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(else|if)(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))" + }, + { + "name": "keyword.control.with.ts", + "match": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(with)(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))" + }, + { + "name": "keyword.control.ts", + "match": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(package)(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))" + }, + { + "name": "keyword.other.debugger.ts", + "match": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(debugger)(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))" + } + ] + }, + "label": { + "patterns": [ + { + "begin": "([_$[:alpha:]][_$[:alnum:]]*)\\s*(:)(?=\\s*\\{)", + "beginCaptures": { + "1": { + "name": "entity.name.label.ts" + }, + "2": { + "name": "punctuation.separator.label.ts" + } + }, + "end": "(?<=\\})", + "patterns": [ + { + "include": "#decl-block" + } + ] + }, + { + "match": "([_$[:alpha:]][_$[:alnum:]]*)\\s*(:)", + "captures": { + "1": { + "name": "entity.name.label.ts" + }, + "2": { + "name": "punctuation.separator.label.ts" + } + } + } + ] + }, + "expression": { + "patterns": [ + { + "include": "#expressionWithoutIdentifiers" + }, + { + "include": "#identifiers" + }, + { + "include": "#expressionPunctuations" + } + ] + }, + "expressionWithoutIdentifiers": { + "patterns": [ + { + "include": "#string" + }, + { + "include": "#regex" + }, + { + "include": "#comment" + }, + { + "include": "#function-expression" + }, + { + "include": "#class-expression" + }, + { + "include": "#arrow-function" + }, + { + "include": "#paren-expression-possibly-arrow" + }, + { + "include": "#cast" + }, + { + "include": "#ternary-expression" + }, + { + "include": "#new-expr" + }, + { + "include": "#instanceof-expr" + }, + { + "include": "#object-literal" + }, + { + "include": "#expression-operators" + }, + { + "include": "#function-call" + }, + { + "include": "#literal" + }, + { + "include": "#support-objects" + }, + { + "include": "#paren-expression" + } + ] + }, + "expressionPunctuations": { + "patterns": [ + { + "include": "#punctuation-comma" + }, + { + "include": "#punctuation-accessor" + } + ] + }, + "decorator": { + "name": "meta.decorator.ts", + "begin": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))\\@", + "beginCaptures": { + "0": { + "name": "punctuation.decorator.ts" + } + }, + "end": "(?=\\s)", + "patterns": [ + { + "include": "#expression" + } + ] + }, + "var-expr": { + "patterns": [ + { + "name": "meta.var.expr.ts", + "begin": "(?=(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(?:(\\bexport)\\s+)?(?:(\\bdeclare)\\s+)?\\b(var|let)(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.)))", + "end": "(?!(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(?:(\\bexport)\\s+)?(?:(\\bdeclare)\\s+)?\\b(var|let)(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.)))((?=;|}|((?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(of|in)\\s+)|^\\s*$|;|(?:^\\s*(?:abstract|async|class|const|declare|enum|export|function|import|interface|let|module|namespace|return|type|var)\\b))|((?<!^let|[^\\._$[:alnum:]]let|^var|[^\\._$[:alnum:]]var)(?=\\s*$)))", + "patterns": [ + { + "begin": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(?:(\\bexport)\\s+)?(?:(\\bdeclare)\\s+)?\\b(var|let)(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))\\s*", + "beginCaptures": { + "1": { + "name": "keyword.control.export.ts" + }, + "2": { + "name": "storage.modifier.ts" + }, + "3": { + "name": "storage.type.ts" + } + }, + "end": "(?=\\S)" + }, + { + "include": "#destructuring-variable" + }, + { + "include": "#var-single-variable" + }, + { + "include": "#variable-initializer" + }, + { + "include": "#comment" + }, + { + "begin": "(,)\\s*((?!\\S)|(?=\\/\\/))", + "beginCaptures": { + "1": { + "name": "punctuation.separator.comma.ts" + } + }, + "end": "(?<!,)(((?==|;|}|((?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(of|in)\\s+)|^\\s*$))|((?<=\\S)(?=\\s*$)))", + "patterns": [ + { + "include": "#single-line-comment-consuming-line-ending" + }, + { + "include": "#comment" + }, + { + "include": "#destructuring-variable" + }, + { + "include": "#var-single-variable" + }, + { + "include": "#punctuation-comma" + } + ] + }, + { + "include": "#punctuation-comma" + } + ] + }, + { + "name": "meta.var.expr.ts", + "begin": "(?=(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(?:(\\bexport)\\s+)?(?:(\\bdeclare)\\s+)?\\b(const(?!\\s+enum\\b))(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.)))", + "beginCaptures": { + "1": { + "name": "keyword.control.export.ts" + }, + "2": { + "name": "storage.modifier.ts" + }, + "3": { + "name": "storage.type.ts" + } + }, + "end": "(?!(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(?:(\\bexport)\\s+)?(?:(\\bdeclare)\\s+)?\\b(const(?!\\s+enum\\b))(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.)))((?=;|}|((?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(of|in)\\s+)|^\\s*$|;|(?:^\\s*(?:abstract|async|class|const|declare|enum|export|function|import|interface|let|module|namespace|return|type|var)\\b))|((?<!^const|[^\\._$[:alnum:]]const)(?=\\s*$)))", + "patterns": [ + { + "begin": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(?:(\\bexport)\\s+)?(?:(\\bdeclare)\\s+)?\\b(const(?!\\s+enum\\b))(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))\\s*", + "beginCaptures": { + "1": { + "name": "keyword.control.export.ts" + }, + "2": { + "name": "storage.modifier.ts" + }, + "3": { + "name": "storage.type.ts" + } + }, + "end": "(?=\\S)" + }, + { + "include": "#destructuring-const" + }, + { + "include": "#var-single-const" + }, + { + "include": "#variable-initializer" + }, + { + "include": "#comment" + }, + { + "begin": "(,)\\s*((?!\\S)|(?=\\/\\/))", + "beginCaptures": { + "1": { + "name": "punctuation.separator.comma.ts" + } + }, + "end": "(?<!,)(((?==|;|}|((?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(of|in)\\s+)|^\\s*$))|((?<=\\S)(?=\\s*$)))", + "patterns": [ + { + "include": "#single-line-comment-consuming-line-ending" + }, + { + "include": "#comment" + }, + { + "include": "#destructuring-const" + }, + { + "include": "#var-single-const" + }, + { + "include": "#punctuation-comma" + } + ] + }, + { + "include": "#punctuation-comma" + } + ] + } + ] + }, + "var-single-variable": { + "patterns": [ + { + "name": "meta.var-single-variable.expr.ts", + "begin": "(?x)([_$[:alpha:]][_$[:alnum:]]*)(\\!)?(?=\\s*\n# function assignment |\n(=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|((<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?[\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)) |\n# typeannotation is fn type: < | () | (... | (param: | (param, | (param? | (param= | (param) =>\n(:\\s*(\n (<) |\n ([(]\\s*(\n ([)]) |\n (\\.\\.\\.) |\n ([_$[:alnum:]]+\\s*(\n ([:,?=])|\n ([)]\\s*=>)\n ))\n ))\n)) |\n(:\\s*(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))Function(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))) |\n(:\\s*((<\\s*$)|((<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?[\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*))))))) |\n(:\\s*(=>|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(<[^<>]*>)|[^<>(),=])+=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|((<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?[\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)))", + "beginCaptures": { + "1": { + "name": "meta.definition.variable.ts entity.name.function.ts" + }, + "2": { + "name": "keyword.operator.definiteassignment.ts" + } + }, + "end": "(?=$|^|[;,=}]|((?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(of|in)\\s+))", + "patterns": [ + { + "include": "#var-single-variable-type-annotation" + } + ] + }, + { + "name": "meta.var-single-variable.expr.ts", + "begin": "([[:upper:]][_$[:digit:][:upper:]]*)(?![_$[:alnum:]])(\\!)?", + "beginCaptures": { + "1": { + "name": "meta.definition.variable.ts variable.other.constant.ts" + }, + "2": { + "name": "keyword.operator.definiteassignment.ts" + } + }, + "end": "(?=$|^|[;,=}]|((?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(of|in)\\s+))", + "patterns": [ + { + "include": "#var-single-variable-type-annotation" + } + ] + }, + { + "name": "meta.var-single-variable.expr.ts", + "begin": "([_$[:alpha:]][_$[:alnum:]]*)(\\!)?", + "beginCaptures": { + "1": { + "name": "meta.definition.variable.ts variable.other.readwrite.ts" + }, + "2": { + "name": "keyword.operator.definiteassignment.ts" + } + }, + "end": "(?=$|^|[;,=}]|((?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(of|in)\\s+))", + "patterns": [ + { + "include": "#var-single-variable-type-annotation" + } + ] + } + ] + }, + "var-single-const": { + "patterns": [ + { + "name": "meta.var-single-variable.expr.ts", + "begin": "(?x)([_$[:alpha:]][_$[:alnum:]]*)(?=\\s*\n# function assignment |\n(=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|((<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?[\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)) |\n# typeannotation is fn type: < | () | (... | (param: | (param, | (param? | (param= | (param) =>\n(:\\s*(\n (<) |\n ([(]\\s*(\n ([)]) |\n (\\.\\.\\.) |\n ([_$[:alnum:]]+\\s*(\n ([:,?=])|\n ([)]\\s*=>)\n ))\n ))\n)) |\n(:\\s*(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))Function(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))) |\n(:\\s*((<\\s*$)|((<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?[\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*))))))) |\n(:\\s*(=>|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(<[^<>]*>)|[^<>(),=])+=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|((<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?[\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)))", + "beginCaptures": { + "1": { + "name": "meta.definition.variable.ts variable.other.constant.ts entity.name.function.ts" + } + }, + "end": "(?=$|^|[;,=}]|((?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(of|in)\\s+))", + "patterns": [ + { + "include": "#var-single-variable-type-annotation" + } + ] + }, + { + "name": "meta.var-single-variable.expr.ts", + "begin": "([_$[:alpha:]][_$[:alnum:]]*)", + "beginCaptures": { + "1": { + "name": "meta.definition.variable.ts variable.other.constant.ts" + } + }, + "end": "(?=$|^|[;,=}]|((?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(of|in)\\s+))", + "patterns": [ + { + "include": "#var-single-variable-type-annotation" + } + ] + } + ] + }, + "var-single-variable-type-annotation": { + "patterns": [ + { + "include": "#type-annotation" + }, + { + "include": "#string" + }, + { + "include": "#comment" + } + ] + }, + "destructuring-variable": { + "patterns": [ + { + "name": "meta.object-binding-pattern-variable.ts", + "begin": "(?<!=|:|^of|[^\\._$[:alnum:]]of|^in|[^\\._$[:alnum:]]in)\\s*(?=\\{)", + "end": "(?=$|^|[;,=}]|((?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(of|in)\\s+))", + "patterns": [ + { + "include": "#object-binding-pattern" + }, + { + "include": "#type-annotation" + }, + { + "include": "#comment" + } + ] + }, + { + "name": "meta.array-binding-pattern-variable.ts", + "begin": "(?<!=|:|^of|[^\\._$[:alnum:]]of|^in|[^\\._$[:alnum:]]in)\\s*(?=\\[)", + "end": "(?=$|^|[;,=}]|((?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(of|in)\\s+))", + "patterns": [ + { + "include": "#array-binding-pattern" + }, + { + "include": "#type-annotation" + }, + { + "include": "#comment" + } + ] + } + ] + }, + "destructuring-const": { + "patterns": [ + { + "name": "meta.object-binding-pattern-variable.ts", + "begin": "(?<!=|:|^of|[^\\._$[:alnum:]]of|^in|[^\\._$[:alnum:]]in)\\s*(?=\\{)", + "end": "(?=$|^|[;,=}]|((?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(of|in)\\s+))", + "patterns": [ + { + "include": "#object-binding-pattern-const" + }, + { + "include": "#type-annotation" + }, + { + "include": "#comment" + } + ] + }, + { + "name": "meta.array-binding-pattern-variable.ts", + "begin": "(?<!=|:|^of|[^\\._$[:alnum:]]of|^in|[^\\._$[:alnum:]]in)\\s*(?=\\[)", + "end": "(?=$|^|[;,=}]|((?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(of|in)\\s+))", + "patterns": [ + { + "include": "#array-binding-pattern-const" + }, + { + "include": "#type-annotation" + }, + { + "include": "#comment" + } + ] + } + ] + }, + "object-binding-element": { + "patterns": [ + { + "include": "#comment" + }, + { + "begin": "(?x)(?=((\\b(?<!\\$)0(?:x|X)[0-9a-fA-F][0-9a-fA-F_]*(n)?\\b(?!\\$))|(\\b(?<!\\$)0(?:b|B)[01][01_]*(n)?\\b(?!\\$))|(\\b(?<!\\$)0(?:o|O)?[0-7][0-7_]*(n)?\\b(?!\\$))|((?<!\\$)(?:\n (?:\\b[0-9][0-9_]*(\\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\\b)| # 1.1E+3\n (?:\\b[0-9][0-9_]*(\\.)[eE][+-]?[0-9][0-9_]*(n)?\\b)| # 1.E+3\n (?:\\B(\\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\\b)| # .1E+3\n (?:\\b[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\\b)| # 1E+3\n (?:\\b[0-9][0-9_]*(\\.)[0-9][0-9_]*(n)?\\b)| # 1.1\n (?:\\b[0-9][0-9_]*(\\.)(n)?\\B)| # 1.\n (?:\\B(\\.)[0-9][0-9_]*(n)?\\b)| # .1\n (?:\\b[0-9][0-9_]*(n)?\\b(?!\\.)) # 1\n)(?!\\$))|([_$[:alpha:]][_$[:alnum:]]*)|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`)|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])+\\]))\\s*(:))", + "end": "(?=,|\\})", + "patterns": [ + { + "include": "#object-binding-element-propertyName" + }, + { + "include": "#binding-element" + } + ] + }, + { + "include": "#object-binding-pattern" + }, + { + "include": "#destructuring-variable-rest" + }, + { + "include": "#variable-initializer" + }, + { + "include": "#punctuation-comma" + } + ] + }, + "object-binding-element-const": { + "patterns": [ + { + "include": "#comment" + }, + { + "begin": "(?x)(?=((\\b(?<!\\$)0(?:x|X)[0-9a-fA-F][0-9a-fA-F_]*(n)?\\b(?!\\$))|(\\b(?<!\\$)0(?:b|B)[01][01_]*(n)?\\b(?!\\$))|(\\b(?<!\\$)0(?:o|O)?[0-7][0-7_]*(n)?\\b(?!\\$))|((?<!\\$)(?:\n (?:\\b[0-9][0-9_]*(\\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\\b)| # 1.1E+3\n (?:\\b[0-9][0-9_]*(\\.)[eE][+-]?[0-9][0-9_]*(n)?\\b)| # 1.E+3\n (?:\\B(\\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\\b)| # .1E+3\n (?:\\b[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\\b)| # 1E+3\n (?:\\b[0-9][0-9_]*(\\.)[0-9][0-9_]*(n)?\\b)| # 1.1\n (?:\\b[0-9][0-9_]*(\\.)(n)?\\B)| # 1.\n (?:\\B(\\.)[0-9][0-9_]*(n)?\\b)| # .1\n (?:\\b[0-9][0-9_]*(n)?\\b(?!\\.)) # 1\n)(?!\\$))|([_$[:alpha:]][_$[:alnum:]]*)|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`)|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])+\\]))\\s*(:))", + "end": "(?=,|\\})", + "patterns": [ + { + "include": "#object-binding-element-propertyName" + }, + { + "include": "#binding-element-const" + } + ] + }, + { + "include": "#object-binding-pattern-const" + }, + { + "include": "#destructuring-variable-rest-const" + }, + { + "include": "#variable-initializer" + }, + { + "include": "#punctuation-comma" + } + ] + }, + "object-binding-element-propertyName": { + "begin": "(?x)(?=((\\b(?<!\\$)0(?:x|X)[0-9a-fA-F][0-9a-fA-F_]*(n)?\\b(?!\\$))|(\\b(?<!\\$)0(?:b|B)[01][01_]*(n)?\\b(?!\\$))|(\\b(?<!\\$)0(?:o|O)?[0-7][0-7_]*(n)?\\b(?!\\$))|((?<!\\$)(?:\n (?:\\b[0-9][0-9_]*(\\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\\b)| # 1.1E+3\n (?:\\b[0-9][0-9_]*(\\.)[eE][+-]?[0-9][0-9_]*(n)?\\b)| # 1.E+3\n (?:\\B(\\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\\b)| # .1E+3\n (?:\\b[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\\b)| # 1E+3\n (?:\\b[0-9][0-9_]*(\\.)[0-9][0-9_]*(n)?\\b)| # 1.1\n (?:\\b[0-9][0-9_]*(\\.)(n)?\\B)| # 1.\n (?:\\B(\\.)[0-9][0-9_]*(n)?\\b)| # .1\n (?:\\b[0-9][0-9_]*(n)?\\b(?!\\.)) # 1\n)(?!\\$))|([_$[:alpha:]][_$[:alnum:]]*)|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`)|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])+\\]))\\s*(:))", + "end": "(:)", + "endCaptures": { + "0": { + "name": "punctuation.destructuring.ts" + } + }, + "patterns": [ + { + "include": "#string" + }, + { + "include": "#array-literal" + }, + { + "include": "#numeric-literal" + }, + { + "name": "variable.object.property.ts", + "match": "([_$[:alpha:]][_$[:alnum:]]*)" + } + ] + }, + "binding-element": { + "patterns": [ + { + "include": "#comment" + }, + { + "include": "#string" + }, + { + "include": "#numeric-literal" + }, + { + "include": "#regex" + }, + { + "include": "#object-binding-pattern" + }, + { + "include": "#array-binding-pattern" + }, + { + "include": "#destructuring-variable-rest" + }, + { + "include": "#variable-initializer" + } + ] + }, + "binding-element-const": { + "patterns": [ + { + "include": "#comment" + }, + { + "include": "#string" + }, + { + "include": "#numeric-literal" + }, + { + "include": "#regex" + }, + { + "include": "#object-binding-pattern-const" + }, + { + "include": "#array-binding-pattern-const" + }, + { + "include": "#destructuring-variable-rest-const" + }, + { + "include": "#variable-initializer" + } + ] + }, + "destructuring-variable-rest": { + "match": "(?:(\\.\\.\\.)\\s*)?([_$[:alpha:]][_$[:alnum:]]*)", + "captures": { + "1": { + "name": "keyword.operator.rest.ts" + }, + "2": { + "name": "meta.definition.variable.ts variable.other.readwrite.ts" + } + } + }, + "destructuring-variable-rest-const": { + "match": "(?:(\\.\\.\\.)\\s*)?([_$[:alpha:]][_$[:alnum:]]*)", + "captures": { + "1": { + "name": "keyword.operator.rest.ts" + }, + "2": { + "name": "meta.definition.variable.ts variable.other.constant.ts" + } + } + }, + "object-binding-pattern": { + "begin": "(?:(\\.\\.\\.)\\s*)?(\\{)", + "beginCaptures": { + "1": { + "name": "keyword.operator.rest.ts" + }, + "2": { + "name": "punctuation.definition.binding-pattern.object.ts" + } + }, + "end": "\\}", + "endCaptures": { + "0": { + "name": "punctuation.definition.binding-pattern.object.ts" + } + }, + "patterns": [ + { + "include": "#object-binding-element" + } + ] + }, + "object-binding-pattern-const": { + "begin": "(?:(\\.\\.\\.)\\s*)?(\\{)", + "beginCaptures": { + "1": { + "name": "keyword.operator.rest.ts" + }, + "2": { + "name": "punctuation.definition.binding-pattern.object.ts" + } + }, + "end": "\\}", + "endCaptures": { + "0": { + "name": "punctuation.definition.binding-pattern.object.ts" + } + }, + "patterns": [ + { + "include": "#object-binding-element-const" + } + ] + }, + "array-binding-pattern": { + "begin": "(?:(\\.\\.\\.)\\s*)?(\\[)", + "beginCaptures": { + "1": { + "name": "keyword.operator.rest.ts" + }, + "2": { + "name": "punctuation.definition.binding-pattern.array.ts" + } + }, + "end": "\\]", + "endCaptures": { + "0": { + "name": "punctuation.definition.binding-pattern.array.ts" + } + }, + "patterns": [ + { + "include": "#binding-element" + }, + { + "include": "#punctuation-comma" + } + ] + }, + "array-binding-pattern-const": { + "begin": "(?:(\\.\\.\\.)\\s*)?(\\[)", + "beginCaptures": { + "1": { + "name": "keyword.operator.rest.ts" + }, + "2": { + "name": "punctuation.definition.binding-pattern.array.ts" + } + }, + "end": "\\]", + "endCaptures": { + "0": { + "name": "punctuation.definition.binding-pattern.array.ts" + } + }, + "patterns": [ + { + "include": "#binding-element-const" + }, + { + "include": "#punctuation-comma" + } + ] + }, + "parameter-name": { + "patterns": [ + { + "match": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(public|protected|private|readonly)\\s+(?=(public|protected|private|readonly)\\s+)", + "captures": { + "1": { + "name": "storage.modifier.ts" + } + } + }, + { + "match": "(?x)(?:(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(public|private|protected|readonly)\\s+)?(?:(\\.\\.\\.)\\s*)?(?<!=|:)(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(?:(this)|([_$[:alpha:]][_$[:alnum:]]*))(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))\\s*(\\??)(?=\\s*\n# function assignment |\n(=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|((<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?[\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)) |\n# typeannotation is fn type: < | () | (... | (param: | (param, | (param? | (param= | (param) =>\n(:\\s*(\n (<) |\n ([(]\\s*(\n ([)]) |\n (\\.\\.\\.) |\n ([_$[:alnum:]]+\\s*(\n ([:,?=])|\n ([)]\\s*=>)\n ))\n ))\n)) |\n(:\\s*(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))Function(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))) |\n(:\\s*((<\\s*$)|((<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?[\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*))))))) |\n(:\\s*(=>|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(<[^<>]*>)|[^<>(),=])+=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|((<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?[\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)))", + "captures": { + "1": { + "name": "storage.modifier.ts" + }, + "2": { + "name": "keyword.operator.rest.ts" + }, + "3": { + "name": "entity.name.function.ts variable.language.this.ts" + }, + "4": { + "name": "entity.name.function.ts" + }, + "5": { + "name": "keyword.operator.optional.ts" + } + } + }, + { + "match": "(?x)(?:(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(public|private|protected|readonly)\\s+)?(?:(\\.\\.\\.)\\s*)?(?<!=|:)(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(?:(this)|([_$[:alpha:]][_$[:alnum:]]*))(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))\\s*(\\??)", + "captures": { + "1": { + "name": "storage.modifier.ts" + }, + "2": { + "name": "keyword.operator.rest.ts" + }, + "3": { + "name": "variable.parameter.ts variable.language.this.ts" + }, + "4": { + "name": "variable.parameter.ts" + }, + "5": { + "name": "keyword.operator.optional.ts" + } + } + } + ] + }, + "destructuring-parameter": { + "patterns": [ + { + "name": "meta.parameter.object-binding-pattern.ts", + "begin": "(?<!=|:)\\s*(?:(\\.\\.\\.)\\s*)?(\\{)", + "beginCaptures": { + "1": { + "name": "keyword.operator.rest.ts" + }, + "2": { + "name": "punctuation.definition.binding-pattern.object.ts" + } + }, + "end": "\\}", + "endCaptures": { + "0": { + "name": "punctuation.definition.binding-pattern.object.ts" + } + }, + "patterns": [ + { + "include": "#parameter-object-binding-element" + } + ] + }, + { + "name": "meta.paramter.array-binding-pattern.ts", + "begin": "(?<!=|:)\\s*(?:(\\.\\.\\.)\\s*)?(\\[)", + "beginCaptures": { + "1": { + "name": "keyword.operator.rest.ts" + }, + "2": { + "name": "punctuation.definition.binding-pattern.array.ts" + } + }, + "end": "\\]", + "endCaptures": { + "0": { + "name": "punctuation.definition.binding-pattern.array.ts" + } + }, + "patterns": [ + { + "include": "#parameter-binding-element" + }, + { + "include": "#punctuation-comma" + } + ] + } + ] + }, + "parameter-object-binding-element": { + "patterns": [ + { + "include": "#comment" + }, + { + "begin": "(?x)(?=((\\b(?<!\\$)0(?:x|X)[0-9a-fA-F][0-9a-fA-F_]*(n)?\\b(?!\\$))|(\\b(?<!\\$)0(?:b|B)[01][01_]*(n)?\\b(?!\\$))|(\\b(?<!\\$)0(?:o|O)?[0-7][0-7_]*(n)?\\b(?!\\$))|((?<!\\$)(?:\n (?:\\b[0-9][0-9_]*(\\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\\b)| # 1.1E+3\n (?:\\b[0-9][0-9_]*(\\.)[eE][+-]?[0-9][0-9_]*(n)?\\b)| # 1.E+3\n (?:\\B(\\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\\b)| # .1E+3\n (?:\\b[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\\b)| # 1E+3\n (?:\\b[0-9][0-9_]*(\\.)[0-9][0-9_]*(n)?\\b)| # 1.1\n (?:\\b[0-9][0-9_]*(\\.)(n)?\\B)| # 1.\n (?:\\B(\\.)[0-9][0-9_]*(n)?\\b)| # .1\n (?:\\b[0-9][0-9_]*(n)?\\b(?!\\.)) # 1\n)(?!\\$))|([_$[:alpha:]][_$[:alnum:]]*)|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`)|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])+\\]))\\s*(:))", + "end": "(?=,|\\})", + "patterns": [ + { + "include": "#object-binding-element-propertyName" + }, + { + "include": "#parameter-binding-element" + } + ] + }, + { + "include": "#parameter-object-binding-pattern" + }, + { + "include": "#destructuring-parameter-rest" + }, + { + "include": "#variable-initializer" + }, + { + "include": "#punctuation-comma" + } + ] + }, + "parameter-binding-element": { + "patterns": [ + { + "include": "#comment" + }, + { + "include": "#string" + }, + { + "include": "#numeric-literal" + }, + { + "include": "#regex" + }, + { + "include": "#parameter-object-binding-pattern" + }, + { + "include": "#parameter-array-binding-pattern" + }, + { + "include": "#destructuring-parameter-rest" + }, + { + "include": "#variable-initializer" + } + ] + }, + "destructuring-parameter-rest": { + "match": "(?:(\\.\\.\\.)\\s*)?([_$[:alpha:]][_$[:alnum:]]*)", + "captures": { + "1": { + "name": "keyword.operator.rest.ts" + }, + "2": { + "name": "variable.parameter.ts" + } + } + }, + "parameter-object-binding-pattern": { + "begin": "(?:(\\.\\.\\.)\\s*)?(\\{)", + "beginCaptures": { + "1": { + "name": "keyword.operator.rest.ts" + }, + "2": { + "name": "punctuation.definition.binding-pattern.object.ts" + } + }, + "end": "\\}", + "endCaptures": { + "0": { + "name": "punctuation.definition.binding-pattern.object.ts" + } + }, + "patterns": [ + { + "include": "#parameter-object-binding-element" + } + ] + }, + "parameter-array-binding-pattern": { + "begin": "(?:(\\.\\.\\.)\\s*)?(\\[)", + "beginCaptures": { + "1": { + "name": "keyword.operator.rest.ts" + }, + "2": { + "name": "punctuation.definition.binding-pattern.array.ts" + } + }, + "end": "\\]", + "endCaptures": { + "0": { + "name": "punctuation.definition.binding-pattern.array.ts" + } + }, + "patterns": [ + { + "include": "#parameter-binding-element" + }, + { + "include": "#punctuation-comma" + } + ] + }, + "field-declaration": { + "name": "meta.field.declaration.ts", + "begin": "(?x)(?<!\\()(?:(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(readonly)\\s+)?(?=\\s*((\\b(?<!\\$)0(?:x|X)[0-9a-fA-F][0-9a-fA-F_]*(n)?\\b(?!\\$))|(\\b(?<!\\$)0(?:b|B)[01][01_]*(n)?\\b(?!\\$))|(\\b(?<!\\$)0(?:o|O)?[0-7][0-7_]*(n)?\\b(?!\\$))|((?<!\\$)(?:\n (?:\\b[0-9][0-9_]*(\\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\\b)| # 1.1E+3\n (?:\\b[0-9][0-9_]*(\\.)[eE][+-]?[0-9][0-9_]*(n)?\\b)| # 1.E+3\n (?:\\B(\\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\\b)| # .1E+3\n (?:\\b[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\\b)| # 1E+3\n (?:\\b[0-9][0-9_]*(\\.)[0-9][0-9_]*(n)?\\b)| # 1.1\n (?:\\b[0-9][0-9_]*(\\.)(n)?\\B)| # 1.\n (?:\\B(\\.)[0-9][0-9_]*(n)?\\b)| # .1\n (?:\\b[0-9][0-9_]*(n)?\\b(?!\\.)) # 1\n)(?!\\$))|([_$[:alpha:]][_$[:alnum:]]*)|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`)|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])+\\]))\\s*(?:(?:(\\?)|(\\!))\\s*)?(=|:|;|,|\\}|$))", + "beginCaptures": { + "1": { + "name": "storage.modifier.ts" + } + }, + "end": "(?x)(?=\\}|;|,|$|(^(?!\\s*((\\b(?<!\\$)0(?:x|X)[0-9a-fA-F][0-9a-fA-F_]*(n)?\\b(?!\\$))|(\\b(?<!\\$)0(?:b|B)[01][01_]*(n)?\\b(?!\\$))|(\\b(?<!\\$)0(?:o|O)?[0-7][0-7_]*(n)?\\b(?!\\$))|((?<!\\$)(?:\n (?:\\b[0-9][0-9_]*(\\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\\b)| # 1.1E+3\n (?:\\b[0-9][0-9_]*(\\.)[eE][+-]?[0-9][0-9_]*(n)?\\b)| # 1.E+3\n (?:\\B(\\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\\b)| # .1E+3\n (?:\\b[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\\b)| # 1E+3\n (?:\\b[0-9][0-9_]*(\\.)[0-9][0-9_]*(n)?\\b)| # 1.1\n (?:\\b[0-9][0-9_]*(\\.)(n)?\\B)| # 1.\n (?:\\B(\\.)[0-9][0-9_]*(n)?\\b)| # .1\n (?:\\b[0-9][0-9_]*(n)?\\b(?!\\.)) # 1\n)(?!\\$))|([_$[:alpha:]][_$[:alnum:]]*)|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`)|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])+\\]))\\s*(?:(?:(\\?)|(\\!))\\s*)?(=|:|;|,|$))))|(?<=\\})", + "patterns": [ + { + "include": "#variable-initializer" + }, + { + "include": "#type-annotation" + }, + { + "include": "#string" + }, + { + "include": "#array-literal" + }, + { + "include": "#numeric-literal" + }, + { + "include": "#comment" + }, + { + "match": "(?x)([_$[:alpha:]][_$[:alnum:]]*)(?:(\\?)|(\\!))?(?=\\s*\\s*\n# function assignment |\n(=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|((<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?[\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)) |\n# typeannotation is fn type: < | () | (... | (param: | (param, | (param? | (param= | (param) =>\n(:\\s*(\n (<) |\n ([(]\\s*(\n ([)]) |\n (\\.\\.\\.) |\n ([_$[:alnum:]]+\\s*(\n ([:,?=])|\n ([)]\\s*=>)\n ))\n ))\n)) |\n(:\\s*(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))Function(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))) |\n(:\\s*((<\\s*$)|((<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?[\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*))))))) |\n(:\\s*(=>|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(<[^<>]*>)|[^<>(),=])+=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|((<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?[\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)))", + "captures": { + "1": { + "name": "meta.definition.property.ts entity.name.function.ts" + }, + "2": { + "name": "keyword.operator.optional.ts" + }, + "3": { + "name": "keyword.operator.definiteassignment.ts" + } + } + }, + { + "name": "meta.definition.property.ts variable.object.property.ts", + "match": "[_$[:alpha:]][_$[:alnum:]]*" + }, + { + "name": "keyword.operator.optional.ts", + "match": "\\?" + }, + { + "name": "keyword.operator.definiteassignment.ts", + "match": "\\!" + } + ] + }, + "variable-initializer": { + "patterns": [ + { + "begin": "(?<!=|!)(=)(?!=)(?=\\s*\\S)(?!\\s*.*=>\\s*$)", + "beginCaptures": { + "1": { + "name": "keyword.operator.assignment.ts" + } + }, + "end": "(?=$|^|[,);}\\]]|((?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(of|in)\\s+))", + "patterns": [ + { + "include": "#expression" + } + ] + }, + { + "begin": "(?<!=|!)(=)(?!=)", + "beginCaptures": { + "1": { + "name": "keyword.operator.assignment.ts" + } + }, + "end": "(?=[,);}\\]]|((?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(of|in)\\s+))|(?=^\\s*$)|(?<=\\S)(?<!=)(?=\\s*$)", + "patterns": [ + { + "include": "#expression" + } + ] + } + ] + }, + "function-declaration": { + "name": "meta.function.ts", + "begin": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(?:(\\bexport)\\s+)?(?:(\\bdeclare)\\s+)?(?:(async)\\s+)?(function\\b)(?:\\s*(\\*))?(?:(?:\\s+|(?<=\\*))([_$[:alpha:]][_$[:alnum:]]*))?\\s*", + "beginCaptures": { + "1": { + "name": "keyword.control.export.ts" + }, + "2": { + "name": "storage.modifier.ts" + }, + "3": { + "name": "storage.modifier.async.ts" + }, + "4": { + "name": "storage.type.function.ts" + }, + "5": { + "name": "keyword.generator.asterisk.ts" + }, + "6": { + "name": "meta.definition.function.ts entity.name.function.ts" + } + }, + "end": "(?=;|(?:^\\s*(?:abstract|async|class|const|declare|enum|export|function|import|interface|let|module|namespace|return|type|var)\\b))|(?<=\\})", + "patterns": [ + { + "include": "#function-name" + }, + { + "include": "#function-body" + } + ] + }, + "function-expression": { + "name": "meta.function.expression.ts", + "begin": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(?:(async)\\s+)?(function\\b)(?:\\s*(\\*))?(?:(?:\\s+|(?<=\\*))([_$[:alpha:]][_$[:alnum:]]*))?\\s*", + "beginCaptures": { + "1": { + "name": "storage.modifier.async.ts" + }, + "2": { + "name": "storage.type.function.ts" + }, + "3": { + "name": "keyword.generator.asterisk.ts" + }, + "4": { + "name": "meta.definition.function.ts entity.name.function.ts" + } + }, + "end": "(?=;)|(?<=\\})", + "patterns": [ + { + "include": "#function-name" + }, + { + "include": "#single-line-comment-consuming-line-ending" + }, + { + "include": "#function-body" + } + ] + }, + "function-name": { + "name": "meta.definition.function.ts entity.name.function.ts", + "match": "[_$[:alpha:]][_$[:alnum:]]*" + }, + "function-body": { + "patterns": [ + { + "include": "#comment" + }, + { + "include": "#type-parameters" + }, + { + "include": "#function-parameters" + }, + { + "include": "#return-type" + }, + { + "include": "#decl-block" + }, + { + "name": "keyword.generator.asterisk.ts", + "match": "\\*" + } + ] + }, + "method-declaration": { + "patterns": [ + { + "name": "meta.method.declaration.ts", + "begin": "(?x)(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(?:\\b(public|private|protected)\\s+)?(?:\\b(abstract)\\s+)?(?:\\b(async)\\s+)?\\s*\\b(constructor)\\b(?!:)(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))", + "beginCaptures": { + "1": { + "name": "storage.modifier.ts" + }, + "2": { + "name": "storage.modifier.ts" + }, + "3": { + "name": "storage.modifier.async.ts" + }, + "4": { + "name": "storage.type.ts" + } + }, + "end": "(?=\\}|;|,|$)|(?<=\\})", + "patterns": [ + { + "include": "#method-declaration-name" + }, + { + "include": "#function-body" + } + ] + }, + { + "name": "meta.method.declaration.ts", + "begin": "(?x)(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(?:\\b(public|private|protected)\\s+)?(?:\\b(abstract)\\s+)?(?:\\b(async)\\s+)?(?:(?:\\s*\\b(new)\\b(?!:)(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.)))|(?:(\\*)\\s*)?)(?=\\s*((<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*))?[\\(])", + "beginCaptures": { + "1": { + "name": "storage.modifier.ts" + }, + "2": { + "name": "storage.modifier.ts" + }, + "3": { + "name": "storage.modifier.async.ts" + }, + "4": { + "name": "keyword.operator.new.ts" + }, + "5": { + "name": "keyword.generator.asterisk.ts" + } + }, + "end": "(?=\\}|;|,|$)|(?<=\\})", + "patterns": [ + { + "include": "#method-declaration-name" + }, + { + "include": "#function-body" + } + ] + }, + { + "name": "meta.method.declaration.ts", + "begin": "(?x)(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(?:\\b(public|private|protected)\\s+)?(?:\\b(abstract)\\s+)?(?:\\b(async)\\s+)?(?:\\b(get|set)\\s+)?(?:(\\*)\\s*)?(?=\\s*(((\\b(?<!\\$)0(?:x|X)[0-9a-fA-F][0-9a-fA-F_]*(n)?\\b(?!\\$))|(\\b(?<!\\$)0(?:b|B)[01][01_]*(n)?\\b(?!\\$))|(\\b(?<!\\$)0(?:o|O)?[0-7][0-7_]*(n)?\\b(?!\\$))|((?<!\\$)(?:\n (?:\\b[0-9][0-9_]*(\\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\\b)| # 1.1E+3\n (?:\\b[0-9][0-9_]*(\\.)[eE][+-]?[0-9][0-9_]*(n)?\\b)| # 1.E+3\n (?:\\B(\\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\\b)| # .1E+3\n (?:\\b[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\\b)| # 1E+3\n (?:\\b[0-9][0-9_]*(\\.)[0-9][0-9_]*(n)?\\b)| # 1.1\n (?:\\b[0-9][0-9_]*(\\.)(n)?\\B)| # 1.\n (?:\\B(\\.)[0-9][0-9_]*(n)?\\b)| # .1\n (?:\\b[0-9][0-9_]*(n)?\\b(?!\\.)) # 1\n)(?!\\$))|([_$[:alpha:]][_$[:alnum:]]*)|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`)|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])+\\]))\\s*(\\??))\\s*((<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*))?[\\(])", + "beginCaptures": { + "1": { + "name": "storage.modifier.ts" + }, + "2": { + "name": "storage.modifier.ts" + }, + "3": { + "name": "storage.modifier.async.ts" + }, + "4": { + "name": "storage.type.property.ts" + }, + "5": { + "name": "keyword.generator.asterisk.ts" + } + }, + "end": "(?=\\}|;|,|$)|(?<=\\})", + "patterns": [ + { + "include": "#method-declaration-name" + }, + { + "include": "#function-body" + } + ] + } + ] + }, + "object-literal-method-declaration": { + "name": "meta.method.declaration.ts", + "begin": "(?x)(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(?:\\b(async)\\s+)?(?:\\b(get|set)\\s+)?(?:(\\*)\\s*)?(?=\\s*(((\\b(?<!\\$)0(?:x|X)[0-9a-fA-F][0-9a-fA-F_]*(n)?\\b(?!\\$))|(\\b(?<!\\$)0(?:b|B)[01][01_]*(n)?\\b(?!\\$))|(\\b(?<!\\$)0(?:o|O)?[0-7][0-7_]*(n)?\\b(?!\\$))|((?<!\\$)(?:\n (?:\\b[0-9][0-9_]*(\\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\\b)| # 1.1E+3\n (?:\\b[0-9][0-9_]*(\\.)[eE][+-]?[0-9][0-9_]*(n)?\\b)| # 1.E+3\n (?:\\B(\\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\\b)| # .1E+3\n (?:\\b[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\\b)| # 1E+3\n (?:\\b[0-9][0-9_]*(\\.)[0-9][0-9_]*(n)?\\b)| # 1.1\n (?:\\b[0-9][0-9_]*(\\.)(n)?\\B)| # 1.\n (?:\\B(\\.)[0-9][0-9_]*(n)?\\b)| # .1\n (?:\\b[0-9][0-9_]*(n)?\\b(?!\\.)) # 1\n)(?!\\$))|([_$[:alpha:]][_$[:alnum:]]*)|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`)|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])+\\]))\\s*(\\??))\\s*((<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*))?[\\(])", + "beginCaptures": { + "1": { + "name": "storage.modifier.async.ts" + }, + "2": { + "name": "storage.type.property.ts" + }, + "3": { + "name": "keyword.generator.asterisk.ts" + } + }, + "end": "(?=\\}|;|,)|(?<=\\})", + "patterns": [ + { + "include": "#method-declaration-name" + }, + { + "include": "#function-body" + }, + { + "begin": "(?x)(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(?:\\b(async)\\s+)?(?:\\b(get|set)\\s+)?(?:(\\*)\\s*)?(?=\\s*(((\\b(?<!\\$)0(?:x|X)[0-9a-fA-F][0-9a-fA-F_]*(n)?\\b(?!\\$))|(\\b(?<!\\$)0(?:b|B)[01][01_]*(n)?\\b(?!\\$))|(\\b(?<!\\$)0(?:o|O)?[0-7][0-7_]*(n)?\\b(?!\\$))|((?<!\\$)(?:\n (?:\\b[0-9][0-9_]*(\\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\\b)| # 1.1E+3\n (?:\\b[0-9][0-9_]*(\\.)[eE][+-]?[0-9][0-9_]*(n)?\\b)| # 1.E+3\n (?:\\B(\\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\\b)| # .1E+3\n (?:\\b[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\\b)| # 1E+3\n (?:\\b[0-9][0-9_]*(\\.)[0-9][0-9_]*(n)?\\b)| # 1.1\n (?:\\b[0-9][0-9_]*(\\.)(n)?\\B)| # 1.\n (?:\\B(\\.)[0-9][0-9_]*(n)?\\b)| # .1\n (?:\\b[0-9][0-9_]*(n)?\\b(?!\\.)) # 1\n)(?!\\$))|([_$[:alpha:]][_$[:alnum:]]*)|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`)|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])+\\]))\\s*(\\??))\\s*((<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*))?[\\(])", + "beginCaptures": { + "1": { + "name": "storage.modifier.async.ts" + }, + "2": { + "name": "storage.type.property.ts" + }, + "3": { + "name": "keyword.generator.asterisk.ts" + } + }, + "end": "(?=\\(|\\<)", + "patterns": [ + { + "include": "#method-declaration-name" + } + ] + } + ] + }, + "method-declaration-name": { + "begin": "(?x)(?=((\\b(?<!\\$)0(?:x|X)[0-9a-fA-F][0-9a-fA-F_]*(n)?\\b(?!\\$))|(\\b(?<!\\$)0(?:b|B)[01][01_]*(n)?\\b(?!\\$))|(\\b(?<!\\$)0(?:o|O)?[0-7][0-7_]*(n)?\\b(?!\\$))|((?<!\\$)(?:\n (?:\\b[0-9][0-9_]*(\\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\\b)| # 1.1E+3\n (?:\\b[0-9][0-9_]*(\\.)[eE][+-]?[0-9][0-9_]*(n)?\\b)| # 1.E+3\n (?:\\B(\\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\\b)| # .1E+3\n (?:\\b[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\\b)| # 1E+3\n (?:\\b[0-9][0-9_]*(\\.)[0-9][0-9_]*(n)?\\b)| # 1.1\n (?:\\b[0-9][0-9_]*(\\.)(n)?\\B)| # 1.\n (?:\\B(\\.)[0-9][0-9_]*(n)?\\b)| # .1\n (?:\\b[0-9][0-9_]*(n)?\\b(?!\\.)) # 1\n)(?!\\$))|([_$[:alpha:]][_$[:alnum:]]*)|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`)|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])+\\]))\\s*(\\??)\\s*[\\(\\<])", + "end": "(?=\\(|\\<)", + "patterns": [ + { + "include": "#string" + }, + { + "include": "#array-literal" + }, + { + "include": "#numeric-literal" + }, + { + "name": "meta.definition.method.ts entity.name.function.ts", + "match": "[_$[:alpha:]][_$[:alnum:]]*" + }, + { + "name": "keyword.operator.optional.ts", + "match": "\\?" + } + ] + }, + "arrow-function": { + "patterns": [ + { + "name": "meta.arrow.ts", + "match": "(?:(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(\\basync)\\s+)?([_$[:alpha:]][_$[:alnum:]]*)\\s*(?==>)", + "captures": { + "1": { + "name": "storage.modifier.async.ts" + }, + "2": { + "name": "variable.parameter.ts" + } + } + }, + { + "name": "meta.arrow.ts", + "begin": "(?x) (?:\n (?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(\\basync)\n)? ((?<![})!\\]])\\s*\n (?=\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n )\n)", + "beginCaptures": { + "1": { + "name": "storage.modifier.async.ts" + } + }, + "end": "(?==>|\\{|(^\\s*(export|function|class|interface|let|var|const|import|enum|namespace|module|type|abstract|declare)\\s+))", + "patterns": [ + { + "include": "#comment" + }, + { + "include": "#type-parameters" + }, + { + "include": "#function-parameters" + }, + { + "include": "#arrow-return-type" + }, + { + "include": "#possibly-arrow-return-type" + } + ] + }, + { + "name": "meta.arrow.ts", + "begin": "=>", + "beginCaptures": { + "0": { + "name": "storage.type.function.arrow.ts" + } + }, + "end": "((?<=\\}|\\S)(?<!=>)|((?!\\{)(?=\\S)))(?!\\/[\\/\\*])", + "patterns": [ + { + "include": "#single-line-comment-consuming-line-ending" + }, + { + "include": "#decl-block" + }, + { + "include": "#expression" + } + ] + } + ] + }, + "indexer-declaration": { + "name": "meta.indexer.declaration.ts", + "begin": "(?:(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(readonly)\\s*)?\\s*(\\[)\\s*([_$[:alpha:]][_$[:alnum:]]*)\\s*(?=:)", + "beginCaptures": { + "1": { + "name": "storage.modifier.ts" + }, + "2": { + "name": "meta.brace.square.ts" + }, + "3": { + "name": "variable.parameter.ts" + } + }, + "end": "(\\])\\s*(\\?\\s*)?|$", + "endCaptures": { + "1": { + "name": "meta.brace.square.ts" + }, + "2": { + "name": "keyword.operator.optional.ts" + } + }, + "patterns": [ + { + "include": "#type-annotation" + } + ] + }, + "indexer-mapped-type-declaration": { + "name": "meta.indexer.mappedtype.declaration.ts", + "begin": "(?:(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))([+-])?(readonly)\\s*)?\\s*(\\[)\\s*([_$[:alpha:]][_$[:alnum:]]*)\\s+(in)\\s+", + "beginCaptures": { + "1": { + "name": "keyword.operator.type.modifier.ts" + }, + "2": { + "name": "storage.modifier.ts" + }, + "3": { + "name": "meta.brace.square.ts" + }, + "4": { + "name": "entity.name.type.ts" + }, + "5": { + "name": "keyword.operator.expression.in.ts" + } + }, + "end": "(\\])([+-])?\\s*(\\?\\s*)?|$", + "endCaptures": { + "1": { + "name": "meta.brace.square.ts" + }, + "2": { + "name": "keyword.operator.type.modifier.ts" + }, + "3": { + "name": "keyword.operator.optional.ts" + } + }, + "patterns": [ + { + "include": "#type" + } + ] + }, + "function-parameters": { + "name": "meta.parameters.ts", + "begin": "\\(", + "beginCaptures": { + "0": { + "name": "punctuation.definition.parameters.begin.ts" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.definition.parameters.end.ts" + } + }, + "patterns": [ + { + "include": "#function-parameters-body" + } + ] + }, + "function-parameters-body": { + "patterns": [ + { + "include": "#comment" + }, + { + "include": "#string" + }, + { + "include": "#decorator" + }, + { + "include": "#destructuring-parameter" + }, + { + "include": "#parameter-name" + }, + { + "include": "#parameter-type-annotation" + }, + { + "include": "#variable-initializer" + }, + { + "name": "punctuation.separator.parameter.ts", + "match": "," + } + ] + }, + "class-declaration": { + "name": "meta.class.ts", + "begin": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(?:(\\bexport)\\s+)?(?:(\\bdeclare)\\s+)?\\b(?:(abstract)\\s+)?\\b(class)\\b(?=\\s+|/[/*])", + "beginCaptures": { + "1": { + "name": "keyword.control.export.ts" + }, + "2": { + "name": "storage.modifier.ts" + }, + "3": { + "name": "storage.modifier.ts" + }, + "4": { + "name": "storage.type.class.ts" + } + }, + "end": "(?<=\\})", + "patterns": [ + { + "include": "#class-declaration-or-expression-patterns" + } + ] + }, + "class-expression": { + "name": "meta.class.ts", + "begin": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(?:(abstract)\\s+)?(class)\\b(?=\\s+|[<{]|\\/[\\/*])", + "beginCaptures": { + "1": { + "name": "storage.modifier.ts" + }, + "2": { + "name": "storage.type.class.ts" + } + }, + "end": "(?<=\\})", + "patterns": [ + { + "include": "#class-declaration-or-expression-patterns" + } + ] + }, + "class-declaration-or-expression-patterns": { + "patterns": [ + { + "include": "#comment" + }, + { + "include": "#class-or-interface-heritage" + }, + { + "match": "[_$[:alpha:]][_$[:alnum:]]*", + "captures": { + "0": { + "name": "entity.name.type.class.ts" + } + } + }, + { + "include": "#type-parameters" + }, + { + "include": "#class-or-interface-body" + } + ] + }, + "interface-declaration": { + "name": "meta.interface.ts", + "begin": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(?:(\\bexport)\\s+)?(?:(\\bdeclare)\\s+)?\\b(?:(abstract)\\s+)?\\b(interface)\\b(?=\\s+|/[/*])", + "beginCaptures": { + "1": { + "name": "keyword.control.export.ts" + }, + "2": { + "name": "storage.modifier.ts" + }, + "3": { + "name": "storage.modifier.ts" + }, + "4": { + "name": "storage.type.interface.ts" + } + }, + "end": "(?<=\\})", + "patterns": [ + { + "include": "#comment" + }, + { + "include": "#class-or-interface-heritage" + }, + { + "match": "[_$[:alpha:]][_$[:alnum:]]*", + "captures": { + "0": { + "name": "entity.name.type.interface.ts" + } + } + }, + { + "include": "#type-parameters" + }, + { + "include": "#class-or-interface-body" + } + ] + }, + "class-or-interface-heritage": { + "begin": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(?:\\b(extends|implements)\\b)(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))", + "beginCaptures": { + "1": { + "name": "storage.modifier.ts" + } + }, + "end": "(?=\\{)", + "patterns": [ + { + "include": "#comment" + }, + { + "include": "#class-or-interface-heritage" + }, + { + "include": "#type-parameters" + }, + { + "include": "#expressionWithoutIdentifiers" + }, + { + "match": "([_$[:alpha:]][_$[:alnum:]]*)\\s*(?:(\\.)|(\\?\\.(?!\\s*[[:digit:]])))(?=\\s*[_$[:alpha:]][_$[:alnum:]]*(\\s*\\??\\.\\s*[_$[:alpha:]][_$[:alnum:]]*)*\\s*)", + "captures": { + "1": { + "name": "entity.name.type.module.ts" + }, + "2": { + "name": "punctuation.accessor.ts" + }, + "3": { + "name": "punctuation.accessor.optional.ts" + } + } + }, + { + "match": "([_$[:alpha:]][_$[:alnum:]]*)", + "captures": { + "1": { + "name": "entity.other.inherited-class.ts" + } + } + }, + { + "include": "#expressionPunctuations" + } + ] + }, + "class-or-interface-body": { + "begin": "\\{", + "beginCaptures": { + "0": { + "name": "punctuation.definition.block.ts" + } + }, + "end": "\\}", + "endCaptures": { + "0": { + "name": "punctuation.definition.block.ts" + } + }, + "patterns": [ + { + "include": "#comment" + }, + { + "include": "#decorator" + }, + { + "begin": "(?<=:)\\s*", + "end": "(?=\\s|[;),}\\]:\\-\\+]|;|(?:^\\s*(?:abstract|async|class|const|declare|enum|export|function|import|interface|let|module|namespace|return|type|var)\\b))", + "patterns": [ + { + "include": "#expression" + } + ] + }, + { + "include": "#method-declaration" + }, + { + "include": "#indexer-declaration" + }, + { + "include": "#field-declaration" + }, + { + "include": "#string" + }, + { + "include": "#type-annotation" + }, + { + "include": "#variable-initializer" + }, + { + "include": "#access-modifier" + }, + { + "include": "#property-accessor" + }, + { + "include": "#async-modifier" + }, + { + "include": "#after-operator-block-as-object-literal" + }, + { + "include": "#decl-block" + }, + { + "include": "#expression" + }, + { + "include": "#punctuation-comma" + }, + { + "include": "#punctuation-semicolon" + } + ] + }, + "access-modifier": { + "name": "storage.modifier.ts", + "match": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(abstract|public|protected|private|readonly|static)(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))" + }, + "property-accessor": { + "name": "storage.type.property.ts", + "match": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(get|set)(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))" + }, + "async-modifier": { + "name": "storage.modifier.async.ts", + "match": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(async)(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))" + }, + "enum-declaration": { + "name": "meta.enum.declaration.ts", + "begin": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(?:(\\bexport)\\s+)?(?:(\\bdeclare)\\s+)?(?:\\b(const)\\s+)?\\b(enum)\\s+([_$[:alpha:]][_$[:alnum:]]*)", + "beginCaptures": { + "1": { + "name": "keyword.control.export.ts" + }, + "2": { + "name": "storage.modifier.ts" + }, + "3": { + "name": "storage.modifier.ts" + }, + "4": { + "name": "storage.type.enum.ts" + }, + "5": { + "name": "entity.name.type.enum.ts" + } + }, + "end": "(?<=\\})", + "patterns": [ + { + "include": "#comment" + }, + { + "begin": "\\{", + "beginCaptures": { + "0": { + "name": "punctuation.definition.block.ts" + } + }, + "end": "\\}", + "endCaptures": { + "0": { + "name": "punctuation.definition.block.ts" + } + }, + "patterns": [ + { + "include": "#comment" + }, + { + "begin": "([_$[:alpha:]][_$[:alnum:]]*)", + "beginCaptures": { + "0": { + "name": "variable.other.enummember.ts" + } + }, + "end": "(?=,|\\}|$)", + "patterns": [ + { + "include": "#comment" + }, + { + "include": "#variable-initializer" + } + ] + }, + { + "begin": "(?=((\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`)|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])+\\])))", + "end": "(?=,|\\}|$)", + "patterns": [ + { + "include": "#string" + }, + { + "include": "#array-literal" + }, + { + "include": "#comment" + }, + { + "include": "#variable-initializer" + } + ] + }, + { + "include": "#punctuation-comma" + } + ] + } + ] + }, + "namespace-declaration": { + "name": "meta.namespace.declaration.ts", + "begin": "(?:(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(?:(\\bexport)\\s+)?(?:(\\bdeclare)\\s+)?\\b(namespace|module)\\s+(?=[_$[:alpha:]\"'`]))", + "beginCaptures": { + "1": { + "name": "keyword.control.export.ts" + }, + "2": { + "name": "storage.modifier.ts" + }, + "3": { + "name": "storage.type.namespace.ts" + } + }, + "end": "(?<=\\})|(?=;|(?:^\\s*(?:abstract|async|class|const|declare|enum|export|function|import|interface|let|module|namespace|return|type|var)\\b))", + "patterns": [ + { + "include": "#comment" + }, + { + "include": "#string" + }, + { + "name": "entity.name.type.module.ts", + "match": "([_$[:alpha:]][_$[:alnum:]]*)" + }, + { + "include": "#punctuation-accessor" + }, + { + "include": "#decl-block" + } + ] + }, + "type-alias-declaration": { + "name": "meta.type.declaration.ts", + "begin": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(?:(\\bexport)\\s+)?(?:(\\bdeclare)\\s+)?\\b(type)\\b\\s+([_$[:alpha:]][_$[:alnum:]]*)\\s*", + "beginCaptures": { + "1": { + "name": "keyword.control.export.ts" + }, + "2": { + "name": "storage.modifier.ts" + }, + "3": { + "name": "storage.type.type.ts" + }, + "4": { + "name": "entity.name.type.alias.ts" + } + }, + "end": "(?=\\}|;|(?:^\\s*(?:abstract|async|class|const|declare|enum|export|function|import|interface|let|module|namespace|return|type|var)\\b))", + "patterns": [ + { + "include": "#comment" + }, + { + "include": "#type-parameters" + }, + { + "begin": "(=)\\s*", + "beginCaptures": { + "1": { + "name": "keyword.operator.assignment.ts" + } + }, + "end": "(?=\\}|;|(?:^\\s*(?:abstract|async|class|const|declare|enum|export|function|import|interface|let|module|namespace|return|type|var)\\b))", + "patterns": [ + { + "include": "#type" + } + ] + } + ] + }, + "import-equals-declaration": { + "patterns": [ + { + "name": "meta.import-equals.external.ts", + "begin": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(?:(\\bexport)\\s+)?(?:(\\bdeclare)\\s+)?\\b(import)\\s+([_$[:alpha:]][_$[:alnum:]]*)\\s*(=)\\s*(require)\\s*(\\()", + "beginCaptures": { + "1": { + "name": "keyword.control.export.ts" + }, + "2": { + "name": "storage.modifier.ts" + }, + "3": { + "name": "keyword.control.import.ts" + }, + "4": { + "name": "variable.other.readwrite.alias.ts" + }, + "5": { + "name": "keyword.operator.assignment.ts" + }, + "6": { + "name": "keyword.control.require.ts" + }, + "7": { + "name": "meta.brace.round.ts" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "meta.brace.round.ts" + } + }, + "patterns": [ + { + "include": "#comment" + }, + { + "include": "#string" + } + ] + }, + { + "name": "meta.import-equals.internal.ts", + "begin": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(?:(\\bexport)\\s+)?(?:(\\bdeclare)\\s+)?\\b(import)\\s+([_$[:alpha:]][_$[:alnum:]]*)\\s*(=)\\s*(?!require\\b)", + "beginCaptures": { + "1": { + "name": "keyword.control.export.ts" + }, + "2": { + "name": "storage.modifier.ts" + }, + "3": { + "name": "keyword.control.import.ts" + }, + "4": { + "name": "variable.other.readwrite.alias.ts" + }, + "5": { + "name": "keyword.operator.assignment.ts" + } + }, + "end": "(?=;|$|^)", + "patterns": [ + { + "include": "#single-line-comment-consuming-line-ending" + }, + { + "include": "#comment" + }, + { + "match": "([_$[:alpha:]][_$[:alnum:]]*)\\s*(?:(\\.)|(\\?\\.(?!\\s*[[:digit:]])))", + "captures": { + "1": { + "name": "entity.name.type.module.ts" + }, + "2": { + "name": "punctuation.accessor.ts" + }, + "3": { + "name": "punctuation.accessor.optional.ts" + } + } + }, + { + "name": "variable.other.readwrite.ts", + "match": "([_$[:alpha:]][_$[:alnum:]]*)" + } + ] + } + ] + }, + "import-declaration": { + "name": "meta.import.ts", + "begin": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(?:(\\bexport)\\s+)?(?:(\\bdeclare)\\s+)?\\b(import)(?!\\s*[:\\(])(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))", + "beginCaptures": { + "1": { + "name": "keyword.control.export.ts" + }, + "2": { + "name": "storage.modifier.ts" + }, + "3": { + "name": "keyword.control.import.ts" + } + }, + "end": "(?<!^import|[^\\._$[:alnum:]]import)(?=;|$|^)", + "patterns": [ + { + "include": "#single-line-comment-consuming-line-ending" + }, + { + "include": "#comment" + }, + { + "include": "#string" + }, + { + "begin": "(?<=^import|[^\\._$[:alnum:]]import)(?!\\s*[\"'])", + "end": "\\bfrom\\b", + "endCaptures": { + "0": { + "name": "keyword.control.from.ts" + } + }, + "patterns": [ + { + "include": "#import-export-declaration" + } + ] + }, + { + "include": "#import-export-declaration" + } + ] + }, + "export-declaration": { + "patterns": [ + { + "match": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(export)\\s+(as)\\s+(namespace)\\s+([_$[:alpha:]][_$[:alnum:]]*)", + "captures": { + "1": { + "name": "keyword.control.export.ts" + }, + "2": { + "name": "keyword.control.as.ts" + }, + "3": { + "name": "storage.type.namespace.ts" + }, + "4": { + "name": "entity.name.type.module.ts" + } + } + }, + { + "name": "meta.export.default.ts", + "begin": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(export)(?:(?:\\s*(=))|(?:\\s+(default)(?=\\s+)))", + "beginCaptures": { + "1": { + "name": "keyword.control.export.ts" + }, + "2": { + "name": "keyword.operator.assignment.ts" + }, + "3": { + "name": "keyword.control.default.ts" + } + }, + "end": "(?=$|;|(?:^\\s*(?:abstract|async|class|const|declare|enum|export|function|import|interface|let|module|namespace|return|type|var)\\b))", + "patterns": [ + { + "include": "#interface-declaration" + }, + { + "include": "#expression" + } + ] + }, + { + "name": "meta.export.ts", + "begin": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(export)\\b(?!(\\$)|(\\s*:))((?=\\s*[\\{*])|((?=\\s*[_$[:alpha:]][_$[:alnum:]]*(\\s|,))(?!\\s*(?:abstract|async|class|const|declare|enum|export|function|import|interface|let|module|namespace|return|type|var)\\b)))", + "beginCaptures": { + "0": { + "name": "keyword.control.export.ts" + } + }, + "end": "(?=$|;|(?:^\\s*(?:abstract|async|class|const|declare|enum|export|function|import|interface|let|module|namespace|return|type|var)\\b))", + "patterns": [ + { + "include": "#import-export-declaration" + } + ] + } + ] + }, + "import-export-declaration": { + "patterns": [ + { + "include": "#comment" + }, + { + "include": "#string" + }, + { + "include": "#import-export-block" + }, + { + "name": "keyword.control.from.ts", + "match": "\\bfrom\\b" + }, + { + "include": "#import-export-clause" + } + ] + }, + "import-export-block": { + "name": "meta.block.ts", + "begin": "\\{", + "beginCaptures": { + "0": { + "name": "punctuation.definition.block.ts" + } + }, + "end": "\\}", + "endCaptures": { + "0": { + "name": "punctuation.definition.block.ts" + } + }, + "patterns": [ + { + "include": "#import-export-clause" + } + ] + }, + "import-export-clause": { + "patterns": [ + { + "include": "#comment" + }, + { + "match": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(?:(\\bdefault)|(\\*)|(\\b[_$[:alpha:]][_$[:alnum:]]*))\\s+(as)\\s+(?:(default(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.)))|([_$[:alpha:]][_$[:alnum:]]*))", + "captures": { + "1": { + "name": "keyword.control.default.ts" + }, + "2": { + "name": "constant.language.import-export-all.ts" + }, + "3": { + "name": "variable.other.readwrite.ts" + }, + "4": { + "name": "keyword.control.as.ts" + }, + "5": { + "name": "keyword.control.default.ts" + }, + "6": { + "name": "variable.other.readwrite.alias.ts" + } + } + }, + { + "include": "#punctuation-comma" + }, + { + "name": "constant.language.import-export-all.ts", + "match": "\\*" + }, + { + "name": "keyword.control.default.ts", + "match": "\\b(default)\\b" + }, + { + "name": "variable.other.readwrite.alias.ts", + "match": "([_$[:alpha:]][_$[:alnum:]]*)" + } + ] + }, + "switch-statement": { + "name": "switch-statement.expr.ts", + "begin": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(?=\\bswitch\\s*\\()", + "end": "\\}", + "endCaptures": { + "0": { + "name": "punctuation.definition.block.ts" + } + }, + "patterns": [ + { + "include": "#comment" + }, + { + "name": "switch-expression.expr.ts", + "begin": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(switch)\\s*(\\()", + "beginCaptures": { + "1": { + "name": "keyword.control.switch.ts" + }, + "2": { + "name": "meta.brace.round.ts" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "meta.brace.round.ts" + } + }, + "patterns": [ + { + "include": "#expression" + } + ] + }, + { + "name": "switch-block.expr.ts", + "begin": "\\{", + "beginCaptures": { + "0": { + "name": "punctuation.definition.block.ts" + } + }, + "end": "(?=\\})", + "patterns": [ + { + "name": "case-clause.expr.ts", + "begin": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(case|default(?=:))(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))", + "beginCaptures": { + "1": { + "name": "keyword.control.switch.ts" + } + }, + "end": "(?=:)", + "patterns": [ + { + "include": "#expression" + } + ] + }, + { + "begin": "(:)\\s*(\\{)", + "beginCaptures": { + "1": { + "name": "case-clause.expr.ts punctuation.definition.section.case-statement.ts" + }, + "2": { + "name": "meta.block.ts punctuation.definition.block.ts" + } + }, + "end": "\\}", + "endCaptures": { + "0": { + "name": "meta.block.ts punctuation.definition.block.ts" + } + }, + "contentName": "meta.block.ts", + "patterns": [ + { + "include": "#statements" + } + ] + }, + { + "match": "(:)", + "captures": { + "0": { + "name": "case-clause.expr.ts punctuation.definition.section.case-statement.ts" + } + } + }, + { + "include": "#statements" + } + ] + } + ] + }, + "for-loop": { + "begin": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))for(?=((\\s+|(\\s*\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*))await)?\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)?(\\())", + "beginCaptures": { + "0": { + "name": "keyword.control.loop.ts" + } + }, + "end": "(?<=\\))", + "patterns": [ + { + "include": "#comment" + }, + { + "name": "keyword.control.loop.ts", + "match": "await" + }, + { + "begin": "\\(", + "beginCaptures": { + "0": { + "name": "meta.brace.round.ts" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "meta.brace.round.ts" + } + }, + "patterns": [ + { + "include": "#var-expr" + }, + { + "include": "#expression" + }, + { + "include": "#punctuation-semicolon" + } + ] + } + ] + }, + "if-statement": { + "patterns": [ + { + "begin": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(?=\\bif\\s*(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))\\s*(?!\\{))", + "end": "(?=;|$|\\})", + "patterns": [ + { + "include": "#comment" + }, + { + "begin": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(if)\\s*(\\()", + "beginCaptures": { + "1": { + "name": "keyword.control.conditional.ts" + }, + "2": { + "name": "meta.brace.round.ts" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "meta.brace.round.ts" + } + }, + "patterns": [ + { + "include": "#expression" + } + ] + }, + { + "name": "string.regexp.ts", + "begin": "(?<=\\))\\s*\\/(?![\\/*])(?=(?:[^\\/\\\\\\[]|\\\\.|\\[([^\\]\\\\]|\\\\.)+\\])+\\/([gimsuy]+|(?![\\/\\*])|(?=\\/\\*))(?!\\s*[a-zA-Z0-9_$]))", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.ts" + } + }, + "end": "(/)([gimsuy]*)", + "endCaptures": { + "1": { + "name": "punctuation.definition.string.end.ts" + }, + "2": { + "name": "keyword.other.ts" + } + }, + "patterns": [ + { + "include": "#regexp" + } + ] + }, + { + "include": "#statements" + } + ] + } + ] + }, + "decl-block": { + "name": "meta.block.ts", + "begin": "\\{", + "beginCaptures": { + "0": { + "name": "punctuation.definition.block.ts" + } + }, + "end": "\\}", + "endCaptures": { + "0": { + "name": "punctuation.definition.block.ts" + } + }, + "patterns": [ + { + "include": "#statements" + } + ] + }, + "after-operator-block-as-object-literal": { + "name": "meta.objectliteral.ts", + "begin": "(?<!\\+\\+|--)(?<=[:=(,\\[?+!>]|^await|[^\\._$[:alnum:]]await|^return|[^\\._$[:alnum:]]return|^yield|[^\\._$[:alnum:]]yield|^throw|[^\\._$[:alnum:]]throw|^in|[^\\._$[:alnum:]]in|^of|[^\\._$[:alnum:]]of|^typeof|[^\\._$[:alnum:]]typeof|&&|\\|\\||\\*)\\s*(\\{)", + "beginCaptures": { + "1": { + "name": "punctuation.definition.block.ts" + } + }, + "end": "\\}", + "endCaptures": { + "0": { + "name": "punctuation.definition.block.ts" + } + }, + "patterns": [ + { + "include": "#object-member" + } + ] + }, + "object-literal": { + "name": "meta.objectliteral.ts", + "begin": "\\{", + "beginCaptures": { + "0": { + "name": "punctuation.definition.block.ts" + } + }, + "end": "\\}", + "endCaptures": { + "0": { + "name": "punctuation.definition.block.ts" + } + }, + "patterns": [ + { + "include": "#object-member" + } + ] + }, + "object-member": { + "patterns": [ + { + "include": "#comment" + }, + { + "include": "#object-literal-method-declaration" + }, + { + "name": "meta.object.member.ts meta.object-literal.key.ts", + "begin": "(?=\\[)", + "end": "(?=:)|((?<=[\\]])(?=\\s*[\\(\\<]))", + "patterns": [ + { + "include": "#comment" + }, + { + "include": "#array-literal" + } + ] + }, + { + "name": "meta.object.member.ts meta.object-literal.key.ts", + "begin": "(?=[\\'\\\"\\`])", + "end": "(?=:)|((?<=[\\'\\\"\\`])(?=((\\s*[\\(\\<,}])|(\\s+(as)\\s+))))", + "patterns": [ + { + "include": "#comment" + }, + { + "include": "#string" + } + ] + }, + { + "name": "meta.object.member.ts meta.object-literal.key.ts", + "begin": "(?x)(?=(\\b(?<!\\$)0(?:x|X)[0-9a-fA-F][0-9a-fA-F_]*(n)?\\b(?!\\$))|(\\b(?<!\\$)0(?:b|B)[01][01_]*(n)?\\b(?!\\$))|(\\b(?<!\\$)0(?:o|O)?[0-7][0-7_]*(n)?\\b(?!\\$))|((?<!\\$)(?:\n (?:\\b[0-9][0-9_]*(\\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\\b)| # 1.1E+3\n (?:\\b[0-9][0-9_]*(\\.)[eE][+-]?[0-9][0-9_]*(n)?\\b)| # 1.E+3\n (?:\\B(\\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\\b)| # .1E+3\n (?:\\b[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\\b)| # 1E+3\n (?:\\b[0-9][0-9_]*(\\.)[0-9][0-9_]*(n)?\\b)| # 1.1\n (?:\\b[0-9][0-9_]*(\\.)(n)?\\B)| # 1.\n (?:\\B(\\.)[0-9][0-9_]*(n)?\\b)| # .1\n (?:\\b[0-9][0-9_]*(n)?\\b(?!\\.)) # 1\n)(?!\\$)))", + "end": "(?=:)|(?=\\s*([\\(\\<,}])|(\\s+as\\s+))", + "patterns": [ + { + "include": "#comment" + }, + { + "include": "#numeric-literal" + } + ] + }, + { + "name": "meta.method.declaration.ts", + "begin": "(?<=[\\]\\'\\\"\\`])(?=\\s*[\\(\\<])", + "end": "(?=\\}|;|,)|(?<=\\})", + "patterns": [ + { + "include": "#function-body" + } + ] + }, + { + "name": "meta.object.member.ts", + "match": "(?![_$[:alpha:]])([[:digit:]]+)\\s*(?=(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*:)", + "captures": { + "0": { + "name": "meta.object-literal.key.ts" + }, + "1": { + "name": "constant.numeric.decimal.ts" + } + } + }, + { + "name": "meta.object.member.ts", + "match": "(?x)(?:([_$[:alpha:]][_$[:alnum:]]*)\\s*(?=(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*:(\\s*\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/)*\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|((<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?[\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)))", + "captures": { + "0": { + "name": "meta.object-literal.key.ts" + }, + "1": { + "name": "entity.name.function.ts" + } + } + }, + { + "name": "meta.object.member.ts", + "match": "(?:[_$[:alpha:]][_$[:alnum:]]*)\\s*(?=(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*:)", + "captures": { + "0": { + "name": "meta.object-literal.key.ts" + } + } + }, + { + "name": "meta.object.member.ts", + "begin": "\\.\\.\\.", + "beginCaptures": { + "0": { + "name": "keyword.operator.spread.ts" + } + }, + "end": "(?=,|\\})", + "patterns": [ + { + "include": "#expression" + } + ] + }, + { + "name": "meta.object.member.ts", + "match": "([_$[:alpha:]][_$[:alnum:]]*)\\s*(?=,|\\}|$|\\/\\/|\\/\\*)", + "captures": { + "1": { + "name": "variable.other.readwrite.ts" + } + } + }, + { + "name": "meta.object.member.ts", + "match": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(as)\\s+(const)(?=\\s*([,}]|$))", + "captures": { + "1": { + "name": "keyword.control.as.ts" + }, + "2": { + "name": "storage.modifier.ts" + } + } + }, + { + "name": "meta.object.member.ts", + "begin": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(as)\\s+", + "beginCaptures": { + "1": { + "name": "keyword.control.as.ts" + } + }, + "end": "(?=$|^|[,}]|\\|\\||\\&\\&|((?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(as)\\s+))", + "patterns": [ + { + "include": "#type" + } + ] + }, + { + "name": "meta.object.member.ts", + "begin": "(?=[_$[:alpha:]][_$[:alnum:]]*\\s*=)", + "end": "(?=,|\\}|$|\\/\\/|\\/\\*)", + "patterns": [ + { + "include": "#expression" + } + ] + }, + { + "name": "meta.object.member.ts", + "begin": ":", + "beginCaptures": { + "0": { + "name": "meta.object-literal.key.ts punctuation.separator.key-value.ts" + } + }, + "end": "(?=,|\\})", + "patterns": [ + { + "begin": "(?<=:)\\s*(async)?(?=\\s*(<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)\\(\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))", + "beginCaptures": { + "1": { + "name": "storage.modifier.async.ts" + } + }, + "end": "(?<=\\))", + "patterns": [ + { + "include": "#type-parameters" + }, + { + "begin": "\\(", + "beginCaptures": { + "0": { + "name": "meta.brace.round.ts" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "meta.brace.round.ts" + } + }, + "patterns": [ + { + "include": "#expression-inside-possibly-arrow-parens" + } + ] + } + ] + }, + { + "begin": "(?<=:)\\s*(async)?\\s*(\\()(?=\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))", + "beginCaptures": { + "1": { + "name": "storage.modifier.async.ts" + }, + "2": { + "name": "meta.brace.round.ts" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "meta.brace.round.ts" + } + }, + "patterns": [ + { + "include": "#expression-inside-possibly-arrow-parens" + } + ] + }, + { + "include": "#possibly-arrow-return-type" + }, + { + "include": "#expression" + } + ] + }, + { + "include": "#punctuation-comma" + } + ] + }, + "ternary-expression": { + "begin": "(?!\\?\\.\\s*[^[:digit:]])(\\?)(?!\\?)", + "beginCaptures": { + "1": { + "name": "keyword.operator.ternary.ts" + } + }, + "end": "\\s*(:)", + "endCaptures": { + "1": { + "name": "keyword.operator.ternary.ts" + } + }, + "patterns": [ + { + "include": "#expression" + } + ] + }, + "function-call": { + "begin": "(?=(((([_$[:alpha:]][_$[:alnum:]]*\\s*\\??\\.\\s*)*|(\\??\\.\\s*)?)([_$[:alpha:]][_$[:alnum:]]*))|(?<=[\\)]))\\s*(?:(\\?\\.\\s*)|(\\!))?(<\\s*(((keyof|infer|typeof)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\'[^\\']*\\')|(\\\"[^\\\"]*\\\")|(\\`[^\\`]*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\'[^\\']*\\')|(\\\"[^\\\"]*\\\")|(\\`[^\\`]*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))(([^<>\\(]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\'[^\\']*\\')|(\\\"[^\\\"]*\\\")|(\\`[^\\`]*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(?<==)\\>)*(?<!=)\\>))*(?<!=)\\>)*(?<!=)>\\s*)?\\()", + "end": "(?<=\\))(?!(((([_$[:alpha:]][_$[:alnum:]]*\\s*\\??\\.\\s*)*|(\\??\\.\\s*)?)([_$[:alpha:]][_$[:alnum:]]*))|(?<=[\\)]))\\s*(?:(\\?\\.\\s*)|(\\!))?(<\\s*(((keyof|infer|typeof)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\'[^\\']*\\')|(\\\"[^\\\"]*\\\")|(\\`[^\\`]*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\'[^\\']*\\')|(\\\"[^\\\"]*\\\")|(\\`[^\\`]*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))(([^<>\\(]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\'[^\\']*\\')|(\\\"[^\\\"]*\\\")|(\\`[^\\`]*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(?<==)\\>)*(?<!=)\\>))*(?<!=)\\>)*(?<!=)>\\s*)?\\()", + "patterns": [ + { + "name": "meta.function-call.ts", + "begin": "(?=(([_$[:alpha:]][_$[:alnum:]]*\\s*\\??\\.\\s*)*|(\\??\\.\\s*)?)([_$[:alpha:]][_$[:alnum:]]*))", + "end": "(?=\\s*(?:(\\?\\.\\s*)|(\\!))?(<\\s*(((keyof|infer|typeof)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\'[^\\']*\\')|(\\\"[^\\\"]*\\\")|(\\`[^\\`]*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\'[^\\']*\\')|(\\\"[^\\\"]*\\\")|(\\`[^\\`]*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))(([^<>\\(]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\'[^\\']*\\')|(\\\"[^\\\"]*\\\")|(\\`[^\\`]*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(?<==)\\>)*(?<!=)\\>))*(?<!=)\\>)*(?<!=)>\\s*)?\\()", + "patterns": [ + { + "include": "#support-function-call-identifiers" + }, + { + "name": "entity.name.function.ts", + "match": "([_$[:alpha:]][_$[:alnum:]]*)" + } + ] + }, + { + "include": "#comment" + }, + { + "name": "meta.function-call.ts punctuation.accessor.optional.ts", + "match": "\\?\\." + }, + { + "name": "meta.function-call.ts keyword.operator.definiteassignment.ts", + "match": "\\!" + }, + { + "include": "#type-arguments" + }, + { + "include": "#paren-expression" + } + ] + }, + "support-function-call-identifiers": { + "patterns": [ + { + "include": "#literal" + }, + { + "include": "#support-objects" + }, + { + "include": "#object-identifiers" + }, + { + "include": "#punctuation-accessor" + }, + { + "name": "keyword.operator.expression.import.ts", + "match": "(?:(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))import(?=\\s*[\\(]\\s*[\\\"\\'\\`]))" + } + ] + }, + "new-expr": { + "name": "new.expr.ts", + "begin": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(new)(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))", + "beginCaptures": { + "1": { + "name": "keyword.operator.new.ts" + } + }, + "end": "(?<=\\))|(?=[;),}\\]:\\-\\+]|\\|\\||\\&\\&|$|((?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))new(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.)))|((?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))function((\\s+[_$[:alpha:]][_$[:alnum:]]*)|(\\s*[\\(]))))", + "patterns": [ + { + "include": "#paren-expression" + }, + { + "include": "#class-declaration" + }, + { + "include": "#type" + } + ] + }, + "instanceof-expr": { + "begin": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(instanceof)(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))", + "beginCaptures": { + "1": { + "name": "keyword.operator.expression.instanceof.ts" + } + }, + "end": "(?<=\\))|(?=[;),}\\]:?]|\\|\\||\\&\\&|$|((?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))function((\\s+[_$[:alpha:]][_$[:alnum:]]*)|(\\s*[\\(]))))", + "patterns": [ + { + "include": "#type" + } + ] + }, + "paren-expression-possibly-arrow": { + "patterns": [ + { + "begin": "(?<=[(=,])\\s*(async)?(?=\\s*((<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*))?\\(\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))", + "beginCaptures": { + "1": { + "name": "storage.modifier.async.ts" + } + }, + "end": "(?<=\\))", + "patterns": [ + { + "include": "#paren-expression-possibly-arrow-with-typeparameters" + } + ] + }, + { + "begin": "(?<=[(=,]|=>|^return|[^\\._$[:alnum:]]return)\\s*(async)?(?=\\s*((((<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*))?\\()|(<))\\s*$)", + "beginCaptures": { + "1": { + "name": "storage.modifier.async.ts" + } + }, + "end": "(?<=\\))", + "patterns": [ + { + "include": "#paren-expression-possibly-arrow-with-typeparameters" + } + ] + }, + { + "include": "#possibly-arrow-return-type" + } + ] + }, + "paren-expression-possibly-arrow-with-typeparameters": { + "patterns": [ + { + "include": "#type-parameters" + }, + { + "begin": "\\(", + "beginCaptures": { + "0": { + "name": "meta.brace.round.ts" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "meta.brace.round.ts" + } + }, + "patterns": [ + { + "include": "#expression-inside-possibly-arrow-parens" + } + ] + } + ] + }, + "expression-inside-possibly-arrow-parens": { + "patterns": [ + { + "include": "#expressionWithoutIdentifiers" + }, + { + "include": "#comment" + }, + { + "include": "#string" + }, + { + "include": "#decorator" + }, + { + "include": "#destructuring-parameter" + }, + { + "match": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(public|protected|private|readonly)\\s+(?=(public|protected|private|readonly)\\s+)", + "captures": { + "1": { + "name": "storage.modifier.ts" + } + } + }, + { + "match": "(?x)(?:(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(public|private|protected|readonly)\\s+)?(?:(\\.\\.\\.)\\s*)?(?<!=|:)(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(?:(this)|([_$[:alpha:]][_$[:alnum:]]*))(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))\\s*(\\??)(?=\\s*\n# function assignment |\n(=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|((<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?[\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)) |\n# typeannotation is fn type: < | () | (... | (param: | (param, | (param? | (param= | (param) =>\n(:\\s*(\n (<) |\n ([(]\\s*(\n ([)]) |\n (\\.\\.\\.) |\n ([_$[:alnum:]]+\\s*(\n ([:,?=])|\n ([)]\\s*=>)\n ))\n ))\n)) |\n(:\\s*(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))Function(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))) |\n(:\\s*((<\\s*$)|((<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?[\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*))))))) |\n(:\\s*(=>|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(<[^<>]*>)|[^<>(),=])+=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|((<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?[\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)))", + "captures": { + "1": { + "name": "storage.modifier.ts" + }, + "2": { + "name": "keyword.operator.rest.ts" + }, + "3": { + "name": "entity.name.function.ts variable.language.this.ts" + }, + "4": { + "name": "entity.name.function.ts" + }, + "5": { + "name": "keyword.operator.optional.ts" + } + } + }, + { + "match": "(?x)(?:(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(public|private|protected|readonly)\\s+)?(?:(\\.\\.\\.)\\s*)?(?<!=|:)(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(?:(this)|([_$[:alpha:]][_$[:alnum:]]*))(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))\\s*(\\??)(?=\\s*:)", + "captures": { + "1": { + "name": "storage.modifier.ts" + }, + "2": { + "name": "keyword.operator.rest.ts" + }, + "3": { + "name": "variable.parameter.ts variable.language.this.ts" + }, + "4": { + "name": "variable.parameter.ts" + }, + "5": { + "name": "keyword.operator.optional.ts" + } + } + }, + { + "include": "#type-annotation" + }, + { + "include": "#variable-initializer" + }, + { + "name": "punctuation.separator.parameter.ts", + "match": "," + }, + { + "include": "#identifiers" + }, + { + "include": "#expressionPunctuations" + } + ] + }, + "paren-expression": { + "begin": "\\(", + "beginCaptures": { + "0": { + "name": "meta.brace.round.ts" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "meta.brace.round.ts" + } + }, + "patterns": [ + { + "include": "#expression" + } + ] + }, + "cast": { + "patterns": [ + { + "name": "cast.expr.ts", + "match": "\\s*(<)\\s*(const)\\s*(>)", + "captures": { + "1": { + "name": "meta.brace.angle.ts" + }, + "2": { + "name": "storage.modifier.ts" + }, + "3": { + "name": "meta.brace.angle.ts" + } + } + }, + { + "name": "cast.expr.ts", + "begin": "(?:(?<!\\+\\+|--)(?<=^return|[^\\._$[:alnum:]]return|^throw|[^\\._$[:alnum:]]throw|^yield|[^\\._$[:alnum:]]yield|^await|[^\\._$[:alnum:]]await|^default|[^\\._$[:alnum:]]default|[=(,:>*?\\&\\|\\^]|[^_$[:alnum:]](?:\\+\\+|\\-\\-)|[^\\+]\\+|[^\\-]\\-))\\s*(<)(?!<?\\=)(?!\\s*$)", + "beginCaptures": { + "1": { + "name": "meta.brace.angle.ts" + } + }, + "end": "(\\>)", + "endCaptures": { + "1": { + "name": "meta.brace.angle.ts" + } + }, + "patterns": [ + { + "include": "#type" + } + ] + }, + { + "name": "cast.expr.ts", + "begin": "(?:(?<=^))\\s*(<)(?=[_$[:alpha:]][_$[:alnum:]]*\\s*>)", + "beginCaptures": { + "1": { + "name": "meta.brace.angle.ts" + } + }, + "end": "(\\>)", + "endCaptures": { + "1": { + "name": "meta.brace.angle.ts" + } + }, + "patterns": [ + { + "include": "#type" + } + ] + } + ] + }, + "expression-operators": { + "patterns": [ + { + "name": "keyword.control.flow.ts", + "match": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(await)(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))" + }, + { + "begin": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(yield)(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))(?=\\s*\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*\\*)", + "beginCaptures": { + "1": { + "name": "keyword.control.flow.ts" + } + }, + "end": "\\*", + "endCaptures": { + "0": { + "name": "keyword.generator.asterisk.ts" + } + }, + "patterns": [ + { + "include": "#comment" + } + ] + }, + { + "match": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(yield)(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))(?:\\s*(\\*))?", + "captures": { + "1": { + "name": "keyword.control.flow.ts" + }, + "2": { + "name": "keyword.generator.asterisk.ts" + } + } + }, + { + "name": "keyword.operator.expression.delete.ts", + "match": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))delete(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))" + }, + { + "name": "keyword.operator.expression.in.ts", + "match": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))in(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))(?!\\()" + }, + { + "name": "keyword.operator.expression.of.ts", + "match": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))of(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))(?!\\()" + }, + { + "name": "keyword.operator.expression.instanceof.ts", + "match": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))instanceof(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))" + }, + { + "name": "keyword.operator.new.ts", + "match": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))new(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))" + }, + { + "include": "#typeof-operator" + }, + { + "name": "keyword.operator.expression.void.ts", + "match": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))void(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))" + }, + { + "match": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(as)\\s+(const)(?=\\s*($|[;,:})\\]]))", + "captures": { + "1": { + "name": "keyword.control.as.ts" + }, + "2": { + "name": "storage.modifier.ts" + } + } + }, + { + "begin": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(as)\\s+", + "beginCaptures": { + "1": { + "name": "keyword.control.as.ts" + } + }, + "end": "(?=$|^|[;,:})\\]]|\\|\\||\\&\\&|((?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(as)\\s+)|(\\s+\\<))", + "patterns": [ + { + "include": "#type" + } + ] + }, + { + "name": "keyword.operator.spread.ts", + "match": "\\.\\.\\." + }, + { + "name": "keyword.operator.assignment.compound.ts", + "match": "\\*=|(?<!\\()/=|%=|\\+=|\\-=" + }, + { + "name": "keyword.operator.assignment.compound.bitwise.ts", + "match": "\\&=|\\^=|<<=|>>=|>>>=|\\|=" + }, + { + "name": "keyword.operator.bitwise.shift.ts", + "match": "<<|>>>|>>" + }, + { + "name": "keyword.operator.comparison.ts", + "match": "===|!==|==|!=" + }, + { + "name": "keyword.operator.relational.ts", + "match": "<=|>=|<>|<|>" + }, + { + "name": "keyword.operator.logical.ts", + "match": "\\!|&&|\\|\\||\\?\\?" + }, + { + "name": "keyword.operator.bitwise.ts", + "match": "\\&|~|\\^|\\|" + }, + { + "name": "keyword.operator.assignment.ts", + "match": "\\=" + }, + { + "name": "keyword.operator.decrement.ts", + "match": "--" + }, + { + "name": "keyword.operator.increment.ts", + "match": "\\+\\+" + }, + { + "name": "keyword.operator.arithmetic.ts", + "match": "%|\\*|/|-|\\+" + }, + { + "begin": "(?<=[_$[:alnum:])\\]])\\s*(?=(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)+(/)(?![/*]))", + "end": "(/)(?!\\*([^\\*]|(\\*[^\\/]))*\\*\\/)", + "endCaptures": { + "1": { + "name": "keyword.operator.arithmetic.ts" + } + }, + "patterns": [ + { + "include": "#comment" + } + ] + }, + { + "match": "(?<=[_$[:alnum:])\\]])\\s*(/)(?![/*])", + "captures": { + "1": { + "name": "keyword.operator.arithmetic.ts" + } + } + } + ] + }, + "typeof-operator": { + "name": "keyword.operator.expression.typeof.ts", + "match": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))typeof(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))" + }, + "literal": { + "patterns": [ + { + "include": "#numeric-literal" + }, + { + "include": "#boolean-literal" + }, + { + "include": "#null-literal" + }, + { + "include": "#undefined-literal" + }, + { + "include": "#numericConstant-literal" + }, + { + "include": "#array-literal" + }, + { + "include": "#this-literal" + }, + { + "include": "#super-literal" + } + ] + }, + "array-literal": { + "name": "meta.array.literal.ts", + "begin": "\\s*(\\[)", + "beginCaptures": { + "1": { + "name": "meta.brace.square.ts" + } + }, + "end": "\\]", + "endCaptures": { + "0": { + "name": "meta.brace.square.ts" + } + }, + "patterns": [ + { + "include": "#expression" + }, + { + "include": "#punctuation-comma" + } + ] + }, + "numeric-literal": { + "patterns": [ + { + "name": "constant.numeric.hex.ts", + "match": "\\b(?<!\\$)0(?:x|X)[0-9a-fA-F][0-9a-fA-F_]*(n)?\\b(?!\\$)", + "captures": { + "1": { + "name": "storage.type.numeric.bigint.ts" + } + } + }, + { + "name": "constant.numeric.binary.ts", + "match": "\\b(?<!\\$)0(?:b|B)[01][01_]*(n)?\\b(?!\\$)", + "captures": { + "1": { + "name": "storage.type.numeric.bigint.ts" + } + } + }, + { + "name": "constant.numeric.octal.ts", + "match": "\\b(?<!\\$)0(?:o|O)?[0-7][0-7_]*(n)?\\b(?!\\$)", + "captures": { + "1": { + "name": "storage.type.numeric.bigint.ts" + } + } + }, + { + "match": "(?x)\n(?<!\\$)(?:\n (?:\\b[0-9][0-9_]*(\\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\\b)| # 1.1E+3\n (?:\\b[0-9][0-9_]*(\\.)[eE][+-]?[0-9][0-9_]*(n)?\\b)| # 1.E+3\n (?:\\B(\\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\\b)| # .1E+3\n (?:\\b[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\\b)| # 1E+3\n (?:\\b[0-9][0-9_]*(\\.)[0-9][0-9_]*(n)?\\b)| # 1.1\n (?:\\b[0-9][0-9_]*(\\.)(n)?\\B)| # 1.\n (?:\\B(\\.)[0-9][0-9_]*(n)?\\b)| # .1\n (?:\\b[0-9][0-9_]*(n)?\\b(?!\\.)) # 1\n)(?!\\$)", + "captures": { + "0": { + "name": "constant.numeric.decimal.ts" + }, + "1": { + "name": "meta.delimiter.decimal.period.ts" + }, + "2": { + "name": "storage.type.numeric.bigint.ts" + }, + "3": { + "name": "meta.delimiter.decimal.period.ts" + }, + "4": { + "name": "storage.type.numeric.bigint.ts" + }, + "5": { + "name": "meta.delimiter.decimal.period.ts" + }, + "6": { + "name": "storage.type.numeric.bigint.ts" + }, + "7": { + "name": "storage.type.numeric.bigint.ts" + }, + "8": { + "name": "meta.delimiter.decimal.period.ts" + }, + "9": { + "name": "storage.type.numeric.bigint.ts" + }, + "10": { + "name": "meta.delimiter.decimal.period.ts" + }, + "11": { + "name": "storage.type.numeric.bigint.ts" + }, + "12": { + "name": "meta.delimiter.decimal.period.ts" + }, + "13": { + "name": "storage.type.numeric.bigint.ts" + }, + "14": { + "name": "storage.type.numeric.bigint.ts" + } + } + } + ] + }, + "boolean-literal": { + "patterns": [ + { + "name": "constant.language.boolean.true.ts", + "match": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))true(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))" + }, + { + "name": "constant.language.boolean.false.ts", + "match": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))false(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))" + } + ] + }, + "null-literal": { + "name": "constant.language.null.ts", + "match": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))null(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))" + }, + "this-literal": { + "name": "variable.language.this.ts", + "match": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))this\\b(?!\\$)" + }, + "super-literal": { + "name": "variable.language.super.ts", + "match": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))super\\b(?!\\$)" + }, + "undefined-literal": { + "name": "constant.language.undefined.ts", + "match": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))undefined(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))" + }, + "numericConstant-literal": { + "patterns": [ + { + "name": "constant.language.nan.ts", + "match": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))NaN(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))" + }, + { + "name": "constant.language.infinity.ts", + "match": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))Infinity(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))" + } + ] + }, + "support-objects": { + "patterns": [ + { + "name": "variable.language.arguments.ts", + "match": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(arguments)\\b(?!\\$)" + }, + { + "name": "support.class.builtin.ts", + "match": "(?x)(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(Array|ArrayBuffer|Atomics|BigInt|BigInt64Array|BigUint64Array|Boolean|DataView|Date|Float32Array\n |Float64Array|Function|Generator|GeneratorFunction|Int8Array|Int16Array|Int32Array|Intl|Map|Number|Object|Proxy\n |Reflect|RegExp|Set|SharedArrayBuffer|SIMD|String|Symbol|TypedArray\n |Uint8Array|Uint16Array|Uint32Array|Uint8ClampedArray|WeakMap|WeakSet)\\b(?!\\$)" + }, + { + "name": "support.class.error.ts", + "match": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))((Eval|Internal|Range|Reference|Syntax|Type|URI)?Error)\\b(?!\\$)" + }, + { + "name": "support.class.promise.ts", + "match": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(Promise)\\b(?!\\$)" + }, + { + "name": "support.function.ts", + "match": "(?x)(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(clear(Interval|Timeout)|decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|escape|eval|\n isFinite|isNaN|parseFloat|parseInt|require|set(Interval|Timeout)|super|unescape|uneval)(?=\\s*\\()" + }, + { + "match": "(?x)(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(Math)(?:\\s*(?:(\\.)|(\\?\\.(?!\\s*[[:digit:]])))\\s*(?:\n (abs|acos|acosh|asin|asinh|atan|atan2|atanh|cbrt|ceil|clz32|cos|cosh|exp|\n expm1|floor|fround|hypot|imul|log|log10|log1p|log2|max|min|pow|random|\n round|sign|sin|sinh|sqrt|tan|tanh|trunc)\n |\n (E|LN10|LN2|LOG10E|LOG2E|PI|SQRT1_2|SQRT2)))?\\b(?!\\$)", + "captures": { + "1": { + "name": "support.constant.math.ts" + }, + "2": { + "name": "punctuation.accessor.ts" + }, + "3": { + "name": "punctuation.accessor.optional.ts" + }, + "4": { + "name": "support.function.math.ts" + }, + "5": { + "name": "support.constant.property.math.ts" + } + } + }, + { + "match": "(?x)(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(console)(?:\\s*(?:(\\.)|(\\?\\.(?!\\s*[[:digit:]])))\\s*(\n assert|clear|count|debug|dir|error|group|groupCollapsed|groupEnd|info|log\n |profile|profileEnd|table|time|timeEnd|timeStamp|trace|warn))?\\b(?!\\$)", + "captures": { + "1": { + "name": "support.class.console.ts" + }, + "2": { + "name": "punctuation.accessor.ts" + }, + "3": { + "name": "punctuation.accessor.optional.ts" + }, + "4": { + "name": "support.function.console.ts" + } + } + }, + { + "match": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(JSON)(?:\\s*(?:(\\.)|(\\?\\.(?!\\s*[[:digit:]])))\\s*(parse|stringify))?\\b(?!\\$)", + "captures": { + "1": { + "name": "support.constant.json.ts" + }, + "2": { + "name": "punctuation.accessor.ts" + }, + "3": { + "name": "punctuation.accessor.optional.ts" + }, + "4": { + "name": "support.function.json.ts" + } + } + }, + { + "match": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(import)\\s*(?:(\\.)|(\\?\\.(?!\\s*[[:digit:]])))\\s*(meta)\\b(?!\\$)", + "captures": { + "1": { + "name": "keyword.control.import.ts" + }, + "2": { + "name": "punctuation.accessor.ts" + }, + "3": { + "name": "punctuation.accessor.optional.ts" + }, + "4": { + "name": "support.variable.property.importmeta.ts" + } + } + }, + { + "match": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(new)\\s*(?:(\\.)|(\\?\\.(?!\\s*[[:digit:]])))\\s*(target)\\b(?!\\$)", + "captures": { + "1": { + "name": "keyword.operator.new.ts" + }, + "2": { + "name": "punctuation.accessor.ts" + }, + "3": { + "name": "punctuation.accessor.optional.ts" + }, + "4": { + "name": "support.variable.property.target.ts" + } + } + }, + { + "match": "(?x) (?:(\\.)|(\\?\\.(?!\\s*[[:digit:]]))) \\s* (?:\n (?:(constructor|length|prototype|__proto__)\\b(?!\\$|\\s*(<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\\())\n |\n (?:(EPSILON|MAX_SAFE_INTEGER|MAX_VALUE|MIN_SAFE_INTEGER|MIN_VALUE|NEGATIVE_INFINITY|POSITIVE_INFINITY)\\b(?!\\$)))", + "captures": { + "1": { + "name": "punctuation.accessor.ts" + }, + "2": { + "name": "punctuation.accessor.optional.ts" + }, + "3": { + "name": "support.variable.property.ts" + }, + "4": { + "name": "support.constant.ts" + } + } + }, + { + "name": "support.class.node.ts", + "match": "(?x)(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(Buffer|EventEmitter|Server|Pipe|Socket|REPLServer|ReadStream|WriteStream|Stream\n |Inflate|Deflate|InflateRaw|DeflateRaw|GZip|GUnzip|Unzip|Zip)\\b(?!\\$)" + }, + { + "match": "(?x)(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(process)(?:(?:(\\.)|(\\?\\.(?!\\s*[[:digit:]])))(?:\n (arch|argv|config|connected|env|execArgv|execPath|exitCode|mainModule|pid|platform|release|stderr|stdin|stdout|title|version|versions)\n |\n (abort|chdir|cwd|disconnect|exit|[sg]ete?[gu]id|send|[sg]etgroups|initgroups|kill|memoryUsage|nextTick|umask|uptime|hrtime)\n))?\\b(?!\\$)", + "captures": { + "1": { + "name": "support.variable.object.process.ts" + }, + "2": { + "name": "punctuation.accessor.ts" + }, + "3": { + "name": "punctuation.accessor.optional.ts" + }, + "4": { + "name": "support.variable.property.process.ts" + }, + "5": { + "name": "support.function.process.ts" + } + } + }, + { + "match": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(?:(exports)|(module)(?:(?:(\\.)|(\\?\\.(?!\\s*[[:digit:]])))(exports|id|filename|loaded|parent|children))?)\\b(?!\\$)", + "captures": { + "1": { + "name": "support.type.object.module.ts" + }, + "2": { + "name": "support.type.object.module.ts" + }, + "3": { + "name": "punctuation.accessor.ts" + }, + "4": { + "name": "punctuation.accessor.optional.ts" + }, + "5": { + "name": "support.type.object.module.ts" + } + } + }, + { + "name": "support.variable.object.node.ts", + "match": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(global|GLOBAL|root|__dirname|__filename)\\b(?!\\$)" + } + ] + }, + "identifiers": { + "patterns": [ + { + "include": "#object-identifiers" + }, + { + "match": "(?x)(?:(?:(\\.)|(\\?\\.(?!\\s*[[:digit:]])))\\s*)?([_$[:alpha:]][_$[:alnum:]]*)(?=\\s*=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|((<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?[\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n))", + "captures": { + "1": { + "name": "punctuation.accessor.ts" + }, + "2": { + "name": "punctuation.accessor.optional.ts" + }, + "3": { + "name": "entity.name.function.ts" + } + } + }, + { + "match": "(?:(\\.)|(\\?\\.(?!\\s*[[:digit:]])))\\s*([[:upper:]][_$[:digit:][:upper:]]*)(?![_$[:alnum:]])", + "captures": { + "1": { + "name": "punctuation.accessor.ts" + }, + "2": { + "name": "punctuation.accessor.optional.ts" + }, + "3": { + "name": "variable.other.constant.property.ts" + } + } + }, + { + "match": "(?:(\\.)|(\\?\\.(?!\\s*[[:digit:]])))\\s*([_$[:alpha:]][_$[:alnum:]]*)", + "captures": { + "1": { + "name": "punctuation.accessor.ts" + }, + "2": { + "name": "punctuation.accessor.optional.ts" + }, + "3": { + "name": "variable.other.property.ts" + } + } + }, + { + "name": "variable.other.constant.ts", + "match": "([[:upper:]][_$[:digit:][:upper:]]*)(?![_$[:alnum:]])" + }, + { + "name": "variable.other.readwrite.ts", + "match": "[_$[:alpha:]][_$[:alnum:]]*" + } + ] + }, + "object-identifiers": { + "patterns": [ + { + "name": "support.class.ts", + "match": "([_$[:alpha:]][_$[:alnum:]]*)(?=\\s*\\??\\.\\s*prototype\\b(?!\\$))" + }, + { + "match": "(?x)(?:(\\.)|(\\?\\.(?!\\s*[[:digit:]])))\\s*(?:\n ([[:upper:]][_$[:digit:][:upper:]]*) |\n ([_$[:alpha:]][_$[:alnum:]]*)\n)(?=\\s*\\??\\.\\s*[_$[:alpha:]][_$[:alnum:]]*)", + "captures": { + "1": { + "name": "punctuation.accessor.ts" + }, + "2": { + "name": "punctuation.accessor.optional.ts" + }, + "3": { + "name": "variable.other.constant.object.property.ts" + }, + "4": { + "name": "variable.other.object.property.ts" + } + } + }, + { + "match": "(?x)(?:\n ([[:upper:]][_$[:digit:][:upper:]]*) |\n ([_$[:alpha:]][_$[:alnum:]]*)\n)(?=\\s*\\??\\.\\s*[_$[:alpha:]][_$[:alnum:]]*)", + "captures": { + "1": { + "name": "variable.other.constant.object.ts" + }, + "2": { + "name": "variable.other.object.ts" + } + } + } + ] + }, + "type-annotation": { + "patterns": [ + { + "name": "meta.type.annotation.ts", + "begin": "(:)(?=\\s*\\S)", + "beginCaptures": { + "1": { + "name": "keyword.operator.type.annotation.ts" + } + }, + "end": "(?<![:|&])((?=$|^|[,);\\}\\]]|//)|(?==[^>])|((?<=[\\}>\\]\\)]|[_$[:alpha:]])\\s*(?=\\{)))", + "patterns": [ + { + "include": "#type" + } + ] + }, + { + "name": "meta.type.annotation.ts", + "begin": "(:)", + "beginCaptures": { + "1": { + "name": "keyword.operator.type.annotation.ts" + } + }, + "end": "(?<![:|&])((?=[,);\\}\\]]|//)|(?==[^>])|(?=^\\s*$)|((?<=\\S)(?=\\s*$))|((?<=[\\}>\\]\\)]|[_$[:alpha:]])\\s*(?=\\{)))", + "patterns": [ + { + "include": "#type" + } + ] + } + ] + }, + "parameter-type-annotation": { + "patterns": [ + { + "name": "meta.type.annotation.ts", + "begin": "(:)", + "beginCaptures": { + "1": { + "name": "keyword.operator.type.annotation.ts" + } + }, + "end": "(?=[,)])|(?==[^>])", + "patterns": [ + { + "include": "#type" + } + ] + } + ] + }, + "return-type": { + "patterns": [ + { + "name": "meta.return.type.ts", + "begin": "(?<=\\))\\s*(:)(?=\\s*\\S)", + "beginCaptures": { + "1": { + "name": "keyword.operator.type.annotation.ts" + } + }, + "end": "(?<![:|&])(?=$|^|[{};,]|//)", + "patterns": [ + { + "include": "#return-type-core" + } + ] + }, + { + "name": "meta.return.type.ts", + "begin": "(?<=\\))\\s*(:)", + "beginCaptures": { + "1": { + "name": "keyword.operator.type.annotation.ts" + } + }, + "end": "(?<![:|&])((?=[{};,]|//|^\\s*$)|((?<=\\S)(?=\\s*$)))", + "patterns": [ + { + "include": "#return-type-core" + } + ] + } + ] + }, + "return-type-core": { + "patterns": [ + { + "include": "#comment" + }, + { + "begin": "(?<=[:|&])(?=\\s*\\{)", + "end": "(?<=\\})", + "patterns": [ + { + "include": "#type-object" + } + ] + }, + { + "include": "#type-predicate-operator" + }, + { + "include": "#type" + } + ] + }, + "arrow-return-type": { + "name": "meta.return.type.arrow.ts", + "begin": "(?<=\\))\\s*(:)", + "beginCaptures": { + "1": { + "name": "keyword.operator.type.annotation.ts" + } + }, + "end": "(?==>|\\{|(^\\s*(export|function|class|interface|let|var|const|import|enum|namespace|module|type|abstract|declare)\\s+))", + "patterns": [ + { + "include": "#arrow-return-type-body" + } + ] + }, + "possibly-arrow-return-type": { + "begin": "(?<=\\)|^)\\s*(:)(?=\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*=>)", + "beginCaptures": { + "1": { + "name": "meta.arrow.ts meta.return.type.arrow.ts keyword.operator.type.annotation.ts" + } + }, + "end": "(?==>|\\{|(^\\s*(export|function|class|interface|let|var|const|import|enum|namespace|module|type|abstract|declare)\\s+))", + "contentName": "meta.arrow.ts meta.return.type.arrow.ts", + "patterns": [ + { + "include": "#arrow-return-type-body" + } + ] + }, + "arrow-return-type-body": { + "patterns": [ + { + "begin": "(?<=[:])(?=\\s*\\{)", + "end": "(?<=\\})", + "patterns": [ + { + "include": "#type-object" + } + ] + }, + { + "include": "#type-predicate-operator" + }, + { + "include": "#type" + } + ] + }, + "type-parameters": { + "name": "meta.type.parameters.ts", + "begin": "(<)", + "beginCaptures": { + "1": { + "name": "punctuation.definition.typeparameters.begin.ts" + } + }, + "end": "(>)", + "endCaptures": { + "1": { + "name": "punctuation.definition.typeparameters.end.ts" + } + }, + "patterns": [ + { + "include": "#comment" + }, + { + "name": "storage.modifier.ts", + "match": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(extends)(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))" + }, + { + "include": "#type" + }, + { + "include": "#punctuation-comma" + }, + { + "name": "keyword.operator.assignment.ts", + "match": "(=)(?!>)" + } + ] + }, + "type-arguments": { + "name": "meta.type.parameters.ts", + "begin": "\\<", + "beginCaptures": { + "0": { + "name": "punctuation.definition.typeparameters.begin.ts" + } + }, + "end": "\\>", + "endCaptures": { + "0": { + "name": "punctuation.definition.typeparameters.end.ts" + } + }, + "patterns": [ + { + "include": "#type-arguments-body" + } + ] + }, + "type-arguments-body": { + "patterns": [ + { + "match": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(_)(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))", + "captures": { + "0": { + "name": "keyword.operator.type.ts" + } + } + }, + { + "include": "#type" + }, + { + "include": "#punctuation-comma" + } + ] + }, + "type": { + "patterns": [ + { + "include": "#comment" + }, + { + "include": "#string" + }, + { + "include": "#numeric-literal" + }, + { + "include": "#type-primitive" + }, + { + "include": "#type-builtin-literals" + }, + { + "include": "#type-parameters" + }, + { + "include": "#type-tuple" + }, + { + "include": "#type-object" + }, + { + "include": "#type-conditional" + }, + { + "include": "#type-operators" + }, + { + "include": "#type-fn-type-parameters" + }, + { + "include": "#type-paren-or-function-parameters" + }, + { + "include": "#type-function-return-type" + }, + { + "match": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(readonly)(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))\\s*", + "captures": { + "1": { + "name": "storage.modifier.ts" + } + } + }, + { + "include": "#type-name" + } + ] + }, + "type-primitive": { + "name": "support.type.primitive.ts", + "match": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(string|number|bigint|boolean|symbol|any|void|never|unknown)(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))" + }, + "type-builtin-literals": { + "name": "support.type.builtin.ts", + "match": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(this|true|false|undefined|null|object)(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))" + }, + "type-tuple": { + "name": "meta.type.tuple.ts", + "begin": "\\[", + "beginCaptures": { + "0": { + "name": "meta.brace.square.ts" + } + }, + "end": "\\]", + "endCaptures": { + "0": { + "name": "meta.brace.square.ts" + } + }, + "patterns": [ + { + "include": "#type" + }, + { + "include": "#punctuation-comma" + } + ] + }, + "type-object": { + "name": "meta.object.type.ts", + "begin": "\\{", + "beginCaptures": { + "0": { + "name": "punctuation.definition.block.ts" + } + }, + "end": "\\}", + "endCaptures": { + "0": { + "name": "punctuation.definition.block.ts" + } + }, + "patterns": [ + { + "include": "#comment" + }, + { + "include": "#method-declaration" + }, + { + "include": "#indexer-declaration" + }, + { + "include": "#indexer-mapped-type-declaration" + }, + { + "include": "#field-declaration" + }, + { + "include": "#type-annotation" + }, + { + "begin": "\\.\\.\\.", + "beginCaptures": { + "0": { + "name": "keyword.operator.spread.ts" + } + }, + "end": "(?=\\}|;|,|$)|(?<=\\})", + "patterns": [ + { + "include": "#type" + } + ] + }, + { + "include": "#punctuation-comma" + }, + { + "include": "#punctuation-semicolon" + }, + { + "include": "#type" + } + ] + }, + "type-conditional": { + "patterns": [ + { + "begin": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(extends)\\s+", + "beginCaptures": { + "1": { + "name": "storage.modifier.ts" + } + }, + "end": "(?<=:)", + "patterns": [ + { + "begin": "\\?", + "beginCaptures": { + "0": { + "name": "keyword.operator.ternary.ts" + } + }, + "end": ":", + "endCaptures": { + "0": { + "name": "keyword.operator.ternary.ts" + } + }, + "patterns": [ + { + "include": "#type" + } + ] + }, + { + "include": "#type" + } + ] + } + ] + }, + "type-paren-or-function-parameters": { + "name": "meta.type.paren.cover.ts", + "begin": "\\(", + "beginCaptures": { + "0": { + "name": "meta.brace.round.ts" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "meta.brace.round.ts" + } + }, + "patterns": [ + { + "match": "(?x)(?:(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(public|private|protected|readonly)\\s+)?(?:(\\.\\.\\.)\\s*)?(?<!=|:)(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(?:(this)|([_$[:alpha:]][_$[:alnum:]]*))\\s*(\\??)(?=\\s*(:\\s*(\n (<) |\n ([(]\\s*(\n ([)]) |\n (\\.\\.\\.) |\n ([_$[:alnum:]]+\\s*(\n ([:,?=])|\n ([)]\\s*=>)\n ))\n ))\n)) |\n(:\\s*(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))Function(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))) |\n(:\\s*((<\\s*$)|((<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?[\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*))))))))", + "captures": { + "1": { + "name": "storage.modifier.ts" + }, + "2": { + "name": "keyword.operator.rest.ts" + }, + "3": { + "name": "entity.name.function.ts variable.language.this.ts" + }, + "4": { + "name": "entity.name.function.ts" + }, + "5": { + "name": "keyword.operator.optional.ts" + } + } + }, + { + "match": "(?x)(?:(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(public|private|protected|readonly)\\s+)?(?:(\\.\\.\\.)\\s*)?(?<!=|:)(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(?:(this)|([_$[:alpha:]][_$[:alnum:]]*))\\s*(\\??)(?=:)", + "captures": { + "1": { + "name": "storage.modifier.ts" + }, + "2": { + "name": "keyword.operator.rest.ts" + }, + "3": { + "name": "variable.parameter.ts variable.language.this.ts" + }, + "4": { + "name": "variable.parameter.ts" + }, + "5": { + "name": "keyword.operator.optional.ts" + } + } + }, + { + "include": "#type-annotation" + }, + { + "name": "punctuation.separator.parameter.ts", + "match": "," + }, + { + "include": "#type" + } + ] + }, + "type-fn-type-parameters": { + "patterns": [ + { + "begin": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(new)\\b(?=\\s*\\<)", + "beginCaptures": { + "1": { + "name": "meta.type.constructor.ts keyword.control.new.ts" + } + }, + "end": "(?<=>)", + "patterns": [ + { + "include": "#comment" + }, + { + "include": "#type-parameters" + } + ] + }, + { + "name": "meta.type.constructor.ts", + "begin": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(new)\\b\\s*(?=\\()", + "beginCaptures": { + "1": { + "name": "keyword.control.new.ts" + } + }, + "end": "(?<=\\))", + "patterns": [ + { + "include": "#function-parameters" + } + ] + }, + { + "name": "meta.type.function.ts", + "begin": "(?x)(\n (?=\n [(]\\s*(\n ([)]) |\n (\\.\\.\\.) |\n ([_$[:alnum:]]+\\s*(\n ([:,?=])|\n ([)]\\s*=>)\n ))\n )\n )\n)", + "end": "(?<=\\))", + "patterns": [ + { + "include": "#function-parameters" + } + ] + } + ] + }, + "type-function-return-type": { + "patterns": [ + { + "name": "meta.type.function.return.ts", + "begin": "(=>)(?=\\s*\\S)", + "beginCaptures": { + "1": { + "name": "storage.type.function.arrow.ts" + } + }, + "end": "(?<!=>)(?<![|&])(?=[,\\]\\)\\{\\}=;>:\\?]|//|$)", + "patterns": [ + { + "include": "#type-function-return-type-core" + } + ] + }, + { + "name": "meta.type.function.return.ts", + "begin": "=>", + "beginCaptures": { + "0": { + "name": "storage.type.function.arrow.ts" + } + }, + "end": "(?<!=>)(?<![|&])((?=[,\\]\\)\\{\\}=;:\\?>]|//|^\\s*$)|((?<=\\S)(?=\\s*$)))", + "patterns": [ + { + "include": "#type-function-return-type-core" + } + ] + } + ] + }, + "type-function-return-type-core": { + "patterns": [ + { + "include": "#comment" + }, + { + "begin": "(?<==>)(?=\\s*\\{)", + "end": "(?<=\\})", + "patterns": [ + { + "include": "#type-object" + } + ] + }, + { + "include": "#type-predicate-operator" + }, + { + "include": "#type" + } + ] + }, + "type-operators": { + "patterns": [ + { + "include": "#typeof-operator" + }, + { + "begin": "([&|])(?=\\s*\\{)", + "beginCaptures": { + "0": { + "name": "keyword.operator.type.ts" + } + }, + "end": "(?<=\\})", + "patterns": [ + { + "include": "#type-object" + } + ] + }, + { + "begin": "[&|]", + "beginCaptures": { + "0": { + "name": "keyword.operator.type.ts" + } + }, + "end": "(?=\\S)" + }, + { + "name": "keyword.operator.expression.keyof.ts", + "match": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))keyof(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))" + }, + { + "name": "keyword.operator.ternary.ts", + "match": "(\\?|\\:)" + }, + { + "name": "keyword.operator.expression.infer.ts", + "match": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))infer(?=\\s+[_$[:alpha:]])" + }, + { + "name": "keyword.operator.expression.import.ts", + "match": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))import(?=\\s*\\()" + } + ] + }, + "type-predicate-operator": { + "patterns": [ + { + "match": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(?:(asserts)\\s+)?(?!asserts)(?:(this)|([_$[:alpha:]][_$[:alnum:]]*))\\s(is)(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))", + "captures": { + "1": { + "name": "keyword.operator.type.asserts.ts" + }, + "2": { + "name": "variable.parameter.ts variable.language.this.ts" + }, + "3": { + "name": "variable.parameter.ts" + }, + "4": { + "name": "keyword.operator.expression.is.ts" + } + } + }, + { + "match": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(asserts)\\s+(?!is)(?:(this)|([_$[:alpha:]][_$[:alnum:]]*))(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))", + "captures": { + "1": { + "name": "keyword.operator.type.asserts.ts" + }, + "2": { + "name": "variable.parameter.ts variable.language.this.ts" + }, + "3": { + "name": "variable.parameter.ts" + } + } + }, + { + "name": "keyword.operator.type.asserts.ts", + "match": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))asserts(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))" + }, + { + "name": "keyword.operator.expression.is.ts", + "match": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))is(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))" + } + ] + }, + "type-name": { + "patterns": [ + { + "begin": "([_$[:alpha:]][_$[:alnum:]]*)\\s*(?:(\\.)|(\\?\\.(?!\\s*[[:digit:]])))\\s*(<)", + "captures": { + "1": { + "name": "entity.name.type.module.ts" + }, + "2": { + "name": "punctuation.accessor.ts" + }, + "3": { + "name": "punctuation.accessor.optional.ts" + }, + "4": { + "name": "meta.type.parameters.ts punctuation.definition.typeparameters.begin.ts" + } + }, + "end": "(>)", + "endCaptures": { + "1": { + "name": "meta.type.parameters.ts punctuation.definition.typeparameters.end.ts" + } + }, + "contentName": "meta.type.parameters.ts", + "patterns": [ + { + "include": "#type-arguments-body" + } + ] + }, + { + "begin": "([_$[:alpha:]][_$[:alnum:]]*)\\s*(<)", + "beginCaptures": { + "1": { + "name": "entity.name.type.ts" + }, + "2": { + "name": "meta.type.parameters.ts punctuation.definition.typeparameters.begin.ts" + } + }, + "end": "(>)", + "endCaptures": { + "1": { + "name": "meta.type.parameters.ts punctuation.definition.typeparameters.end.ts" + } + }, + "contentName": "meta.type.parameters.ts", + "patterns": [ + { + "include": "#type-arguments-body" + } + ] + }, + { + "match": "([_$[:alpha:]][_$[:alnum:]]*)\\s*(?:(\\.)|(\\?\\.(?!\\s*[[:digit:]])))", + "captures": { + "1": { + "name": "entity.name.type.module.ts" + }, + "2": { + "name": "punctuation.accessor.ts" + }, + "3": { + "name": "punctuation.accessor.optional.ts" + } + } + }, + { + "name": "entity.name.type.ts", + "match": "[_$[:alpha:]][_$[:alnum:]]*" + } + ] + }, + "punctuation-comma": { + "name": "punctuation.separator.comma.ts", + "match": "," + }, + "punctuation-semicolon": { + "name": "punctuation.terminator.statement.ts", + "match": ";" + }, + "punctuation-accessor": { + "match": "(?:(\\.)|(\\?\\.(?!\\s*[[:digit:]])))", + "captures": { + "1": { + "name": "punctuation.accessor.ts" + }, + "2": { + "name": "punctuation.accessor.optional.ts" + } + } + }, + "string": { + "patterns": [ + { + "include": "#qstring-single" + }, + { + "include": "#qstring-double" + }, + { + "include": "#template" + } + ] + }, + "qstring-double": { + "name": "string.quoted.double.ts", + "begin": "\"", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.ts" + } + }, + "end": "(\")|((?:[^\\\\\\n])$)", + "endCaptures": { + "1": { + "name": "punctuation.definition.string.end.ts" + }, + "2": { + "name": "invalid.illegal.newline.ts" + } + }, + "patterns": [ + { + "include": "#string-character-escape" + } + ] + }, + "qstring-single": { + "name": "string.quoted.single.ts", + "begin": "'", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.ts" + } + }, + "end": "(\\')|((?:[^\\\\\\n])$)", + "endCaptures": { + "1": { + "name": "punctuation.definition.string.end.ts" + }, + "2": { + "name": "invalid.illegal.newline.ts" + } + }, + "patterns": [ + { + "include": "#string-character-escape" + } + ] + }, + "string-character-escape": { + "name": "constant.character.escape.ts", + "match": "\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4}|u\\{[0-9A-Fa-f]+\\}|[0-2][0-7]{0,2}|3[0-6][0-7]?|37[0-7]?|[4-7][0-7]?|.|$)" + }, + "template": { + "patterns": [ + { + "name": "string.template.ts", + "begin": "(?=(([_$[:alpha:]][_$[:alnum:]]*\\s*\\??\\.\\s*)*|(\\??\\.\\s*)?)([_$[:alpha:]][_$[:alnum:]]*)(<\\s*(((keyof|infer|typeof)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\'[^\\']*\\')|(\\\"[^\\\"]*\\\")|(\\`[^\\`]*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\'[^\\']*\\')|(\\\"[^\\\"]*\\\")|(\\`[^\\`]*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))(([^<>\\(]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\'[^\\']*\\')|(\\\"[^\\\"]*\\\")|(\\`[^\\`]*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(?<==)\\>)*(?<!=)\\>))*(?<!=)\\>)*(?<!=)>\\s*)?`)", + "end": "(?=`)", + "patterns": [ + { + "begin": "(?=(([_$[:alpha:]][_$[:alnum:]]*\\s*\\??\\.\\s*)*|(\\??\\.\\s*)?)([_$[:alpha:]][_$[:alnum:]]*))", + "end": "(?=(<\\s*(((keyof|infer|typeof)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\'[^\\']*\\')|(\\\"[^\\\"]*\\\")|(\\`[^\\`]*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\'[^\\']*\\')|(\\\"[^\\\"]*\\\")|(\\`[^\\`]*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))(([^<>\\(]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\'[^\\']*\\')|(\\\"[^\\\"]*\\\")|(\\`[^\\`]*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(?<==)\\>)*(?<!=)\\>))*(?<!=)\\>)*(?<!=)>\\s*)?`)", + "patterns": [ + { + "include": "#support-function-call-identifiers" + }, + { + "name": "entity.name.function.tagged-template.ts", + "match": "([_$[:alpha:]][_$[:alnum:]]*)" + } + ] + }, + { + "include": "#type-arguments" + } + ] + }, + { + "name": "string.template.ts", + "begin": "([_$[:alpha:]][_$[:alnum:]]*)\\s*(?=(<\\s*(((keyof|infer|typeof)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\'[^\\']*\\')|(\\\"[^\\\"]*\\\")|(\\`[^\\`]*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\'[^\\']*\\')|(\\\"[^\\\"]*\\\")|(\\`[^\\`]*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))(([^<>\\(]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\'[^\\']*\\')|(\\\"[^\\\"]*\\\")|(\\`[^\\`]*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(?<==)\\>)*(?<!=)\\>))*(?<!=)\\>)*(?<!=)>\\s*)`)", + "beginCaptures": { + "1": { + "name": "entity.name.function.tagged-template.ts" + } + }, + "end": "(?=`)", + "patterns": [ + { + "include": "#type-arguments" + } + ] + }, + { + "name": "string.template.ts", + "begin": "([_$[:alpha:]][_$[:alnum:]]*)?(`)", + "beginCaptures": { + "1": { + "name": "entity.name.function.tagged-template.ts" + }, + "2": { + "name": "punctuation.definition.string.template.begin.ts" + } + }, + "end": "`", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.template.end.ts" + } + }, + "patterns": [ + { + "include": "#template-substitution-element" + }, + { + "include": "#string-character-escape" + } + ] + } + ] + }, + "template-substitution-element": { + "name": "meta.template.expression.ts", + "begin": "\\$\\{", + "beginCaptures": { + "0": { + "name": "punctuation.definition.template-expression.begin.ts" + } + }, + "end": "\\}", + "endCaptures": { + "0": { + "name": "punctuation.definition.template-expression.end.ts" + } + }, + "patterns": [ + { + "include": "#expression" + } + ], + "contentName": "meta.embedded.line.ts" + }, + "regex": { + "patterns": [ + { + "name": "string.regexp.ts", + "begin": "(?<!\\+\\+|--|})(?<=[=(:,\\[?+!]|^return|[^\\._$[:alnum:]]return|^case|[^\\._$[:alnum:]]case|=>|&&|\\|\\||\\*\\/)\\s*(\\/)(?![\\/*])(?=(?:[^\\/\\\\\\[\\()]|\\\\.|\\[([^\\]\\\\]|\\\\.)+\\]|\\(([^\\)\\\\]|\\\\.)+\\))+\\/([gimsuy]+|(?![\\/\\*])|(?=\\/\\*))(?!\\s*[a-zA-Z0-9_$]))", + "beginCaptures": { + "1": { + "name": "punctuation.definition.string.begin.ts" + } + }, + "end": "(/)([gimsuy]*)", + "endCaptures": { + "1": { + "name": "punctuation.definition.string.end.ts" + }, + "2": { + "name": "keyword.other.ts" + } + }, + "patterns": [ + { + "include": "#regexp" + } + ] + }, + { + "name": "string.regexp.ts", + "begin": "((?<![_$[:alnum:])\\]]|\\+\\+|--|}|\\*\\/)|((?<=^return|[^\\._$[:alnum:]]return|^case|[^\\._$[:alnum:]]case))\\s*)\\/(?![\\/*])(?=(?:[^\\/\\\\\\[]|\\\\.|\\[([^\\]\\\\]|\\\\.)+\\])+\\/([gimsuy]+|(?![\\/\\*])|(?=\\/\\*))(?!\\s*[a-zA-Z0-9_$]))", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.ts" + } + }, + "end": "(/)([gimsuy]*)", + "endCaptures": { + "1": { + "name": "punctuation.definition.string.end.ts" + }, + "2": { + "name": "keyword.other.ts" + } + }, + "patterns": [ + { + "include": "#regexp" + } + ] + } + ] + }, + "regexp": { + "patterns": [ + { + "name": "keyword.control.anchor.regexp", + "match": "\\\\[bB]|\\^|\\$" + }, + { + "match": "\\\\[1-9]\\d*|\\\\k<([a-zA-Z_$][\\w$]*)>", + "captures": { + "0": { + "name": "keyword.other.back-reference.regexp" + }, + "1": { + "name": "variable.other.regexp" + } + } + }, + { + "name": "keyword.operator.quantifier.regexp", + "match": "[?+*]|\\{(\\d+,\\d+|\\d+,|,\\d+|\\d+)\\}\\??" + }, + { + "name": "keyword.operator.or.regexp", + "match": "\\|" + }, + { + "name": "meta.group.assertion.regexp", + "begin": "(\\()((\\?=)|(\\?!)|(\\?<=)|(\\?<!))", + "beginCaptures": { + "1": { + "name": "punctuation.definition.group.regexp" + }, + "2": { + "name": "punctuation.definition.group.assertion.regexp" + }, + "3": { + "name": "meta.assertion.look-ahead.regexp" + }, + "4": { + "name": "meta.assertion.negative-look-ahead.regexp" + }, + "5": { + "name": "meta.assertion.look-behind.regexp" + }, + "6": { + "name": "meta.assertion.negative-look-behind.regexp" + } + }, + "end": "(\\))", + "endCaptures": { + "1": { + "name": "punctuation.definition.group.regexp" + } + }, + "patterns": [ + { + "include": "#regexp" + } + ] + }, + { + "name": "meta.group.regexp", + "begin": "\\((?:(\\?:)|(?:\\?<([a-zA-Z_$][\\w$]*)>))?", + "beginCaptures": { + "0": { + "name": "punctuation.definition.group.regexp" + }, + "1": { + "name": "punctuation.definition.group.no-capture.regexp" + }, + "2": { + "name": "variable.other.regexp" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.definition.group.regexp" + } + }, + "patterns": [ + { + "include": "#regexp" + } + ] + }, + { + "name": "constant.other.character-class.set.regexp", + "begin": "(\\[)(\\^)?", + "beginCaptures": { + "1": { + "name": "punctuation.definition.character-class.regexp" + }, + "2": { + "name": "keyword.operator.negation.regexp" + } + }, + "end": "(\\])", + "endCaptures": { + "1": { + "name": "punctuation.definition.character-class.regexp" + } + }, + "patterns": [ + { + "name": "constant.other.character-class.range.regexp", + "match": "(?:.|(\\\\(?:[0-7]{3}|x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4}))|(\\\\c[A-Z])|(\\\\.))\\-(?:[^\\]\\\\]|(\\\\(?:[0-7]{3}|x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4}))|(\\\\c[A-Z])|(\\\\.))", + "captures": { + "1": { + "name": "constant.character.numeric.regexp" + }, + "2": { + "name": "constant.character.control.regexp" + }, + "3": { + "name": "constant.character.escape.backslash.regexp" + }, + "4": { + "name": "constant.character.numeric.regexp" + }, + "5": { + "name": "constant.character.control.regexp" + }, + "6": { + "name": "constant.character.escape.backslash.regexp" + } + } + }, + { + "include": "#regex-character-class" + } + ] + }, + { + "include": "#regex-character-class" + } + ] + }, + "regex-character-class": { + "patterns": [ + { + "name": "constant.other.character-class.regexp", + "match": "\\\\[wWsSdDtrnvf]|\\." + }, + { + "name": "constant.character.numeric.regexp", + "match": "\\\\([0-7]{3}|x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4})" + }, + { + "name": "constant.character.control.regexp", + "match": "\\\\c[A-Z]" + }, + { + "name": "constant.character.escape.backslash.regexp", + "match": "\\\\." + } + ] + }, + "comment": { + "patterns": [ + { + "name": "comment.block.documentation.ts", + "begin": "/\\*\\*(?!/)", + "beginCaptures": { + "0": { + "name": "punctuation.definition.comment.ts" + } + }, + "end": "\\*/", + "endCaptures": { + "0": { + "name": "punctuation.definition.comment.ts" + } + }, + "patterns": [ + { + "include": "#docblock" + } + ] + }, + { + "name": "comment.block.ts", + "begin": "(/\\*)(?:\\s*((@)internal)(?=\\s|(\\*/)))?", + "beginCaptures": { + "1": { + "name": "punctuation.definition.comment.ts" + }, + "2": { + "name": "storage.type.internaldeclaration.ts" + }, + "3": { + "name": "punctuation.decorator.internaldeclaration.ts" + } + }, + "end": "\\*/", + "endCaptures": { + "0": { + "name": "punctuation.definition.comment.ts" + } + } + }, + { + "begin": "(^[ \\t]+)?((//)(?:\\s*((@)internal)(?=\\s|$))?)", + "beginCaptures": { + "1": { + "name": "punctuation.whitespace.comment.leading.ts" + }, + "2": { + "name": "comment.line.double-slash.ts" + }, + "3": { + "name": "punctuation.definition.comment.ts" + }, + "4": { + "name": "storage.type.internaldeclaration.ts" + }, + "5": { + "name": "punctuation.decorator.internaldeclaration.ts" + } + }, + "end": "(?=$)", + "contentName": "comment.line.double-slash.ts" + } + ] + }, + "single-line-comment-consuming-line-ending": { + "begin": "(^[ \\t]+)?((//)(?:\\s*((@)internal)(?=\\s|$))?)", + "beginCaptures": { + "1": { + "name": "punctuation.whitespace.comment.leading.ts" + }, + "2": { + "name": "comment.line.double-slash.ts" + }, + "3": { + "name": "punctuation.definition.comment.ts" + }, + "4": { + "name": "storage.type.internaldeclaration.ts" + }, + "5": { + "name": "punctuation.decorator.internaldeclaration.ts" + } + }, + "end": "(?=^)", + "contentName": "comment.line.double-slash.ts" + }, + "directives": { + "name": "comment.line.triple-slash.directive.ts", + "begin": "^(///)\\s*(?=<(reference|amd-dependency|amd-module)(\\s+(path|types|no-default-lib|lib|name)\\s*=\\s*((\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`)))+\\s*/>\\s*$)", + "beginCaptures": { + "1": { + "name": "punctuation.definition.comment.ts" + } + }, + "end": "(?=$)", + "patterns": [ + { + "name": "meta.tag.ts", + "begin": "(<)(reference|amd-dependency|amd-module)", + "beginCaptures": { + "1": { + "name": "punctuation.definition.tag.directive.ts" + }, + "2": { + "name": "entity.name.tag.directive.ts" + } + }, + "end": "/>", + "endCaptures": { + "0": { + "name": "punctuation.definition.tag.directive.ts" + } + }, + "patterns": [ + { + "name": "entity.other.attribute-name.directive.ts", + "match": "path|types|no-default-lib|lib|name" + }, + { + "name": "keyword.operator.assignment.ts", + "match": "=" + }, + { + "include": "#string" + } + ] + } + ] + }, + "docblock": { + "patterns": [ + { + "match": "(?x)\n((@)(?:access|api))\n\\s+\n(private|protected|public)\n\\b", + "captures": { + "1": { + "name": "storage.type.class.jsdoc" + }, + "2": { + "name": "punctuation.definition.block.tag.jsdoc" + }, + "3": { + "name": "constant.language.access-type.jsdoc" + } + } + }, + { + "match": "(?x)\n((@)author)\n\\s+\n(\n [^@\\s<>*/]\n (?:[^@<>*/]|\\*[^/])*\n)\n(?:\n \\s*\n (<)\n ([^>\\s]+)\n (>)\n)?", + "captures": { + "1": { + "name": "storage.type.class.jsdoc" + }, + "2": { + "name": "punctuation.definition.block.tag.jsdoc" + }, + "3": { + "name": "entity.name.type.instance.jsdoc" + }, + "4": { + "name": "punctuation.definition.bracket.angle.begin.jsdoc" + }, + "5": { + "name": "constant.other.email.link.underline.jsdoc" + }, + "6": { + "name": "punctuation.definition.bracket.angle.end.jsdoc" + } + } + }, + { + "match": "(?x)\n((@)borrows) \\s+\n((?:[^@\\s*/]|\\*[^/])+) # <that namepath>\n\\s+ (as) \\s+ # as\n((?:[^@\\s*/]|\\*[^/])+) # <this namepath>", + "captures": { + "1": { + "name": "storage.type.class.jsdoc" + }, + "2": { + "name": "punctuation.definition.block.tag.jsdoc" + }, + "3": { + "name": "entity.name.type.instance.jsdoc" + }, + "4": { + "name": "keyword.operator.control.jsdoc" + }, + "5": { + "name": "entity.name.type.instance.jsdoc" + } + } + }, + { + "name": "meta.example.jsdoc", + "begin": "((@)example)\\s+", + "end": "(?=@|\\*/)", + "beginCaptures": { + "1": { + "name": "storage.type.class.jsdoc" + }, + "2": { + "name": "punctuation.definition.block.tag.jsdoc" + } + }, + "patterns": [ + { + "match": "^\\s\\*\\s+" + }, + { + "contentName": "constant.other.description.jsdoc", + "begin": "\\G(<)caption(>)", + "beginCaptures": { + "0": { + "name": "entity.name.tag.inline.jsdoc" + }, + "1": { + "name": "punctuation.definition.bracket.angle.begin.jsdoc" + }, + "2": { + "name": "punctuation.definition.bracket.angle.end.jsdoc" + } + }, + "end": "(</)caption(>)|(?=\\*/)", + "endCaptures": { + "0": { + "name": "entity.name.tag.inline.jsdoc" + }, + "1": { + "name": "punctuation.definition.bracket.angle.begin.jsdoc" + }, + "2": { + "name": "punctuation.definition.bracket.angle.end.jsdoc" + } + } + }, + { + "match": "[^\\s@*](?:[^*]|\\*[^/])*", + "captures": { + "0": { + "name": "source.embedded.ts" + } + } + } + ] + }, + { + "match": "(?x) ((@)kind) \\s+ (class|constant|event|external|file|function|member|mixin|module|namespace|typedef) \\b", + "captures": { + "1": { + "name": "storage.type.class.jsdoc" + }, + "2": { + "name": "punctuation.definition.block.tag.jsdoc" + }, + "3": { + "name": "constant.language.symbol-type.jsdoc" + } + } + }, + { + "match": "(?x)\n((@)see)\n\\s+\n(?:\n # URL\n (\n (?=https?://)\n (?:[^\\s*]|\\*[^/])+\n )\n |\n # JSDoc namepath\n (\n (?!\n # Avoid matching bare URIs (also acceptable as links)\n https?://\n |\n # Avoid matching {@inline tags}; we match those below\n (?:\\[[^\\[\\]]*\\])? # Possible description [preceding]{@tag}\n {@(?:link|linkcode|linkplain|tutorial)\\b\n )\n # Matched namepath\n (?:[^@\\s*/]|\\*[^/])+\n )\n)", + "captures": { + "1": { + "name": "storage.type.class.jsdoc" + }, + "2": { + "name": "punctuation.definition.block.tag.jsdoc" + }, + "3": { + "name": "variable.other.link.underline.jsdoc" + }, + "4": { + "name": "entity.name.type.instance.jsdoc" + } + } + }, + { + "match": "(?x)\n((@)template)\n\\s+\n# One or more valid identifiers\n(\n [A-Za-z_$] # First character: non-numeric word character\n [\\w$.\\[\\]]* # Rest of identifier\n (?: # Possible list of additional identifiers\n \\s* , \\s*\n [A-Za-z_$]\n [\\w$.\\[\\]]*\n )*\n)", + "captures": { + "1": { + "name": "storage.type.class.jsdoc" + }, + "2": { + "name": "punctuation.definition.block.tag.jsdoc" + }, + "3": { + "name": "variable.other.jsdoc" + } + } + }, + { + "match": "(?x)\n(\n (@)\n (?:arg|argument|const|constant|member|namespace|param|var)\n)\n\\s+\n(\n [A-Za-z_$]\n [\\w$.\\[\\]]*\n)", + "captures": { + "1": { + "name": "storage.type.class.jsdoc" + }, + "2": { + "name": "punctuation.definition.block.tag.jsdoc" + }, + "3": { + "name": "variable.other.jsdoc" + } + } + }, + { + "begin": "((@)typedef)\\s+(?={)", + "beginCaptures": { + "1": { + "name": "storage.type.class.jsdoc" + }, + "2": { + "name": "punctuation.definition.block.tag.jsdoc" + } + }, + "end": "(?=\\s|\\*/|[^{}\\[\\]A-Za-z_$])", + "patterns": [ + { + "include": "#jsdoctype" + }, + { + "name": "entity.name.type.instance.jsdoc", + "match": "(?:[^@\\s*/]|\\*[^/])+" + } + ] + }, + { + "begin": "((@)(?:arg|argument|const|constant|member|namespace|param|prop|property|var))\\s+(?={)", + "beginCaptures": { + "1": { + "name": "storage.type.class.jsdoc" + }, + "2": { + "name": "punctuation.definition.block.tag.jsdoc" + } + }, + "end": "(?=\\s|\\*/|[^{}\\[\\]A-Za-z_$])", + "patterns": [ + { + "include": "#jsdoctype" + }, + { + "name": "variable.other.jsdoc", + "match": "([A-Za-z_$][\\w$.\\[\\]]*)" + }, + { + "name": "variable.other.jsdoc", + "match": "(?x)\n(\\[)\\s*\n[\\w$]+\n(?:\n (?:\\[\\])? # Foo[ ].bar properties within an array\n \\. # Foo.Bar namespaced parameter\n [\\w$]+\n)*\n(?:\n \\s*\n (=) # [foo=bar] Default parameter value\n \\s*\n (\n # The inner regexes are to stop the match early at */ and to not stop at escaped quotes\n (?>\n \"(?:(?:\\*(?!/))|(?:\\\\(?!\"))|[^*\\\\])*?\" | # [foo=\"bar\"] Double-quoted\n '(?:(?:\\*(?!/))|(?:\\\\(?!'))|[^*\\\\])*?' | # [foo='bar'] Single-quoted\n \\[ (?:(?:\\*(?!/))|[^*])*? \\] | # [foo=[1,2]] Array literal\n (?:(?:\\*(?!/))|\\s(?!\\s*\\])|\\[.*?(?:\\]|(?=\\*/))|[^*\\s\\[\\]])* # Everything else\n )*\n )\n)?\n\\s*(?:(\\])((?:[^*\\s]|\\*[^\\s/])+)?|(?=\\*/))", + "captures": { + "1": { + "name": "punctuation.definition.optional-value.begin.bracket.square.jsdoc" + }, + "2": { + "name": "keyword.operator.assignment.jsdoc" + }, + "3": { + "name": "source.embedded.ts" + }, + "4": { + "name": "punctuation.definition.optional-value.end.bracket.square.jsdoc" + }, + "5": { + "name": "invalid.illegal.syntax.jsdoc" + } + } + } + ] + }, + { + "begin": "(?x)\n(\n (@)\n (?:define|enum|exception|export|extends|lends|implements|modifies\n |namespace|private|protected|returns?|suppress|this|throws|type\n |yields?)\n)\n\\s+(?={)", + "beginCaptures": { + "1": { + "name": "storage.type.class.jsdoc" + }, + "2": { + "name": "punctuation.definition.block.tag.jsdoc" + } + }, + "end": "(?=\\s|\\*/|[^{}\\[\\]A-Za-z_$])", + "patterns": [ + { + "include": "#jsdoctype" + } + ] + }, + { + "match": "(?x)\n(\n (@)\n (?:alias|augments|callback|constructs|emits|event|fires|exports?\n |extends|external|function|func|host|lends|listens|interface|memberof!?\n |method|module|mixes|mixin|name|requires|see|this|typedef|uses)\n)\n\\s+\n(\n (?:\n [^{}@\\s*] | \\*[^/]\n )+\n)", + "captures": { + "1": { + "name": "storage.type.class.jsdoc" + }, + "2": { + "name": "punctuation.definition.block.tag.jsdoc" + }, + "3": { + "name": "entity.name.type.instance.jsdoc" + } + } + }, + { + "contentName": "variable.other.jsdoc", + "begin": "((@)(?:default(?:value)?|license|version))\\s+(([''\"]))", + "beginCaptures": { + "1": { + "name": "storage.type.class.jsdoc" + }, + "2": { + "name": "punctuation.definition.block.tag.jsdoc" + }, + "3": { + "name": "variable.other.jsdoc" + }, + "4": { + "name": "punctuation.definition.string.begin.jsdoc" + } + }, + "end": "(\\3)|(?=$|\\*/)", + "endCaptures": { + "0": { + "name": "variable.other.jsdoc" + }, + "1": { + "name": "punctuation.definition.string.end.jsdoc" + } + } + }, + { + "match": "((@)(?:default(?:value)?|license|tutorial|variation|version))\\s+([^\\s*]+)", + "captures": { + "1": { + "name": "storage.type.class.jsdoc" + }, + "2": { + "name": "punctuation.definition.block.tag.jsdoc" + }, + "3": { + "name": "variable.other.jsdoc" + } + } + }, + { + "name": "storage.type.class.jsdoc", + "match": "(?x) (@) (?:abstract|access|alias|api|arg|argument|async|attribute|augments|author|beta|borrows|bubbles |callback|chainable|class|classdesc|code|config|const|constant|constructor|constructs|copyright |default|defaultvalue|define|deprecated|desc|description|dict|emits|enum|event|example|exception |exports?|extends|extension(?:_?for)?|external|externs|file|fileoverview|final|fires|for|func |function|generator|global|hideconstructor|host|ignore|implements|implicitCast|inherit[Dd]oc |inner|instance|interface|internal|kind|lends|license|listens|main|member|memberof!?|method |mixes|mixins?|modifies|module|name|namespace|noalias|nocollapse|nocompile|nosideeffects |override|overview|package|param|polymer(?:Behavior)?|preserve|private|prop|property|protected |public|read[Oo]nly|record|require[ds]|returns?|see|since|static|struct|submodule|summary |suppress|template|this|throws|todo|tutorial|type|typedef|unrestricted|uses|var|variation |version|virtual|writeOnce|yields?) \\b", + "captures": { + "1": { + "name": "punctuation.definition.block.tag.jsdoc" + } + } + }, + { + "include": "#inline-tags" + }, + { + "match": "((@)(?:[_$[:alpha:]][_$[:alnum:]]*))(?=\\s+)", + "captures": { + "1": { + "name": "storage.type.class.jsdoc" + }, + "2": { + "name": "punctuation.definition.block.tag.jsdoc" + } + } + } + ] + }, + "brackets": { + "patterns": [ + { + "begin": "{", + "end": "}|(?=\\*/)", + "patterns": [ + { + "include": "#brackets" + } + ] + }, + { + "begin": "\\[", + "end": "\\]|(?=\\*/)", + "patterns": [ + { + "include": "#brackets" + } + ] + } + ] + }, + "inline-tags": { + "patterns": [ + { + "name": "constant.other.description.jsdoc", + "match": "(\\[)[^\\]]+(\\])(?={@(?:link|linkcode|linkplain|tutorial))", + "captures": { + "1": { + "name": "punctuation.definition.bracket.square.begin.jsdoc" + }, + "2": { + "name": "punctuation.definition.bracket.square.end.jsdoc" + } + } + }, + { + "name": "entity.name.type.instance.jsdoc", + "begin": "({)((@)(?:link(?:code|plain)?|tutorial))\\s*", + "beginCaptures": { + "1": { + "name": "punctuation.definition.bracket.curly.begin.jsdoc" + }, + "2": { + "name": "storage.type.class.jsdoc" + }, + "3": { + "name": "punctuation.definition.inline.tag.jsdoc" + } + }, + "end": "}|(?=\\*/)", + "endCaptures": { + "0": { + "name": "punctuation.definition.bracket.curly.end.jsdoc" + } + }, + "patterns": [ + { + "match": "\\G((?=https?://)(?:[^|}\\s*]|\\*[/])+)(\\|)?", + "captures": { + "1": { + "name": "variable.other.link.underline.jsdoc" + }, + "2": { + "name": "punctuation.separator.pipe.jsdoc" + } + } + }, + { + "match": "\\G((?:[^{}@\\s|*]|\\*[^/])+)(\\|)?", + "captures": { + "1": { + "name": "variable.other.description.jsdoc" + }, + "2": { + "name": "punctuation.separator.pipe.jsdoc" + } + } + } + ] + } + ] + }, + "jsdoctype": { + "patterns": [ + { + "contentName": "entity.name.type.instance.jsdoc", + "begin": "\\G({)", + "beginCaptures": { + "0": { + "name": "entity.name.type.instance.jsdoc" + }, + "1": { + "name": "punctuation.definition.bracket.curly.begin.jsdoc" + } + }, + "end": "((}))\\s*|(?=\\*/)", + "endCaptures": { + "1": { + "name": "entity.name.type.instance.jsdoc" + }, + "2": { + "name": "punctuation.definition.bracket.curly.end.jsdoc" + } + }, + "patterns": [ + { + "include": "#brackets" + } + ] + } + ] + } + } +} diff --git a/data/source.tsx.json b/data/source.tsx.json new file mode 100644 index 0000000..c4fa7a3 --- /dev/null +++ b/data/source.tsx.json @@ -0,0 +1,5661 @@ +{ + "information_for_contributors": [ + "This file has been converted from https://github.com/Microsoft/TypeScript-TmLanguage/blob/master/TypeScriptReact.tmLanguage", + "If you want to provide a fix or improvement, please create a pull request against the original repository.", + "Once accepted there, we are happy to receive an update request." + ], + "version": "https://github.com/Microsoft/TypeScript-TmLanguage/commit/4daff7b8904bc549dfbee8df1e2f7c82194b9f45", + "name": "TypeScriptReact", + "fileTypes": [ + "tsx" + ], + "scopeName": "source.tsx", + "patterns": [ + { + "include": "#directives" + }, + { + "include": "#statements" + }, + { + "name": "comment.line.shebang.ts", + "match": "\\A(#!).*(?=$)", + "captures": { + "1": { + "name": "punctuation.definition.comment.ts" + } + } + } + ], + "repository": { + "statements": { + "patterns": [ + { + "include": "#string" + }, + { + "include": "#comment" + }, + { + "include": "#declaration" + }, + { + "include": "#control-statement" + }, + { + "include": "#after-operator-block-as-object-literal" + }, + { + "include": "#decl-block" + }, + { + "include": "#label" + }, + { + "include": "#expression" + }, + { + "include": "#punctuation-semicolon" + } + ] + }, + "declaration": { + "patterns": [ + { + "include": "#decorator" + }, + { + "include": "#var-expr" + }, + { + "include": "#function-declaration" + }, + { + "include": "#class-declaration" + }, + { + "include": "#interface-declaration" + }, + { + "include": "#enum-declaration" + }, + { + "include": "#namespace-declaration" + }, + { + "include": "#type-alias-declaration" + }, + { + "include": "#import-equals-declaration" + }, + { + "include": "#import-declaration" + }, + { + "include": "#export-declaration" + }, + { + "name": "storage.modifier.tsx", + "match": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(declare|export)(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))" + } + ] + }, + "control-statement": { + "patterns": [ + { + "include": "#switch-statement" + }, + { + "include": "#for-loop" + }, + { + "name": "keyword.control.trycatch.tsx", + "match": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(catch|finally|throw|try)(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))" + }, + { + "match": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(break|continue|goto)\\s+([_$[:alpha:]][_$[:alnum:]]*)(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))", + "captures": { + "1": { + "name": "keyword.control.loop.tsx" + }, + "2": { + "name": "entity.name.label.tsx" + } + } + }, + { + "name": "keyword.control.loop.tsx", + "match": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(break|continue|do|goto|while)(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))" + }, + { + "name": "keyword.control.flow.tsx", + "match": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(return)(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))" + }, + { + "name": "keyword.control.switch.tsx", + "match": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(case|default|switch)(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))" + }, + { + "include": "#if-statement" + }, + { + "name": "keyword.control.conditional.tsx", + "match": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(else|if)(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))" + }, + { + "name": "keyword.control.with.tsx", + "match": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(with)(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))" + }, + { + "name": "keyword.control.tsx", + "match": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(package)(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))" + }, + { + "name": "keyword.other.debugger.tsx", + "match": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(debugger)(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))" + } + ] + }, + "label": { + "patterns": [ + { + "begin": "([_$[:alpha:]][_$[:alnum:]]*)\\s*(:)(?=\\s*\\{)", + "beginCaptures": { + "1": { + "name": "entity.name.label.tsx" + }, + "2": { + "name": "punctuation.separator.label.tsx" + } + }, + "end": "(?<=\\})", + "patterns": [ + { + "include": "#decl-block" + } + ] + }, + { + "match": "([_$[:alpha:]][_$[:alnum:]]*)\\s*(:)", + "captures": { + "1": { + "name": "entity.name.label.tsx" + }, + "2": { + "name": "punctuation.separator.label.tsx" + } + } + } + ] + }, + "expression": { + "patterns": [ + { + "include": "#expressionWithoutIdentifiers" + }, + { + "include": "#identifiers" + }, + { + "include": "#expressionPunctuations" + } + ] + }, + "expressionWithoutIdentifiers": { + "patterns": [ + { + "include": "#jsx" + }, + { + "include": "#string" + }, + { + "include": "#regex" + }, + { + "include": "#comment" + }, + { + "include": "#function-expression" + }, + { + "include": "#class-expression" + }, + { + "include": "#arrow-function" + }, + { + "include": "#paren-expression-possibly-arrow" + }, + { + "include": "#cast" + }, + { + "include": "#ternary-expression" + }, + { + "include": "#new-expr" + }, + { + "include": "#instanceof-expr" + }, + { + "include": "#object-literal" + }, + { + "include": "#expression-operators" + }, + { + "include": "#function-call" + }, + { + "include": "#literal" + }, + { + "include": "#support-objects" + }, + { + "include": "#paren-expression" + } + ] + }, + "expressionPunctuations": { + "patterns": [ + { + "include": "#punctuation-comma" + }, + { + "include": "#punctuation-accessor" + } + ] + }, + "decorator": { + "name": "meta.decorator.tsx", + "begin": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))\\@", + "beginCaptures": { + "0": { + "name": "punctuation.decorator.tsx" + } + }, + "end": "(?=\\s)", + "patterns": [ + { + "include": "#expression" + } + ] + }, + "var-expr": { + "patterns": [ + { + "name": "meta.var.expr.tsx", + "begin": "(?=(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(?:(\\bexport)\\s+)?(?:(\\bdeclare)\\s+)?\\b(var|let)(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.)))", + "end": "(?!(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(?:(\\bexport)\\s+)?(?:(\\bdeclare)\\s+)?\\b(var|let)(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.)))((?=;|}|((?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(of|in)\\s+)|^\\s*$|;|(?:^\\s*(?:abstract|async|class|const|declare|enum|export|function|import|interface|let|module|namespace|return|type|var)\\b))|((?<!^let|[^\\._$[:alnum:]]let|^var|[^\\._$[:alnum:]]var)(?=\\s*$)))", + "patterns": [ + { + "begin": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(?:(\\bexport)\\s+)?(?:(\\bdeclare)\\s+)?\\b(var|let)(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))\\s*", + "beginCaptures": { + "1": { + "name": "keyword.control.export.tsx" + }, + "2": { + "name": "storage.modifier.tsx" + }, + "3": { + "name": "storage.type.tsx" + } + }, + "end": "(?=\\S)" + }, + { + "include": "#destructuring-variable" + }, + { + "include": "#var-single-variable" + }, + { + "include": "#variable-initializer" + }, + { + "include": "#comment" + }, + { + "begin": "(,)\\s*((?!\\S)|(?=\\/\\/))", + "beginCaptures": { + "1": { + "name": "punctuation.separator.comma.tsx" + } + }, + "end": "(?<!,)(((?==|;|}|((?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(of|in)\\s+)|^\\s*$))|((?<=\\S)(?=\\s*$)))", + "patterns": [ + { + "include": "#single-line-comment-consuming-line-ending" + }, + { + "include": "#comment" + }, + { + "include": "#destructuring-variable" + }, + { + "include": "#var-single-variable" + }, + { + "include": "#punctuation-comma" + } + ] + }, + { + "include": "#punctuation-comma" + } + ] + }, + { + "name": "meta.var.expr.tsx", + "begin": "(?=(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(?:(\\bexport)\\s+)?(?:(\\bdeclare)\\s+)?\\b(const(?!\\s+enum\\b))(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.)))", + "beginCaptures": { + "1": { + "name": "keyword.control.export.tsx" + }, + "2": { + "name": "storage.modifier.tsx" + }, + "3": { + "name": "storage.type.tsx" + } + }, + "end": "(?!(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(?:(\\bexport)\\s+)?(?:(\\bdeclare)\\s+)?\\b(const(?!\\s+enum\\b))(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.)))((?=;|}|((?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(of|in)\\s+)|^\\s*$|;|(?:^\\s*(?:abstract|async|class|const|declare|enum|export|function|import|interface|let|module|namespace|return|type|var)\\b))|((?<!^const|[^\\._$[:alnum:]]const)(?=\\s*$)))", + "patterns": [ + { + "begin": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(?:(\\bexport)\\s+)?(?:(\\bdeclare)\\s+)?\\b(const(?!\\s+enum\\b))(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))\\s*", + "beginCaptures": { + "1": { + "name": "keyword.control.export.tsx" + }, + "2": { + "name": "storage.modifier.tsx" + }, + "3": { + "name": "storage.type.tsx" + } + }, + "end": "(?=\\S)" + }, + { + "include": "#destructuring-const" + }, + { + "include": "#var-single-const" + }, + { + "include": "#variable-initializer" + }, + { + "include": "#comment" + }, + { + "begin": "(,)\\s*((?!\\S)|(?=\\/\\/))", + "beginCaptures": { + "1": { + "name": "punctuation.separator.comma.tsx" + } + }, + "end": "(?<!,)(((?==|;|}|((?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(of|in)\\s+)|^\\s*$))|((?<=\\S)(?=\\s*$)))", + "patterns": [ + { + "include": "#single-line-comment-consuming-line-ending" + }, + { + "include": "#comment" + }, + { + "include": "#destructuring-const" + }, + { + "include": "#var-single-const" + }, + { + "include": "#punctuation-comma" + } + ] + }, + { + "include": "#punctuation-comma" + } + ] + } + ] + }, + "var-single-variable": { + "patterns": [ + { + "name": "meta.var-single-variable.expr.tsx", + "begin": "(?x)([_$[:alpha:]][_$[:alnum:]]*)(\\!)?(?=\\s*\n# function assignment |\n(=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)) |\n# typeannotation is fn type: < | () | (... | (param: | (param, | (param? | (param= | (param) =>\n(:\\s*(\n (<) |\n ([(]\\s*(\n ([)]) |\n (\\.\\.\\.) |\n ([_$[:alnum:]]+\\s*(\n ([:,?=])|\n ([)]\\s*=>)\n ))\n ))\n)) |\n(:\\s*(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))Function(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))) |\n(:\\s*((<\\s*$)|([\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*))))))) |\n(:\\s*(=>|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(<[^<>]*>)|[^<>(),=])+=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)))", + "beginCaptures": { + "1": { + "name": "meta.definition.variable.tsx entity.name.function.tsx" + }, + "2": { + "name": "keyword.operator.definiteassignment.tsx" + } + }, + "end": "(?=$|^|[;,=}]|((?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(of|in)\\s+))", + "patterns": [ + { + "include": "#var-single-variable-type-annotation" + } + ] + }, + { + "name": "meta.var-single-variable.expr.tsx", + "begin": "([[:upper:]][_$[:digit:][:upper:]]*)(?![_$[:alnum:]])(\\!)?", + "beginCaptures": { + "1": { + "name": "meta.definition.variable.tsx variable.other.constant.tsx" + }, + "2": { + "name": "keyword.operator.definiteassignment.tsx" + } + }, + "end": "(?=$|^|[;,=}]|((?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(of|in)\\s+))", + "patterns": [ + { + "include": "#var-single-variable-type-annotation" + } + ] + }, + { + "name": "meta.var-single-variable.expr.tsx", + "begin": "([_$[:alpha:]][_$[:alnum:]]*)(\\!)?", + "beginCaptures": { + "1": { + "name": "meta.definition.variable.tsx variable.other.readwrite.tsx" + }, + "2": { + "name": "keyword.operator.definiteassignment.tsx" + } + }, + "end": "(?=$|^|[;,=}]|((?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(of|in)\\s+))", + "patterns": [ + { + "include": "#var-single-variable-type-annotation" + } + ] + } + ] + }, + "var-single-const": { + "patterns": [ + { + "name": "meta.var-single-variable.expr.tsx", + "begin": "(?x)([_$[:alpha:]][_$[:alnum:]]*)(?=\\s*\n# function assignment |\n(=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)) |\n# typeannotation is fn type: < | () | (... | (param: | (param, | (param? | (param= | (param) =>\n(:\\s*(\n (<) |\n ([(]\\s*(\n ([)]) |\n (\\.\\.\\.) |\n ([_$[:alnum:]]+\\s*(\n ([:,?=])|\n ([)]\\s*=>)\n ))\n ))\n)) |\n(:\\s*(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))Function(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))) |\n(:\\s*((<\\s*$)|([\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*))))))) |\n(:\\s*(=>|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(<[^<>]*>)|[^<>(),=])+=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)))", + "beginCaptures": { + "1": { + "name": "meta.definition.variable.tsx variable.other.constant.tsx entity.name.function.tsx" + } + }, + "end": "(?=$|^|[;,=}]|((?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(of|in)\\s+))", + "patterns": [ + { + "include": "#var-single-variable-type-annotation" + } + ] + }, + { + "name": "meta.var-single-variable.expr.tsx", + "begin": "([_$[:alpha:]][_$[:alnum:]]*)", + "beginCaptures": { + "1": { + "name": "meta.definition.variable.tsx variable.other.constant.tsx" + } + }, + "end": "(?=$|^|[;,=}]|((?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(of|in)\\s+))", + "patterns": [ + { + "include": "#var-single-variable-type-annotation" + } + ] + } + ] + }, + "var-single-variable-type-annotation": { + "patterns": [ + { + "include": "#type-annotation" + }, + { + "include": "#string" + }, + { + "include": "#comment" + } + ] + }, + "destructuring-variable": { + "patterns": [ + { + "name": "meta.object-binding-pattern-variable.tsx", + "begin": "(?<!=|:|^of|[^\\._$[:alnum:]]of|^in|[^\\._$[:alnum:]]in)\\s*(?=\\{)", + "end": "(?=$|^|[;,=}]|((?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(of|in)\\s+))", + "patterns": [ + { + "include": "#object-binding-pattern" + }, + { + "include": "#type-annotation" + }, + { + "include": "#comment" + } + ] + }, + { + "name": "meta.array-binding-pattern-variable.tsx", + "begin": "(?<!=|:|^of|[^\\._$[:alnum:]]of|^in|[^\\._$[:alnum:]]in)\\s*(?=\\[)", + "end": "(?=$|^|[;,=}]|((?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(of|in)\\s+))", + "patterns": [ + { + "include": "#array-binding-pattern" + }, + { + "include": "#type-annotation" + }, + { + "include": "#comment" + } + ] + } + ] + }, + "destructuring-const": { + "patterns": [ + { + "name": "meta.object-binding-pattern-variable.tsx", + "begin": "(?<!=|:|^of|[^\\._$[:alnum:]]of|^in|[^\\._$[:alnum:]]in)\\s*(?=\\{)", + "end": "(?=$|^|[;,=}]|((?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(of|in)\\s+))", + "patterns": [ + { + "include": "#object-binding-pattern-const" + }, + { + "include": "#type-annotation" + }, + { + "include": "#comment" + } + ] + }, + { + "name": "meta.array-binding-pattern-variable.tsx", + "begin": "(?<!=|:|^of|[^\\._$[:alnum:]]of|^in|[^\\._$[:alnum:]]in)\\s*(?=\\[)", + "end": "(?=$|^|[;,=}]|((?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(of|in)\\s+))", + "patterns": [ + { + "include": "#array-binding-pattern-const" + }, + { + "include": "#type-annotation" + }, + { + "include": "#comment" + } + ] + } + ] + }, + "object-binding-element": { + "patterns": [ + { + "include": "#comment" + }, + { + "begin": "(?x)(?=((\\b(?<!\\$)0(?:x|X)[0-9a-fA-F][0-9a-fA-F_]*(n)?\\b(?!\\$))|(\\b(?<!\\$)0(?:b|B)[01][01_]*(n)?\\b(?!\\$))|(\\b(?<!\\$)0(?:o|O)?[0-7][0-7_]*(n)?\\b(?!\\$))|((?<!\\$)(?:\n (?:\\b[0-9][0-9_]*(\\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\\b)| # 1.1E+3\n (?:\\b[0-9][0-9_]*(\\.)[eE][+-]?[0-9][0-9_]*(n)?\\b)| # 1.E+3\n (?:\\B(\\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\\b)| # .1E+3\n (?:\\b[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\\b)| # 1E+3\n (?:\\b[0-9][0-9_]*(\\.)[0-9][0-9_]*(n)?\\b)| # 1.1\n (?:\\b[0-9][0-9_]*(\\.)(n)?\\B)| # 1.\n (?:\\B(\\.)[0-9][0-9_]*(n)?\\b)| # .1\n (?:\\b[0-9][0-9_]*(n)?\\b(?!\\.)) # 1\n)(?!\\$))|([_$[:alpha:]][_$[:alnum:]]*)|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`)|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])+\\]))\\s*(:))", + "end": "(?=,|\\})", + "patterns": [ + { + "include": "#object-binding-element-propertyName" + }, + { + "include": "#binding-element" + } + ] + }, + { + "include": "#object-binding-pattern" + }, + { + "include": "#destructuring-variable-rest" + }, + { + "include": "#variable-initializer" + }, + { + "include": "#punctuation-comma" + } + ] + }, + "object-binding-element-const": { + "patterns": [ + { + "include": "#comment" + }, + { + "begin": "(?x)(?=((\\b(?<!\\$)0(?:x|X)[0-9a-fA-F][0-9a-fA-F_]*(n)?\\b(?!\\$))|(\\b(?<!\\$)0(?:b|B)[01][01_]*(n)?\\b(?!\\$))|(\\b(?<!\\$)0(?:o|O)?[0-7][0-7_]*(n)?\\b(?!\\$))|((?<!\\$)(?:\n (?:\\b[0-9][0-9_]*(\\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\\b)| # 1.1E+3\n (?:\\b[0-9][0-9_]*(\\.)[eE][+-]?[0-9][0-9_]*(n)?\\b)| # 1.E+3\n (?:\\B(\\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\\b)| # .1E+3\n (?:\\b[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\\b)| # 1E+3\n (?:\\b[0-9][0-9_]*(\\.)[0-9][0-9_]*(n)?\\b)| # 1.1\n (?:\\b[0-9][0-9_]*(\\.)(n)?\\B)| # 1.\n (?:\\B(\\.)[0-9][0-9_]*(n)?\\b)| # .1\n (?:\\b[0-9][0-9_]*(n)?\\b(?!\\.)) # 1\n)(?!\\$))|([_$[:alpha:]][_$[:alnum:]]*)|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`)|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])+\\]))\\s*(:))", + "end": "(?=,|\\})", + "patterns": [ + { + "include": "#object-binding-element-propertyName" + }, + { + "include": "#binding-element-const" + } + ] + }, + { + "include": "#object-binding-pattern-const" + }, + { + "include": "#destructuring-variable-rest-const" + }, + { + "include": "#variable-initializer" + }, + { + "include": "#punctuation-comma" + } + ] + }, + "object-binding-element-propertyName": { + "begin": "(?x)(?=((\\b(?<!\\$)0(?:x|X)[0-9a-fA-F][0-9a-fA-F_]*(n)?\\b(?!\\$))|(\\b(?<!\\$)0(?:b|B)[01][01_]*(n)?\\b(?!\\$))|(\\b(?<!\\$)0(?:o|O)?[0-7][0-7_]*(n)?\\b(?!\\$))|((?<!\\$)(?:\n (?:\\b[0-9][0-9_]*(\\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\\b)| # 1.1E+3\n (?:\\b[0-9][0-9_]*(\\.)[eE][+-]?[0-9][0-9_]*(n)?\\b)| # 1.E+3\n (?:\\B(\\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\\b)| # .1E+3\n (?:\\b[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\\b)| # 1E+3\n (?:\\b[0-9][0-9_]*(\\.)[0-9][0-9_]*(n)?\\b)| # 1.1\n (?:\\b[0-9][0-9_]*(\\.)(n)?\\B)| # 1.\n (?:\\B(\\.)[0-9][0-9_]*(n)?\\b)| # .1\n (?:\\b[0-9][0-9_]*(n)?\\b(?!\\.)) # 1\n)(?!\\$))|([_$[:alpha:]][_$[:alnum:]]*)|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`)|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])+\\]))\\s*(:))", + "end": "(:)", + "endCaptures": { + "0": { + "name": "punctuation.destructuring.tsx" + } + }, + "patterns": [ + { + "include": "#string" + }, + { + "include": "#array-literal" + }, + { + "include": "#numeric-literal" + }, + { + "name": "variable.object.property.tsx", + "match": "([_$[:alpha:]][_$[:alnum:]]*)" + } + ] + }, + "binding-element": { + "patterns": [ + { + "include": "#comment" + }, + { + "include": "#string" + }, + { + "include": "#numeric-literal" + }, + { + "include": "#regex" + }, + { + "include": "#object-binding-pattern" + }, + { + "include": "#array-binding-pattern" + }, + { + "include": "#destructuring-variable-rest" + }, + { + "include": "#variable-initializer" + } + ] + }, + "binding-element-const": { + "patterns": [ + { + "include": "#comment" + }, + { + "include": "#string" + }, + { + "include": "#numeric-literal" + }, + { + "include": "#regex" + }, + { + "include": "#object-binding-pattern-const" + }, + { + "include": "#array-binding-pattern-const" + }, + { + "include": "#destructuring-variable-rest-const" + }, + { + "include": "#variable-initializer" + } + ] + }, + "destructuring-variable-rest": { + "match": "(?:(\\.\\.\\.)\\s*)?([_$[:alpha:]][_$[:alnum:]]*)", + "captures": { + "1": { + "name": "keyword.operator.rest.tsx" + }, + "2": { + "name": "meta.definition.variable.tsx variable.other.readwrite.tsx" + } + } + }, + "destructuring-variable-rest-const": { + "match": "(?:(\\.\\.\\.)\\s*)?([_$[:alpha:]][_$[:alnum:]]*)", + "captures": { + "1": { + "name": "keyword.operator.rest.tsx" + }, + "2": { + "name": "meta.definition.variable.tsx variable.other.constant.tsx" + } + } + }, + "object-binding-pattern": { + "begin": "(?:(\\.\\.\\.)\\s*)?(\\{)", + "beginCaptures": { + "1": { + "name": "keyword.operator.rest.tsx" + }, + "2": { + "name": "punctuation.definition.binding-pattern.object.tsx" + } + }, + "end": "\\}", + "endCaptures": { + "0": { + "name": "punctuation.definition.binding-pattern.object.tsx" + } + }, + "patterns": [ + { + "include": "#object-binding-element" + } + ] + }, + "object-binding-pattern-const": { + "begin": "(?:(\\.\\.\\.)\\s*)?(\\{)", + "beginCaptures": { + "1": { + "name": "keyword.operator.rest.tsx" + }, + "2": { + "name": "punctuation.definition.binding-pattern.object.tsx" + } + }, + "end": "\\}", + "endCaptures": { + "0": { + "name": "punctuation.definition.binding-pattern.object.tsx" + } + }, + "patterns": [ + { + "include": "#object-binding-element-const" + } + ] + }, + "array-binding-pattern": { + "begin": "(?:(\\.\\.\\.)\\s*)?(\\[)", + "beginCaptures": { + "1": { + "name": "keyword.operator.rest.tsx" + }, + "2": { + "name": "punctuation.definition.binding-pattern.array.tsx" + } + }, + "end": "\\]", + "endCaptures": { + "0": { + "name": "punctuation.definition.binding-pattern.array.tsx" + } + }, + "patterns": [ + { + "include": "#binding-element" + }, + { + "include": "#punctuation-comma" + } + ] + }, + "array-binding-pattern-const": { + "begin": "(?:(\\.\\.\\.)\\s*)?(\\[)", + "beginCaptures": { + "1": { + "name": "keyword.operator.rest.tsx" + }, + "2": { + "name": "punctuation.definition.binding-pattern.array.tsx" + } + }, + "end": "\\]", + "endCaptures": { + "0": { + "name": "punctuation.definition.binding-pattern.array.tsx" + } + }, + "patterns": [ + { + "include": "#binding-element-const" + }, + { + "include": "#punctuation-comma" + } + ] + }, + "parameter-name": { + "patterns": [ + { + "match": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(public|protected|private|readonly)\\s+(?=(public|protected|private|readonly)\\s+)", + "captures": { + "1": { + "name": "storage.modifier.tsx" + } + } + }, + { + "match": "(?x)(?:(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(public|private|protected|readonly)\\s+)?(?:(\\.\\.\\.)\\s*)?(?<!=|:)(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(?:(this)|([_$[:alpha:]][_$[:alnum:]]*))(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))\\s*(\\??)(?=\\s*\n# function assignment |\n(=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)) |\n# typeannotation is fn type: < | () | (... | (param: | (param, | (param? | (param= | (param) =>\n(:\\s*(\n (<) |\n ([(]\\s*(\n ([)]) |\n (\\.\\.\\.) |\n ([_$[:alnum:]]+\\s*(\n ([:,?=])|\n ([)]\\s*=>)\n ))\n ))\n)) |\n(:\\s*(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))Function(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))) |\n(:\\s*((<\\s*$)|([\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*))))))) |\n(:\\s*(=>|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(<[^<>]*>)|[^<>(),=])+=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)))", + "captures": { + "1": { + "name": "storage.modifier.tsx" + }, + "2": { + "name": "keyword.operator.rest.tsx" + }, + "3": { + "name": "entity.name.function.tsx variable.language.this.tsx" + }, + "4": { + "name": "entity.name.function.tsx" + }, + "5": { + "name": "keyword.operator.optional.tsx" + } + } + }, + { + "match": "(?x)(?:(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(public|private|protected|readonly)\\s+)?(?:(\\.\\.\\.)\\s*)?(?<!=|:)(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(?:(this)|([_$[:alpha:]][_$[:alnum:]]*))(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))\\s*(\\??)", + "captures": { + "1": { + "name": "storage.modifier.tsx" + }, + "2": { + "name": "keyword.operator.rest.tsx" + }, + "3": { + "name": "variable.parameter.tsx variable.language.this.tsx" + }, + "4": { + "name": "variable.parameter.tsx" + }, + "5": { + "name": "keyword.operator.optional.tsx" + } + } + } + ] + }, + "destructuring-parameter": { + "patterns": [ + { + "name": "meta.parameter.object-binding-pattern.tsx", + "begin": "(?<!=|:)\\s*(?:(\\.\\.\\.)\\s*)?(\\{)", + "beginCaptures": { + "1": { + "name": "keyword.operator.rest.tsx" + }, + "2": { + "name": "punctuation.definition.binding-pattern.object.tsx" + } + }, + "end": "\\}", + "endCaptures": { + "0": { + "name": "punctuation.definition.binding-pattern.object.tsx" + } + }, + "patterns": [ + { + "include": "#parameter-object-binding-element" + } + ] + }, + { + "name": "meta.paramter.array-binding-pattern.tsx", + "begin": "(?<!=|:)\\s*(?:(\\.\\.\\.)\\s*)?(\\[)", + "beginCaptures": { + "1": { + "name": "keyword.operator.rest.tsx" + }, + "2": { + "name": "punctuation.definition.binding-pattern.array.tsx" + } + }, + "end": "\\]", + "endCaptures": { + "0": { + "name": "punctuation.definition.binding-pattern.array.tsx" + } + }, + "patterns": [ + { + "include": "#parameter-binding-element" + }, + { + "include": "#punctuation-comma" + } + ] + } + ] + }, + "parameter-object-binding-element": { + "patterns": [ + { + "include": "#comment" + }, + { + "begin": "(?x)(?=((\\b(?<!\\$)0(?:x|X)[0-9a-fA-F][0-9a-fA-F_]*(n)?\\b(?!\\$))|(\\b(?<!\\$)0(?:b|B)[01][01_]*(n)?\\b(?!\\$))|(\\b(?<!\\$)0(?:o|O)?[0-7][0-7_]*(n)?\\b(?!\\$))|((?<!\\$)(?:\n (?:\\b[0-9][0-9_]*(\\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\\b)| # 1.1E+3\n (?:\\b[0-9][0-9_]*(\\.)[eE][+-]?[0-9][0-9_]*(n)?\\b)| # 1.E+3\n (?:\\B(\\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\\b)| # .1E+3\n (?:\\b[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\\b)| # 1E+3\n (?:\\b[0-9][0-9_]*(\\.)[0-9][0-9_]*(n)?\\b)| # 1.1\n (?:\\b[0-9][0-9_]*(\\.)(n)?\\B)| # 1.\n (?:\\B(\\.)[0-9][0-9_]*(n)?\\b)| # .1\n (?:\\b[0-9][0-9_]*(n)?\\b(?!\\.)) # 1\n)(?!\\$))|([_$[:alpha:]][_$[:alnum:]]*)|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`)|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])+\\]))\\s*(:))", + "end": "(?=,|\\})", + "patterns": [ + { + "include": "#object-binding-element-propertyName" + }, + { + "include": "#parameter-binding-element" + } + ] + }, + { + "include": "#parameter-object-binding-pattern" + }, + { + "include": "#destructuring-parameter-rest" + }, + { + "include": "#variable-initializer" + }, + { + "include": "#punctuation-comma" + } + ] + }, + "parameter-binding-element": { + "patterns": [ + { + "include": "#comment" + }, + { + "include": "#string" + }, + { + "include": "#numeric-literal" + }, + { + "include": "#regex" + }, + { + "include": "#parameter-object-binding-pattern" + }, + { + "include": "#parameter-array-binding-pattern" + }, + { + "include": "#destructuring-parameter-rest" + }, + { + "include": "#variable-initializer" + } + ] + }, + "destructuring-parameter-rest": { + "match": "(?:(\\.\\.\\.)\\s*)?([_$[:alpha:]][_$[:alnum:]]*)", + "captures": { + "1": { + "name": "keyword.operator.rest.tsx" + }, + "2": { + "name": "variable.parameter.tsx" + } + } + }, + "parameter-object-binding-pattern": { + "begin": "(?:(\\.\\.\\.)\\s*)?(\\{)", + "beginCaptures": { + "1": { + "name": "keyword.operator.rest.tsx" + }, + "2": { + "name": "punctuation.definition.binding-pattern.object.tsx" + } + }, + "end": "\\}", + "endCaptures": { + "0": { + "name": "punctuation.definition.binding-pattern.object.tsx" + } + }, + "patterns": [ + { + "include": "#parameter-object-binding-element" + } + ] + }, + "parameter-array-binding-pattern": { + "begin": "(?:(\\.\\.\\.)\\s*)?(\\[)", + "beginCaptures": { + "1": { + "name": "keyword.operator.rest.tsx" + }, + "2": { + "name": "punctuation.definition.binding-pattern.array.tsx" + } + }, + "end": "\\]", + "endCaptures": { + "0": { + "name": "punctuation.definition.binding-pattern.array.tsx" + } + }, + "patterns": [ + { + "include": "#parameter-binding-element" + }, + { + "include": "#punctuation-comma" + } + ] + }, + "field-declaration": { + "name": "meta.field.declaration.tsx", + "begin": "(?x)(?<!\\()(?:(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(readonly)\\s+)?(?=\\s*((\\b(?<!\\$)0(?:x|X)[0-9a-fA-F][0-9a-fA-F_]*(n)?\\b(?!\\$))|(\\b(?<!\\$)0(?:b|B)[01][01_]*(n)?\\b(?!\\$))|(\\b(?<!\\$)0(?:o|O)?[0-7][0-7_]*(n)?\\b(?!\\$))|((?<!\\$)(?:\n (?:\\b[0-9][0-9_]*(\\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\\b)| # 1.1E+3\n (?:\\b[0-9][0-9_]*(\\.)[eE][+-]?[0-9][0-9_]*(n)?\\b)| # 1.E+3\n (?:\\B(\\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\\b)| # .1E+3\n (?:\\b[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\\b)| # 1E+3\n (?:\\b[0-9][0-9_]*(\\.)[0-9][0-9_]*(n)?\\b)| # 1.1\n (?:\\b[0-9][0-9_]*(\\.)(n)?\\B)| # 1.\n (?:\\B(\\.)[0-9][0-9_]*(n)?\\b)| # .1\n (?:\\b[0-9][0-9_]*(n)?\\b(?!\\.)) # 1\n)(?!\\$))|([_$[:alpha:]][_$[:alnum:]]*)|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`)|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])+\\]))\\s*(?:(?:(\\?)|(\\!))\\s*)?(=|:|;|,|\\}|$))", + "beginCaptures": { + "1": { + "name": "storage.modifier.tsx" + } + }, + "end": "(?x)(?=\\}|;|,|$|(^(?!\\s*((\\b(?<!\\$)0(?:x|X)[0-9a-fA-F][0-9a-fA-F_]*(n)?\\b(?!\\$))|(\\b(?<!\\$)0(?:b|B)[01][01_]*(n)?\\b(?!\\$))|(\\b(?<!\\$)0(?:o|O)?[0-7][0-7_]*(n)?\\b(?!\\$))|((?<!\\$)(?:\n (?:\\b[0-9][0-9_]*(\\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\\b)| # 1.1E+3\n (?:\\b[0-9][0-9_]*(\\.)[eE][+-]?[0-9][0-9_]*(n)?\\b)| # 1.E+3\n (?:\\B(\\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\\b)| # .1E+3\n (?:\\b[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\\b)| # 1E+3\n (?:\\b[0-9][0-9_]*(\\.)[0-9][0-9_]*(n)?\\b)| # 1.1\n (?:\\b[0-9][0-9_]*(\\.)(n)?\\B)| # 1.\n (?:\\B(\\.)[0-9][0-9_]*(n)?\\b)| # .1\n (?:\\b[0-9][0-9_]*(n)?\\b(?!\\.)) # 1\n)(?!\\$))|([_$[:alpha:]][_$[:alnum:]]*)|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`)|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])+\\]))\\s*(?:(?:(\\?)|(\\!))\\s*)?(=|:|;|,|$))))|(?<=\\})", + "patterns": [ + { + "include": "#variable-initializer" + }, + { + "include": "#type-annotation" + }, + { + "include": "#string" + }, + { + "include": "#array-literal" + }, + { + "include": "#numeric-literal" + }, + { + "include": "#comment" + }, + { + "match": "(?x)([_$[:alpha:]][_$[:alnum:]]*)(?:(\\?)|(\\!))?(?=\\s*\\s*\n# function assignment |\n(=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)) |\n# typeannotation is fn type: < | () | (... | (param: | (param, | (param? | (param= | (param) =>\n(:\\s*(\n (<) |\n ([(]\\s*(\n ([)]) |\n (\\.\\.\\.) |\n ([_$[:alnum:]]+\\s*(\n ([:,?=])|\n ([)]\\s*=>)\n ))\n ))\n)) |\n(:\\s*(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))Function(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))) |\n(:\\s*((<\\s*$)|([\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*))))))) |\n(:\\s*(=>|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(<[^<>]*>)|[^<>(),=])+=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)))", + "captures": { + "1": { + "name": "meta.definition.property.tsx entity.name.function.tsx" + }, + "2": { + "name": "keyword.operator.optional.tsx" + }, + "3": { + "name": "keyword.operator.definiteassignment.tsx" + } + } + }, + { + "name": "meta.definition.property.tsx variable.object.property.tsx", + "match": "[_$[:alpha:]][_$[:alnum:]]*" + }, + { + "name": "keyword.operator.optional.tsx", + "match": "\\?" + }, + { + "name": "keyword.operator.definiteassignment.tsx", + "match": "\\!" + } + ] + }, + "variable-initializer": { + "patterns": [ + { + "begin": "(?<!=|!)(=)(?!=)(?=\\s*\\S)(?!\\s*.*=>\\s*$)", + "beginCaptures": { + "1": { + "name": "keyword.operator.assignment.tsx" + } + }, + "end": "(?=$|^|[,);}\\]]|((?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(of|in)\\s+))", + "patterns": [ + { + "include": "#expression" + } + ] + }, + { + "begin": "(?<!=|!)(=)(?!=)", + "beginCaptures": { + "1": { + "name": "keyword.operator.assignment.tsx" + } + }, + "end": "(?=[,);}\\]]|((?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(of|in)\\s+))|(?=^\\s*$)|(?<=\\S)(?<!=)(?=\\s*$)", + "patterns": [ + { + "include": "#expression" + } + ] + } + ] + }, + "function-declaration": { + "name": "meta.function.tsx", + "begin": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(?:(\\bexport)\\s+)?(?:(\\bdeclare)\\s+)?(?:(async)\\s+)?(function\\b)(?:\\s*(\\*))?(?:(?:\\s+|(?<=\\*))([_$[:alpha:]][_$[:alnum:]]*))?\\s*", + "beginCaptures": { + "1": { + "name": "keyword.control.export.tsx" + }, + "2": { + "name": "storage.modifier.tsx" + }, + "3": { + "name": "storage.modifier.async.tsx" + }, + "4": { + "name": "storage.type.function.tsx" + }, + "5": { + "name": "keyword.generator.asterisk.tsx" + }, + "6": { + "name": "meta.definition.function.tsx entity.name.function.tsx" + } + }, + "end": "(?=;|(?:^\\s*(?:abstract|async|class|const|declare|enum|export|function|import|interface|let|module|namespace|return|type|var)\\b))|(?<=\\})", + "patterns": [ + { + "include": "#function-name" + }, + { + "include": "#function-body" + } + ] + }, + "function-expression": { + "name": "meta.function.expression.tsx", + "begin": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(?:(async)\\s+)?(function\\b)(?:\\s*(\\*))?(?:(?:\\s+|(?<=\\*))([_$[:alpha:]][_$[:alnum:]]*))?\\s*", + "beginCaptures": { + "1": { + "name": "storage.modifier.async.tsx" + }, + "2": { + "name": "storage.type.function.tsx" + }, + "3": { + "name": "keyword.generator.asterisk.tsx" + }, + "4": { + "name": "meta.definition.function.tsx entity.name.function.tsx" + } + }, + "end": "(?=;)|(?<=\\})", + "patterns": [ + { + "include": "#function-name" + }, + { + "include": "#single-line-comment-consuming-line-ending" + }, + { + "include": "#function-body" + } + ] + }, + "function-name": { + "name": "meta.definition.function.tsx entity.name.function.tsx", + "match": "[_$[:alpha:]][_$[:alnum:]]*" + }, + "function-body": { + "patterns": [ + { + "include": "#comment" + }, + { + "include": "#type-parameters" + }, + { + "include": "#function-parameters" + }, + { + "include": "#return-type" + }, + { + "include": "#decl-block" + }, + { + "name": "keyword.generator.asterisk.tsx", + "match": "\\*" + } + ] + }, + "method-declaration": { + "patterns": [ + { + "name": "meta.method.declaration.tsx", + "begin": "(?x)(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(?:\\b(public|private|protected)\\s+)?(?:\\b(abstract)\\s+)?(?:\\b(async)\\s+)?\\s*\\b(constructor)\\b(?!:)(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))", + "beginCaptures": { + "1": { + "name": "storage.modifier.tsx" + }, + "2": { + "name": "storage.modifier.tsx" + }, + "3": { + "name": "storage.modifier.async.tsx" + }, + "4": { + "name": "storage.type.tsx" + } + }, + "end": "(?=\\}|;|,|$)|(?<=\\})", + "patterns": [ + { + "include": "#method-declaration-name" + }, + { + "include": "#function-body" + } + ] + }, + { + "name": "meta.method.declaration.tsx", + "begin": "(?x)(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(?:\\b(public|private|protected)\\s+)?(?:\\b(abstract)\\s+)?(?:\\b(async)\\s+)?(?:(?:\\s*\\b(new)\\b(?!:)(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.)))|(?:(\\*)\\s*)?)(?=\\s*((<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*))?[\\(])", + "beginCaptures": { + "1": { + "name": "storage.modifier.tsx" + }, + "2": { + "name": "storage.modifier.tsx" + }, + "3": { + "name": "storage.modifier.async.tsx" + }, + "4": { + "name": "keyword.operator.new.tsx" + }, + "5": { + "name": "keyword.generator.asterisk.tsx" + } + }, + "end": "(?=\\}|;|,|$)|(?<=\\})", + "patterns": [ + { + "include": "#method-declaration-name" + }, + { + "include": "#function-body" + } + ] + }, + { + "name": "meta.method.declaration.tsx", + "begin": "(?x)(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(?:\\b(public|private|protected)\\s+)?(?:\\b(abstract)\\s+)?(?:\\b(async)\\s+)?(?:\\b(get|set)\\s+)?(?:(\\*)\\s*)?(?=\\s*(((\\b(?<!\\$)0(?:x|X)[0-9a-fA-F][0-9a-fA-F_]*(n)?\\b(?!\\$))|(\\b(?<!\\$)0(?:b|B)[01][01_]*(n)?\\b(?!\\$))|(\\b(?<!\\$)0(?:o|O)?[0-7][0-7_]*(n)?\\b(?!\\$))|((?<!\\$)(?:\n (?:\\b[0-9][0-9_]*(\\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\\b)| # 1.1E+3\n (?:\\b[0-9][0-9_]*(\\.)[eE][+-]?[0-9][0-9_]*(n)?\\b)| # 1.E+3\n (?:\\B(\\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\\b)| # .1E+3\n (?:\\b[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\\b)| # 1E+3\n (?:\\b[0-9][0-9_]*(\\.)[0-9][0-9_]*(n)?\\b)| # 1.1\n (?:\\b[0-9][0-9_]*(\\.)(n)?\\B)| # 1.\n (?:\\B(\\.)[0-9][0-9_]*(n)?\\b)| # .1\n (?:\\b[0-9][0-9_]*(n)?\\b(?!\\.)) # 1\n)(?!\\$))|([_$[:alpha:]][_$[:alnum:]]*)|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`)|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])+\\]))\\s*(\\??))\\s*((<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*))?[\\(])", + "beginCaptures": { + "1": { + "name": "storage.modifier.tsx" + }, + "2": { + "name": "storage.modifier.tsx" + }, + "3": { + "name": "storage.modifier.async.tsx" + }, + "4": { + "name": "storage.type.property.tsx" + }, + "5": { + "name": "keyword.generator.asterisk.tsx" + } + }, + "end": "(?=\\}|;|,|$)|(?<=\\})", + "patterns": [ + { + "include": "#method-declaration-name" + }, + { + "include": "#function-body" + } + ] + } + ] + }, + "object-literal-method-declaration": { + "name": "meta.method.declaration.tsx", + "begin": "(?x)(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(?:\\b(async)\\s+)?(?:\\b(get|set)\\s+)?(?:(\\*)\\s*)?(?=\\s*(((\\b(?<!\\$)0(?:x|X)[0-9a-fA-F][0-9a-fA-F_]*(n)?\\b(?!\\$))|(\\b(?<!\\$)0(?:b|B)[01][01_]*(n)?\\b(?!\\$))|(\\b(?<!\\$)0(?:o|O)?[0-7][0-7_]*(n)?\\b(?!\\$))|((?<!\\$)(?:\n (?:\\b[0-9][0-9_]*(\\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\\b)| # 1.1E+3\n (?:\\b[0-9][0-9_]*(\\.)[eE][+-]?[0-9][0-9_]*(n)?\\b)| # 1.E+3\n (?:\\B(\\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\\b)| # .1E+3\n (?:\\b[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\\b)| # 1E+3\n (?:\\b[0-9][0-9_]*(\\.)[0-9][0-9_]*(n)?\\b)| # 1.1\n (?:\\b[0-9][0-9_]*(\\.)(n)?\\B)| # 1.\n (?:\\B(\\.)[0-9][0-9_]*(n)?\\b)| # .1\n (?:\\b[0-9][0-9_]*(n)?\\b(?!\\.)) # 1\n)(?!\\$))|([_$[:alpha:]][_$[:alnum:]]*)|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`)|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])+\\]))\\s*(\\??))\\s*((<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*))?[\\(])", + "beginCaptures": { + "1": { + "name": "storage.modifier.async.tsx" + }, + "2": { + "name": "storage.type.property.tsx" + }, + "3": { + "name": "keyword.generator.asterisk.tsx" + } + }, + "end": "(?=\\}|;|,)|(?<=\\})", + "patterns": [ + { + "include": "#method-declaration-name" + }, + { + "include": "#function-body" + }, + { + "begin": "(?x)(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(?:\\b(async)\\s+)?(?:\\b(get|set)\\s+)?(?:(\\*)\\s*)?(?=\\s*(((\\b(?<!\\$)0(?:x|X)[0-9a-fA-F][0-9a-fA-F_]*(n)?\\b(?!\\$))|(\\b(?<!\\$)0(?:b|B)[01][01_]*(n)?\\b(?!\\$))|(\\b(?<!\\$)0(?:o|O)?[0-7][0-7_]*(n)?\\b(?!\\$))|((?<!\\$)(?:\n (?:\\b[0-9][0-9_]*(\\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\\b)| # 1.1E+3\n (?:\\b[0-9][0-9_]*(\\.)[eE][+-]?[0-9][0-9_]*(n)?\\b)| # 1.E+3\n (?:\\B(\\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\\b)| # .1E+3\n (?:\\b[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\\b)| # 1E+3\n (?:\\b[0-9][0-9_]*(\\.)[0-9][0-9_]*(n)?\\b)| # 1.1\n (?:\\b[0-9][0-9_]*(\\.)(n)?\\B)| # 1.\n (?:\\B(\\.)[0-9][0-9_]*(n)?\\b)| # .1\n (?:\\b[0-9][0-9_]*(n)?\\b(?!\\.)) # 1\n)(?!\\$))|([_$[:alpha:]][_$[:alnum:]]*)|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`)|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])+\\]))\\s*(\\??))\\s*((<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*))?[\\(])", + "beginCaptures": { + "1": { + "name": "storage.modifier.async.tsx" + }, + "2": { + "name": "storage.type.property.tsx" + }, + "3": { + "name": "keyword.generator.asterisk.tsx" + } + }, + "end": "(?=\\(|\\<)", + "patterns": [ + { + "include": "#method-declaration-name" + } + ] + } + ] + }, + "method-declaration-name": { + "begin": "(?x)(?=((\\b(?<!\\$)0(?:x|X)[0-9a-fA-F][0-9a-fA-F_]*(n)?\\b(?!\\$))|(\\b(?<!\\$)0(?:b|B)[01][01_]*(n)?\\b(?!\\$))|(\\b(?<!\\$)0(?:o|O)?[0-7][0-7_]*(n)?\\b(?!\\$))|((?<!\\$)(?:\n (?:\\b[0-9][0-9_]*(\\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\\b)| # 1.1E+3\n (?:\\b[0-9][0-9_]*(\\.)[eE][+-]?[0-9][0-9_]*(n)?\\b)| # 1.E+3\n (?:\\B(\\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\\b)| # .1E+3\n (?:\\b[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\\b)| # 1E+3\n (?:\\b[0-9][0-9_]*(\\.)[0-9][0-9_]*(n)?\\b)| # 1.1\n (?:\\b[0-9][0-9_]*(\\.)(n)?\\B)| # 1.\n (?:\\B(\\.)[0-9][0-9_]*(n)?\\b)| # .1\n (?:\\b[0-9][0-9_]*(n)?\\b(?!\\.)) # 1\n)(?!\\$))|([_$[:alpha:]][_$[:alnum:]]*)|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`)|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])+\\]))\\s*(\\??)\\s*[\\(\\<])", + "end": "(?=\\(|\\<)", + "patterns": [ + { + "include": "#string" + }, + { + "include": "#array-literal" + }, + { + "include": "#numeric-literal" + }, + { + "name": "meta.definition.method.tsx entity.name.function.tsx", + "match": "[_$[:alpha:]][_$[:alnum:]]*" + }, + { + "name": "keyword.operator.optional.tsx", + "match": "\\?" + } + ] + }, + "arrow-function": { + "patterns": [ + { + "name": "meta.arrow.tsx", + "match": "(?:(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(\\basync)\\s+)?([_$[:alpha:]][_$[:alnum:]]*)\\s*(?==>)", + "captures": { + "1": { + "name": "storage.modifier.async.tsx" + }, + "2": { + "name": "variable.parameter.tsx" + } + } + }, + { + "name": "meta.arrow.tsx", + "begin": "(?x) (?:\n (?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(\\basync)\n)? ((?<![})!\\]])\\s*\n (?=\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n )\n)", + "beginCaptures": { + "1": { + "name": "storage.modifier.async.tsx" + } + }, + "end": "(?==>|\\{|(^\\s*(export|function|class|interface|let|var|const|import|enum|namespace|module|type|abstract|declare)\\s+))", + "patterns": [ + { + "include": "#comment" + }, + { + "include": "#type-parameters" + }, + { + "include": "#function-parameters" + }, + { + "include": "#arrow-return-type" + }, + { + "include": "#possibly-arrow-return-type" + } + ] + }, + { + "name": "meta.arrow.tsx", + "begin": "=>", + "beginCaptures": { + "0": { + "name": "storage.type.function.arrow.tsx" + } + }, + "end": "((?<=\\}|\\S)(?<!=>)|((?!\\{)(?=\\S)))(?!\\/[\\/\\*])", + "patterns": [ + { + "include": "#single-line-comment-consuming-line-ending" + }, + { + "include": "#decl-block" + }, + { + "include": "#expression" + } + ] + } + ] + }, + "indexer-declaration": { + "name": "meta.indexer.declaration.tsx", + "begin": "(?:(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(readonly)\\s*)?\\s*(\\[)\\s*([_$[:alpha:]][_$[:alnum:]]*)\\s*(?=:)", + "beginCaptures": { + "1": { + "name": "storage.modifier.tsx" + }, + "2": { + "name": "meta.brace.square.tsx" + }, + "3": { + "name": "variable.parameter.tsx" + } + }, + "end": "(\\])\\s*(\\?\\s*)?|$", + "endCaptures": { + "1": { + "name": "meta.brace.square.tsx" + }, + "2": { + "name": "keyword.operator.optional.tsx" + } + }, + "patterns": [ + { + "include": "#type-annotation" + } + ] + }, + "indexer-mapped-type-declaration": { + "name": "meta.indexer.mappedtype.declaration.tsx", + "begin": "(?:(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))([+-])?(readonly)\\s*)?\\s*(\\[)\\s*([_$[:alpha:]][_$[:alnum:]]*)\\s+(in)\\s+", + "beginCaptures": { + "1": { + "name": "keyword.operator.type.modifier.tsx" + }, + "2": { + "name": "storage.modifier.tsx" + }, + "3": { + "name": "meta.brace.square.tsx" + }, + "4": { + "name": "entity.name.type.tsx" + }, + "5": { + "name": "keyword.operator.expression.in.tsx" + } + }, + "end": "(\\])([+-])?\\s*(\\?\\s*)?|$", + "endCaptures": { + "1": { + "name": "meta.brace.square.tsx" + }, + "2": { + "name": "keyword.operator.type.modifier.tsx" + }, + "3": { + "name": "keyword.operator.optional.tsx" + } + }, + "patterns": [ + { + "include": "#type" + } + ] + }, + "function-parameters": { + "name": "meta.parameters.tsx", + "begin": "\\(", + "beginCaptures": { + "0": { + "name": "punctuation.definition.parameters.begin.tsx" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.definition.parameters.end.tsx" + } + }, + "patterns": [ + { + "include": "#function-parameters-body" + } + ] + }, + "function-parameters-body": { + "patterns": [ + { + "include": "#comment" + }, + { + "include": "#string" + }, + { + "include": "#decorator" + }, + { + "include": "#destructuring-parameter" + }, + { + "include": "#parameter-name" + }, + { + "include": "#parameter-type-annotation" + }, + { + "include": "#variable-initializer" + }, + { + "name": "punctuation.separator.parameter.tsx", + "match": "," + } + ] + }, + "class-declaration": { + "name": "meta.class.tsx", + "begin": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(?:(\\bexport)\\s+)?(?:(\\bdeclare)\\s+)?\\b(?:(abstract)\\s+)?\\b(class)\\b(?=\\s+|/[/*])", + "beginCaptures": { + "1": { + "name": "keyword.control.export.tsx" + }, + "2": { + "name": "storage.modifier.tsx" + }, + "3": { + "name": "storage.modifier.tsx" + }, + "4": { + "name": "storage.type.class.tsx" + } + }, + "end": "(?<=\\})", + "patterns": [ + { + "include": "#class-declaration-or-expression-patterns" + } + ] + }, + "class-expression": { + "name": "meta.class.tsx", + "begin": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(?:(abstract)\\s+)?(class)\\b(?=\\s+|[<{]|\\/[\\/*])", + "beginCaptures": { + "1": { + "name": "storage.modifier.tsx" + }, + "2": { + "name": "storage.type.class.tsx" + } + }, + "end": "(?<=\\})", + "patterns": [ + { + "include": "#class-declaration-or-expression-patterns" + } + ] + }, + "class-declaration-or-expression-patterns": { + "patterns": [ + { + "include": "#comment" + }, + { + "include": "#class-or-interface-heritage" + }, + { + "match": "[_$[:alpha:]][_$[:alnum:]]*", + "captures": { + "0": { + "name": "entity.name.type.class.tsx" + } + } + }, + { + "include": "#type-parameters" + }, + { + "include": "#class-or-interface-body" + } + ] + }, + "interface-declaration": { + "name": "meta.interface.tsx", + "begin": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(?:(\\bexport)\\s+)?(?:(\\bdeclare)\\s+)?\\b(?:(abstract)\\s+)?\\b(interface)\\b(?=\\s+|/[/*])", + "beginCaptures": { + "1": { + "name": "keyword.control.export.tsx" + }, + "2": { + "name": "storage.modifier.tsx" + }, + "3": { + "name": "storage.modifier.tsx" + }, + "4": { + "name": "storage.type.interface.tsx" + } + }, + "end": "(?<=\\})", + "patterns": [ + { + "include": "#comment" + }, + { + "include": "#class-or-interface-heritage" + }, + { + "match": "[_$[:alpha:]][_$[:alnum:]]*", + "captures": { + "0": { + "name": "entity.name.type.interface.tsx" + } + } + }, + { + "include": "#type-parameters" + }, + { + "include": "#class-or-interface-body" + } + ] + }, + "class-or-interface-heritage": { + "begin": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(?:\\b(extends|implements)\\b)(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))", + "beginCaptures": { + "1": { + "name": "storage.modifier.tsx" + } + }, + "end": "(?=\\{)", + "patterns": [ + { + "include": "#comment" + }, + { + "include": "#class-or-interface-heritage" + }, + { + "include": "#type-parameters" + }, + { + "include": "#expressionWithoutIdentifiers" + }, + { + "match": "([_$[:alpha:]][_$[:alnum:]]*)\\s*(?:(\\.)|(\\?\\.(?!\\s*[[:digit:]])))(?=\\s*[_$[:alpha:]][_$[:alnum:]]*(\\s*\\??\\.\\s*[_$[:alpha:]][_$[:alnum:]]*)*\\s*)", + "captures": { + "1": { + "name": "entity.name.type.module.tsx" + }, + "2": { + "name": "punctuation.accessor.tsx" + }, + "3": { + "name": "punctuation.accessor.optional.tsx" + } + } + }, + { + "match": "([_$[:alpha:]][_$[:alnum:]]*)", + "captures": { + "1": { + "name": "entity.other.inherited-class.tsx" + } + } + }, + { + "include": "#expressionPunctuations" + } + ] + }, + "class-or-interface-body": { + "begin": "\\{", + "beginCaptures": { + "0": { + "name": "punctuation.definition.block.tsx" + } + }, + "end": "\\}", + "endCaptures": { + "0": { + "name": "punctuation.definition.block.tsx" + } + }, + "patterns": [ + { + "include": "#comment" + }, + { + "include": "#decorator" + }, + { + "begin": "(?<=:)\\s*", + "end": "(?=\\s|[;),}\\]:\\-\\+]|;|(?:^\\s*(?:abstract|async|class|const|declare|enum|export|function|import|interface|let|module|namespace|return|type|var)\\b))", + "patterns": [ + { + "include": "#expression" + } + ] + }, + { + "include": "#method-declaration" + }, + { + "include": "#indexer-declaration" + }, + { + "include": "#field-declaration" + }, + { + "include": "#string" + }, + { + "include": "#type-annotation" + }, + { + "include": "#variable-initializer" + }, + { + "include": "#access-modifier" + }, + { + "include": "#property-accessor" + }, + { + "include": "#async-modifier" + }, + { + "include": "#after-operator-block-as-object-literal" + }, + { + "include": "#decl-block" + }, + { + "include": "#expression" + }, + { + "include": "#punctuation-comma" + }, + { + "include": "#punctuation-semicolon" + } + ] + }, + "access-modifier": { + "name": "storage.modifier.tsx", + "match": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(abstract|public|protected|private|readonly|static)(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))" + }, + "property-accessor": { + "name": "storage.type.property.tsx", + "match": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(get|set)(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))" + }, + "async-modifier": { + "name": "storage.modifier.async.tsx", + "match": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(async)(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))" + }, + "enum-declaration": { + "name": "meta.enum.declaration.tsx", + "begin": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(?:(\\bexport)\\s+)?(?:(\\bdeclare)\\s+)?(?:\\b(const)\\s+)?\\b(enum)\\s+([_$[:alpha:]][_$[:alnum:]]*)", + "beginCaptures": { + "1": { + "name": "keyword.control.export.tsx" + }, + "2": { + "name": "storage.modifier.tsx" + }, + "3": { + "name": "storage.modifier.tsx" + }, + "4": { + "name": "storage.type.enum.tsx" + }, + "5": { + "name": "entity.name.type.enum.tsx" + } + }, + "end": "(?<=\\})", + "patterns": [ + { + "include": "#comment" + }, + { + "begin": "\\{", + "beginCaptures": { + "0": { + "name": "punctuation.definition.block.tsx" + } + }, + "end": "\\}", + "endCaptures": { + "0": { + "name": "punctuation.definition.block.tsx" + } + }, + "patterns": [ + { + "include": "#comment" + }, + { + "begin": "([_$[:alpha:]][_$[:alnum:]]*)", + "beginCaptures": { + "0": { + "name": "variable.other.enummember.tsx" + } + }, + "end": "(?=,|\\}|$)", + "patterns": [ + { + "include": "#comment" + }, + { + "include": "#variable-initializer" + } + ] + }, + { + "begin": "(?=((\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`)|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])+\\])))", + "end": "(?=,|\\}|$)", + "patterns": [ + { + "include": "#string" + }, + { + "include": "#array-literal" + }, + { + "include": "#comment" + }, + { + "include": "#variable-initializer" + } + ] + }, + { + "include": "#punctuation-comma" + } + ] + } + ] + }, + "namespace-declaration": { + "name": "meta.namespace.declaration.tsx", + "begin": "(?:(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(?:(\\bexport)\\s+)?(?:(\\bdeclare)\\s+)?\\b(namespace|module)\\s+(?=[_$[:alpha:]\"'`]))", + "beginCaptures": { + "1": { + "name": "keyword.control.export.tsx" + }, + "2": { + "name": "storage.modifier.tsx" + }, + "3": { + "name": "storage.type.namespace.tsx" + } + }, + "end": "(?<=\\})|(?=;|(?:^\\s*(?:abstract|async|class|const|declare|enum|export|function|import|interface|let|module|namespace|return|type|var)\\b))", + "patterns": [ + { + "include": "#comment" + }, + { + "include": "#string" + }, + { + "name": "entity.name.type.module.tsx", + "match": "([_$[:alpha:]][_$[:alnum:]]*)" + }, + { + "include": "#punctuation-accessor" + }, + { + "include": "#decl-block" + } + ] + }, + "type-alias-declaration": { + "name": "meta.type.declaration.tsx", + "begin": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(?:(\\bexport)\\s+)?(?:(\\bdeclare)\\s+)?\\b(type)\\b\\s+([_$[:alpha:]][_$[:alnum:]]*)\\s*", + "beginCaptures": { + "1": { + "name": "keyword.control.export.tsx" + }, + "2": { + "name": "storage.modifier.tsx" + }, + "3": { + "name": "storage.type.type.tsx" + }, + "4": { + "name": "entity.name.type.alias.tsx" + } + }, + "end": "(?=\\}|;|(?:^\\s*(?:abstract|async|class|const|declare|enum|export|function|import|interface|let|module|namespace|return|type|var)\\b))", + "patterns": [ + { + "include": "#comment" + }, + { + "include": "#type-parameters" + }, + { + "begin": "(=)\\s*", + "beginCaptures": { + "1": { + "name": "keyword.operator.assignment.tsx" + } + }, + "end": "(?=\\}|;|(?:^\\s*(?:abstract|async|class|const|declare|enum|export|function|import|interface|let|module|namespace|return|type|var)\\b))", + "patterns": [ + { + "include": "#type" + } + ] + } + ] + }, + "import-equals-declaration": { + "patterns": [ + { + "name": "meta.import-equals.external.tsx", + "begin": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(?:(\\bexport)\\s+)?(?:(\\bdeclare)\\s+)?\\b(import)\\s+([_$[:alpha:]][_$[:alnum:]]*)\\s*(=)\\s*(require)\\s*(\\()", + "beginCaptures": { + "1": { + "name": "keyword.control.export.tsx" + }, + "2": { + "name": "storage.modifier.tsx" + }, + "3": { + "name": "keyword.control.import.tsx" + }, + "4": { + "name": "variable.other.readwrite.alias.tsx" + }, + "5": { + "name": "keyword.operator.assignment.tsx" + }, + "6": { + "name": "keyword.control.require.tsx" + }, + "7": { + "name": "meta.brace.round.tsx" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "meta.brace.round.tsx" + } + }, + "patterns": [ + { + "include": "#comment" + }, + { + "include": "#string" + } + ] + }, + { + "name": "meta.import-equals.internal.tsx", + "begin": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(?:(\\bexport)\\s+)?(?:(\\bdeclare)\\s+)?\\b(import)\\s+([_$[:alpha:]][_$[:alnum:]]*)\\s*(=)\\s*(?!require\\b)", + "beginCaptures": { + "1": { + "name": "keyword.control.export.tsx" + }, + "2": { + "name": "storage.modifier.tsx" + }, + "3": { + "name": "keyword.control.import.tsx" + }, + "4": { + "name": "variable.other.readwrite.alias.tsx" + }, + "5": { + "name": "keyword.operator.assignment.tsx" + } + }, + "end": "(?=;|$|^)", + "patterns": [ + { + "include": "#single-line-comment-consuming-line-ending" + }, + { + "include": "#comment" + }, + { + "match": "([_$[:alpha:]][_$[:alnum:]]*)\\s*(?:(\\.)|(\\?\\.(?!\\s*[[:digit:]])))", + "captures": { + "1": { + "name": "entity.name.type.module.tsx" + }, + "2": { + "name": "punctuation.accessor.tsx" + }, + "3": { + "name": "punctuation.accessor.optional.tsx" + } + } + }, + { + "name": "variable.other.readwrite.tsx", + "match": "([_$[:alpha:]][_$[:alnum:]]*)" + } + ] + } + ] + }, + "import-declaration": { + "name": "meta.import.tsx", + "begin": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(?:(\\bexport)\\s+)?(?:(\\bdeclare)\\s+)?\\b(import)(?!\\s*[:\\(])(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))", + "beginCaptures": { + "1": { + "name": "keyword.control.export.tsx" + }, + "2": { + "name": "storage.modifier.tsx" + }, + "3": { + "name": "keyword.control.import.tsx" + } + }, + "end": "(?<!^import|[^\\._$[:alnum:]]import)(?=;|$|^)", + "patterns": [ + { + "include": "#single-line-comment-consuming-line-ending" + }, + { + "include": "#comment" + }, + { + "include": "#string" + }, + { + "begin": "(?<=^import|[^\\._$[:alnum:]]import)(?!\\s*[\"'])", + "end": "\\bfrom\\b", + "endCaptures": { + "0": { + "name": "keyword.control.from.tsx" + } + }, + "patterns": [ + { + "include": "#import-export-declaration" + } + ] + }, + { + "include": "#import-export-declaration" + } + ] + }, + "export-declaration": { + "patterns": [ + { + "match": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(export)\\s+(as)\\s+(namespace)\\s+([_$[:alpha:]][_$[:alnum:]]*)", + "captures": { + "1": { + "name": "keyword.control.export.tsx" + }, + "2": { + "name": "keyword.control.as.tsx" + }, + "3": { + "name": "storage.type.namespace.tsx" + }, + "4": { + "name": "entity.name.type.module.tsx" + } + } + }, + { + "name": "meta.export.default.tsx", + "begin": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(export)(?:(?:\\s*(=))|(?:\\s+(default)(?=\\s+)))", + "beginCaptures": { + "1": { + "name": "keyword.control.export.tsx" + }, + "2": { + "name": "keyword.operator.assignment.tsx" + }, + "3": { + "name": "keyword.control.default.tsx" + } + }, + "end": "(?=$|;|(?:^\\s*(?:abstract|async|class|const|declare|enum|export|function|import|interface|let|module|namespace|return|type|var)\\b))", + "patterns": [ + { + "include": "#interface-declaration" + }, + { + "include": "#expression" + } + ] + }, + { + "name": "meta.export.tsx", + "begin": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(export)\\b(?!(\\$)|(\\s*:))((?=\\s*[\\{*])|((?=\\s*[_$[:alpha:]][_$[:alnum:]]*(\\s|,))(?!\\s*(?:abstract|async|class|const|declare|enum|export|function|import|interface|let|module|namespace|return|type|var)\\b)))", + "beginCaptures": { + "0": { + "name": "keyword.control.export.tsx" + } + }, + "end": "(?=$|;|(?:^\\s*(?:abstract|async|class|const|declare|enum|export|function|import|interface|let|module|namespace|return|type|var)\\b))", + "patterns": [ + { + "include": "#import-export-declaration" + } + ] + } + ] + }, + "import-export-declaration": { + "patterns": [ + { + "include": "#comment" + }, + { + "include": "#string" + }, + { + "include": "#import-export-block" + }, + { + "name": "keyword.control.from.tsx", + "match": "\\bfrom\\b" + }, + { + "include": "#import-export-clause" + } + ] + }, + "import-export-block": { + "name": "meta.block.tsx", + "begin": "\\{", + "beginCaptures": { + "0": { + "name": "punctuation.definition.block.tsx" + } + }, + "end": "\\}", + "endCaptures": { + "0": { + "name": "punctuation.definition.block.tsx" + } + }, + "patterns": [ + { + "include": "#import-export-clause" + } + ] + }, + "import-export-clause": { + "patterns": [ + { + "include": "#comment" + }, + { + "match": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(?:(\\bdefault)|(\\*)|(\\b[_$[:alpha:]][_$[:alnum:]]*))\\s+(as)\\s+(?:(default(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.)))|([_$[:alpha:]][_$[:alnum:]]*))", + "captures": { + "1": { + "name": "keyword.control.default.tsx" + }, + "2": { + "name": "constant.language.import-export-all.tsx" + }, + "3": { + "name": "variable.other.readwrite.tsx" + }, + "4": { + "name": "keyword.control.as.tsx" + }, + "5": { + "name": "keyword.control.default.tsx" + }, + "6": { + "name": "variable.other.readwrite.alias.tsx" + } + } + }, + { + "include": "#punctuation-comma" + }, + { + "name": "constant.language.import-export-all.tsx", + "match": "\\*" + }, + { + "name": "keyword.control.default.tsx", + "match": "\\b(default)\\b" + }, + { + "name": "variable.other.readwrite.alias.tsx", + "match": "([_$[:alpha:]][_$[:alnum:]]*)" + } + ] + }, + "switch-statement": { + "name": "switch-statement.expr.tsx", + "begin": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(?=\\bswitch\\s*\\()", + "end": "\\}", + "endCaptures": { + "0": { + "name": "punctuation.definition.block.tsx" + } + }, + "patterns": [ + { + "include": "#comment" + }, + { + "name": "switch-expression.expr.tsx", + "begin": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(switch)\\s*(\\()", + "beginCaptures": { + "1": { + "name": "keyword.control.switch.tsx" + }, + "2": { + "name": "meta.brace.round.tsx" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "meta.brace.round.tsx" + } + }, + "patterns": [ + { + "include": "#expression" + } + ] + }, + { + "name": "switch-block.expr.tsx", + "begin": "\\{", + "beginCaptures": { + "0": { + "name": "punctuation.definition.block.tsx" + } + }, + "end": "(?=\\})", + "patterns": [ + { + "name": "case-clause.expr.tsx", + "begin": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(case|default(?=:))(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))", + "beginCaptures": { + "1": { + "name": "keyword.control.switch.tsx" + } + }, + "end": "(?=:)", + "patterns": [ + { + "include": "#expression" + } + ] + }, + { + "begin": "(:)\\s*(\\{)", + "beginCaptures": { + "1": { + "name": "case-clause.expr.tsx punctuation.definition.section.case-statement.tsx" + }, + "2": { + "name": "meta.block.tsx punctuation.definition.block.tsx" + } + }, + "end": "\\}", + "endCaptures": { + "0": { + "name": "meta.block.tsx punctuation.definition.block.tsx" + } + }, + "contentName": "meta.block.tsx", + "patterns": [ + { + "include": "#statements" + } + ] + }, + { + "match": "(:)", + "captures": { + "0": { + "name": "case-clause.expr.tsx punctuation.definition.section.case-statement.tsx" + } + } + }, + { + "include": "#statements" + } + ] + } + ] + }, + "for-loop": { + "begin": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))for(?=((\\s+|(\\s*\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*))await)?\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)?(\\())", + "beginCaptures": { + "0": { + "name": "keyword.control.loop.tsx" + } + }, + "end": "(?<=\\))", + "patterns": [ + { + "include": "#comment" + }, + { + "name": "keyword.control.loop.tsx", + "match": "await" + }, + { + "begin": "\\(", + "beginCaptures": { + "0": { + "name": "meta.brace.round.tsx" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "meta.brace.round.tsx" + } + }, + "patterns": [ + { + "include": "#var-expr" + }, + { + "include": "#expression" + }, + { + "include": "#punctuation-semicolon" + } + ] + } + ] + }, + "if-statement": { + "patterns": [ + { + "begin": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(?=\\bif\\s*(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))\\s*(?!\\{))", + "end": "(?=;|$|\\})", + "patterns": [ + { + "include": "#comment" + }, + { + "begin": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(if)\\s*(\\()", + "beginCaptures": { + "1": { + "name": "keyword.control.conditional.tsx" + }, + "2": { + "name": "meta.brace.round.tsx" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "meta.brace.round.tsx" + } + }, + "patterns": [ + { + "include": "#expression" + } + ] + }, + { + "name": "string.regexp.tsx", + "begin": "(?<=\\))\\s*\\/(?![\\/*])(?=(?:[^\\/\\\\\\[]|\\\\.|\\[([^\\]\\\\]|\\\\.)+\\])+\\/([gimsuy]+|(?![\\/\\*])|(?=\\/\\*))(?!\\s*[a-zA-Z0-9_$]))", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.tsx" + } + }, + "end": "(/)([gimsuy]*)", + "endCaptures": { + "1": { + "name": "punctuation.definition.string.end.tsx" + }, + "2": { + "name": "keyword.other.tsx" + } + }, + "patterns": [ + { + "include": "#regexp" + } + ] + }, + { + "include": "#statements" + } + ] + } + ] + }, + "decl-block": { + "name": "meta.block.tsx", + "begin": "\\{", + "beginCaptures": { + "0": { + "name": "punctuation.definition.block.tsx" + } + }, + "end": "\\}", + "endCaptures": { + "0": { + "name": "punctuation.definition.block.tsx" + } + }, + "patterns": [ + { + "include": "#statements" + } + ] + }, + "after-operator-block-as-object-literal": { + "name": "meta.objectliteral.tsx", + "begin": "(?<!\\+\\+|--)(?<=[:=(,\\[?+!>]|^await|[^\\._$[:alnum:]]await|^return|[^\\._$[:alnum:]]return|^yield|[^\\._$[:alnum:]]yield|^throw|[^\\._$[:alnum:]]throw|^in|[^\\._$[:alnum:]]in|^of|[^\\._$[:alnum:]]of|^typeof|[^\\._$[:alnum:]]typeof|&&|\\|\\||\\*)\\s*(\\{)", + "beginCaptures": { + "1": { + "name": "punctuation.definition.block.tsx" + } + }, + "end": "\\}", + "endCaptures": { + "0": { + "name": "punctuation.definition.block.tsx" + } + }, + "patterns": [ + { + "include": "#object-member" + } + ] + }, + "object-literal": { + "name": "meta.objectliteral.tsx", + "begin": "\\{", + "beginCaptures": { + "0": { + "name": "punctuation.definition.block.tsx" + } + }, + "end": "\\}", + "endCaptures": { + "0": { + "name": "punctuation.definition.block.tsx" + } + }, + "patterns": [ + { + "include": "#object-member" + } + ] + }, + "object-member": { + "patterns": [ + { + "include": "#comment" + }, + { + "include": "#object-literal-method-declaration" + }, + { + "name": "meta.object.member.tsx meta.object-literal.key.tsx", + "begin": "(?=\\[)", + "end": "(?=:)|((?<=[\\]])(?=\\s*[\\(\\<]))", + "patterns": [ + { + "include": "#comment" + }, + { + "include": "#array-literal" + } + ] + }, + { + "name": "meta.object.member.tsx meta.object-literal.key.tsx", + "begin": "(?=[\\'\\\"\\`])", + "end": "(?=:)|((?<=[\\'\\\"\\`])(?=((\\s*[\\(\\<,}])|(\\s+(as)\\s+))))", + "patterns": [ + { + "include": "#comment" + }, + { + "include": "#string" + } + ] + }, + { + "name": "meta.object.member.tsx meta.object-literal.key.tsx", + "begin": "(?x)(?=(\\b(?<!\\$)0(?:x|X)[0-9a-fA-F][0-9a-fA-F_]*(n)?\\b(?!\\$))|(\\b(?<!\\$)0(?:b|B)[01][01_]*(n)?\\b(?!\\$))|(\\b(?<!\\$)0(?:o|O)?[0-7][0-7_]*(n)?\\b(?!\\$))|((?<!\\$)(?:\n (?:\\b[0-9][0-9_]*(\\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\\b)| # 1.1E+3\n (?:\\b[0-9][0-9_]*(\\.)[eE][+-]?[0-9][0-9_]*(n)?\\b)| # 1.E+3\n (?:\\B(\\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\\b)| # .1E+3\n (?:\\b[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\\b)| # 1E+3\n (?:\\b[0-9][0-9_]*(\\.)[0-9][0-9_]*(n)?\\b)| # 1.1\n (?:\\b[0-9][0-9_]*(\\.)(n)?\\B)| # 1.\n (?:\\B(\\.)[0-9][0-9_]*(n)?\\b)| # .1\n (?:\\b[0-9][0-9_]*(n)?\\b(?!\\.)) # 1\n)(?!\\$)))", + "end": "(?=:)|(?=\\s*([\\(\\<,}])|(\\s+as\\s+))", + "patterns": [ + { + "include": "#comment" + }, + { + "include": "#numeric-literal" + } + ] + }, + { + "name": "meta.method.declaration.tsx", + "begin": "(?<=[\\]\\'\\\"\\`])(?=\\s*[\\(\\<])", + "end": "(?=\\}|;|,)|(?<=\\})", + "patterns": [ + { + "include": "#function-body" + } + ] + }, + { + "name": "meta.object.member.tsx", + "match": "(?![_$[:alpha:]])([[:digit:]]+)\\s*(?=(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*:)", + "captures": { + "0": { + "name": "meta.object-literal.key.tsx" + }, + "1": { + "name": "constant.numeric.decimal.tsx" + } + } + }, + { + "name": "meta.object.member.tsx", + "match": "(?x)(?:([_$[:alpha:]][_$[:alnum:]]*)\\s*(?=(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*:(\\s*\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/)*\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)))", + "captures": { + "0": { + "name": "meta.object-literal.key.tsx" + }, + "1": { + "name": "entity.name.function.tsx" + } + } + }, + { + "name": "meta.object.member.tsx", + "match": "(?:[_$[:alpha:]][_$[:alnum:]]*)\\s*(?=(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*:)", + "captures": { + "0": { + "name": "meta.object-literal.key.tsx" + } + } + }, + { + "name": "meta.object.member.tsx", + "begin": "\\.\\.\\.", + "beginCaptures": { + "0": { + "name": "keyword.operator.spread.tsx" + } + }, + "end": "(?=,|\\})", + "patterns": [ + { + "include": "#expression" + } + ] + }, + { + "name": "meta.object.member.tsx", + "match": "([_$[:alpha:]][_$[:alnum:]]*)\\s*(?=,|\\}|$|\\/\\/|\\/\\*)", + "captures": { + "1": { + "name": "variable.other.readwrite.tsx" + } + } + }, + { + "name": "meta.object.member.tsx", + "match": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(as)\\s+(const)(?=\\s*([,}]|$))", + "captures": { + "1": { + "name": "keyword.control.as.tsx" + }, + "2": { + "name": "storage.modifier.tsx" + } + } + }, + { + "name": "meta.object.member.tsx", + "begin": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(as)\\s+", + "beginCaptures": { + "1": { + "name": "keyword.control.as.tsx" + } + }, + "end": "(?=$|^|[,}]|\\|\\||\\&\\&|((?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(as)\\s+))", + "patterns": [ + { + "include": "#type" + } + ] + }, + { + "name": "meta.object.member.tsx", + "begin": "(?=[_$[:alpha:]][_$[:alnum:]]*\\s*=)", + "end": "(?=,|\\}|$|\\/\\/|\\/\\*)", + "patterns": [ + { + "include": "#expression" + } + ] + }, + { + "name": "meta.object.member.tsx", + "begin": ":", + "beginCaptures": { + "0": { + "name": "meta.object-literal.key.tsx punctuation.separator.key-value.tsx" + } + }, + "end": "(?=,|\\})", + "patterns": [ + { + "begin": "(?<=:)\\s*(async)?(?=\\s*(<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)\\(\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))", + "beginCaptures": { + "1": { + "name": "storage.modifier.async.tsx" + } + }, + "end": "(?<=\\))", + "patterns": [ + { + "include": "#type-parameters" + }, + { + "begin": "\\(", + "beginCaptures": { + "0": { + "name": "meta.brace.round.tsx" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "meta.brace.round.tsx" + } + }, + "patterns": [ + { + "include": "#expression-inside-possibly-arrow-parens" + } + ] + } + ] + }, + { + "begin": "(?<=:)\\s*(async)?\\s*(\\()(?=\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))", + "beginCaptures": { + "1": { + "name": "storage.modifier.async.tsx" + }, + "2": { + "name": "meta.brace.round.tsx" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "meta.brace.round.tsx" + } + }, + "patterns": [ + { + "include": "#expression-inside-possibly-arrow-parens" + } + ] + }, + { + "include": "#possibly-arrow-return-type" + }, + { + "include": "#expression" + } + ] + }, + { + "include": "#punctuation-comma" + } + ] + }, + "ternary-expression": { + "begin": "(?!\\?\\.\\s*[^[:digit:]])(\\?)(?!\\?)", + "beginCaptures": { + "1": { + "name": "keyword.operator.ternary.tsx" + } + }, + "end": "\\s*(:)", + "endCaptures": { + "1": { + "name": "keyword.operator.ternary.tsx" + } + }, + "patterns": [ + { + "include": "#expression" + } + ] + }, + "function-call": { + "begin": "(?=(((([_$[:alpha:]][_$[:alnum:]]*\\s*\\??\\.\\s*)*|(\\??\\.\\s*)?)([_$[:alpha:]][_$[:alnum:]]*))|(?<=[\\)]))\\s*(?:(\\?\\.\\s*)|(\\!))?(<\\s*(((keyof|infer|typeof)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\'[^\\']*\\')|(\\\"[^\\\"]*\\\")|(\\`[^\\`]*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\'[^\\']*\\')|(\\\"[^\\\"]*\\\")|(\\`[^\\`]*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))(([^<>\\(]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\'[^\\']*\\')|(\\\"[^\\\"]*\\\")|(\\`[^\\`]*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(?<==)\\>)*(?<!=)\\>))*(?<!=)\\>)*(?<!=)>\\s*)?\\()", + "end": "(?<=\\))(?!(((([_$[:alpha:]][_$[:alnum:]]*\\s*\\??\\.\\s*)*|(\\??\\.\\s*)?)([_$[:alpha:]][_$[:alnum:]]*))|(?<=[\\)]))\\s*(?:(\\?\\.\\s*)|(\\!))?(<\\s*(((keyof|infer|typeof)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\'[^\\']*\\')|(\\\"[^\\\"]*\\\")|(\\`[^\\`]*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\'[^\\']*\\')|(\\\"[^\\\"]*\\\")|(\\`[^\\`]*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))(([^<>\\(]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\'[^\\']*\\')|(\\\"[^\\\"]*\\\")|(\\`[^\\`]*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(?<==)\\>)*(?<!=)\\>))*(?<!=)\\>)*(?<!=)>\\s*)?\\()", + "patterns": [ + { + "name": "meta.function-call.tsx", + "begin": "(?=(([_$[:alpha:]][_$[:alnum:]]*\\s*\\??\\.\\s*)*|(\\??\\.\\s*)?)([_$[:alpha:]][_$[:alnum:]]*))", + "end": "(?=\\s*(?:(\\?\\.\\s*)|(\\!))?(<\\s*(((keyof|infer|typeof)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\'[^\\']*\\')|(\\\"[^\\\"]*\\\")|(\\`[^\\`]*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\'[^\\']*\\')|(\\\"[^\\\"]*\\\")|(\\`[^\\`]*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))(([^<>\\(]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\'[^\\']*\\')|(\\\"[^\\\"]*\\\")|(\\`[^\\`]*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(?<==)\\>)*(?<!=)\\>))*(?<!=)\\>)*(?<!=)>\\s*)?\\()", + "patterns": [ + { + "include": "#support-function-call-identifiers" + }, + { + "name": "entity.name.function.tsx", + "match": "([_$[:alpha:]][_$[:alnum:]]*)" + } + ] + }, + { + "include": "#comment" + }, + { + "name": "meta.function-call.tsx punctuation.accessor.optional.tsx", + "match": "\\?\\." + }, + { + "name": "meta.function-call.tsx keyword.operator.definiteassignment.tsx", + "match": "\\!" + }, + { + "include": "#type-arguments" + }, + { + "include": "#paren-expression" + } + ] + }, + "support-function-call-identifiers": { + "patterns": [ + { + "include": "#literal" + }, + { + "include": "#support-objects" + }, + { + "include": "#object-identifiers" + }, + { + "include": "#punctuation-accessor" + }, + { + "name": "keyword.operator.expression.import.tsx", + "match": "(?:(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))import(?=\\s*[\\(]\\s*[\\\"\\'\\`]))" + } + ] + }, + "new-expr": { + "name": "new.expr.tsx", + "begin": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(new)(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))", + "beginCaptures": { + "1": { + "name": "keyword.operator.new.tsx" + } + }, + "end": "(?<=\\))|(?=[;),}\\]:\\-\\+]|\\|\\||\\&\\&|$|((?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))new(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.)))|((?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))function((\\s+[_$[:alpha:]][_$[:alnum:]]*)|(\\s*[\\(]))))", + "patterns": [ + { + "include": "#paren-expression" + }, + { + "include": "#class-declaration" + }, + { + "include": "#type" + } + ] + }, + "instanceof-expr": { + "begin": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(instanceof)(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))", + "beginCaptures": { + "1": { + "name": "keyword.operator.expression.instanceof.tsx" + } + }, + "end": "(?<=\\))|(?=[;),}\\]:?]|\\|\\||\\&\\&|$|((?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))function((\\s+[_$[:alpha:]][_$[:alnum:]]*)|(\\s*[\\(]))))", + "patterns": [ + { + "include": "#type" + } + ] + }, + "paren-expression-possibly-arrow": { + "patterns": [ + { + "begin": "(?<=[(=,])\\s*(async)?(?=\\s*((<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*))?\\(\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))", + "beginCaptures": { + "1": { + "name": "storage.modifier.async.tsx" + } + }, + "end": "(?<=\\))", + "patterns": [ + { + "include": "#paren-expression-possibly-arrow-with-typeparameters" + } + ] + }, + { + "begin": "(?<=[(=,]|=>|^return|[^\\._$[:alnum:]]return)\\s*(async)?(?=\\s*((((<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*))?\\()|(<))\\s*$)", + "beginCaptures": { + "1": { + "name": "storage.modifier.async.tsx" + } + }, + "end": "(?<=\\))", + "patterns": [ + { + "include": "#paren-expression-possibly-arrow-with-typeparameters" + } + ] + }, + { + "include": "#possibly-arrow-return-type" + } + ] + }, + "paren-expression-possibly-arrow-with-typeparameters": { + "patterns": [ + { + "include": "#type-parameters" + }, + { + "begin": "\\(", + "beginCaptures": { + "0": { + "name": "meta.brace.round.tsx" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "meta.brace.round.tsx" + } + }, + "patterns": [ + { + "include": "#expression-inside-possibly-arrow-parens" + } + ] + } + ] + }, + "expression-inside-possibly-arrow-parens": { + "patterns": [ + { + "include": "#expressionWithoutIdentifiers" + }, + { + "include": "#comment" + }, + { + "include": "#string" + }, + { + "include": "#decorator" + }, + { + "include": "#destructuring-parameter" + }, + { + "match": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(public|protected|private|readonly)\\s+(?=(public|protected|private|readonly)\\s+)", + "captures": { + "1": { + "name": "storage.modifier.tsx" + } + } + }, + { + "match": "(?x)(?:(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(public|private|protected|readonly)\\s+)?(?:(\\.\\.\\.)\\s*)?(?<!=|:)(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(?:(this)|([_$[:alpha:]][_$[:alnum:]]*))(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))\\s*(\\??)(?=\\s*\n# function assignment |\n(=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)) |\n# typeannotation is fn type: < | () | (... | (param: | (param, | (param? | (param= | (param) =>\n(:\\s*(\n (<) |\n ([(]\\s*(\n ([)]) |\n (\\.\\.\\.) |\n ([_$[:alnum:]]+\\s*(\n ([:,?=])|\n ([)]\\s*=>)\n ))\n ))\n)) |\n(:\\s*(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))Function(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))) |\n(:\\s*((<\\s*$)|([\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*))))))) |\n(:\\s*(=>|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(<[^<>]*>)|[^<>(),=])+=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)))", + "captures": { + "1": { + "name": "storage.modifier.tsx" + }, + "2": { + "name": "keyword.operator.rest.tsx" + }, + "3": { + "name": "entity.name.function.tsx variable.language.this.tsx" + }, + "4": { + "name": "entity.name.function.tsx" + }, + "5": { + "name": "keyword.operator.optional.tsx" + } + } + }, + { + "match": "(?x)(?:(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(public|private|protected|readonly)\\s+)?(?:(\\.\\.\\.)\\s*)?(?<!=|:)(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(?:(this)|([_$[:alpha:]][_$[:alnum:]]*))(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))\\s*(\\??)(?=\\s*:)", + "captures": { + "1": { + "name": "storage.modifier.tsx" + }, + "2": { + "name": "keyword.operator.rest.tsx" + }, + "3": { + "name": "variable.parameter.tsx variable.language.this.tsx" + }, + "4": { + "name": "variable.parameter.tsx" + }, + "5": { + "name": "keyword.operator.optional.tsx" + } + } + }, + { + "include": "#type-annotation" + }, + { + "include": "#variable-initializer" + }, + { + "name": "punctuation.separator.parameter.tsx", + "match": "," + }, + { + "include": "#identifiers" + }, + { + "include": "#expressionPunctuations" + } + ] + }, + "paren-expression": { + "begin": "\\(", + "beginCaptures": { + "0": { + "name": "meta.brace.round.tsx" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "meta.brace.round.tsx" + } + }, + "patterns": [ + { + "include": "#expression" + } + ] + }, + "cast": { + "patterns": [ + { + "include": "#jsx" + } + ] + }, + "expression-operators": { + "patterns": [ + { + "name": "keyword.control.flow.tsx", + "match": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(await)(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))" + }, + { + "begin": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(yield)(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))(?=\\s*\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*\\*)", + "beginCaptures": { + "1": { + "name": "keyword.control.flow.tsx" + } + }, + "end": "\\*", + "endCaptures": { + "0": { + "name": "keyword.generator.asterisk.tsx" + } + }, + "patterns": [ + { + "include": "#comment" + } + ] + }, + { + "match": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(yield)(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))(?:\\s*(\\*))?", + "captures": { + "1": { + "name": "keyword.control.flow.tsx" + }, + "2": { + "name": "keyword.generator.asterisk.tsx" + } + } + }, + { + "name": "keyword.operator.expression.delete.tsx", + "match": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))delete(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))" + }, + { + "name": "keyword.operator.expression.in.tsx", + "match": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))in(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))(?!\\()" + }, + { + "name": "keyword.operator.expression.of.tsx", + "match": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))of(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))(?!\\()" + }, + { + "name": "keyword.operator.expression.instanceof.tsx", + "match": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))instanceof(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))" + }, + { + "name": "keyword.operator.new.tsx", + "match": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))new(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))" + }, + { + "include": "#typeof-operator" + }, + { + "name": "keyword.operator.expression.void.tsx", + "match": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))void(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))" + }, + { + "match": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(as)\\s+(const)(?=\\s*($|[;,:})\\]]))", + "captures": { + "1": { + "name": "keyword.control.as.tsx" + }, + "2": { + "name": "storage.modifier.tsx" + } + } + }, + { + "begin": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(as)\\s+", + "beginCaptures": { + "1": { + "name": "keyword.control.as.tsx" + } + }, + "end": "(?=$|^|[;,:})\\]]|\\|\\||\\&\\&|((?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(as)\\s+)|(\\s+\\<))", + "patterns": [ + { + "include": "#type" + } + ] + }, + { + "name": "keyword.operator.spread.tsx", + "match": "\\.\\.\\." + }, + { + "name": "keyword.operator.assignment.compound.tsx", + "match": "\\*=|(?<!\\()/=|%=|\\+=|\\-=" + }, + { + "name": "keyword.operator.assignment.compound.bitwise.tsx", + "match": "\\&=|\\^=|<<=|>>=|>>>=|\\|=" + }, + { + "name": "keyword.operator.bitwise.shift.tsx", + "match": "<<|>>>|>>" + }, + { + "name": "keyword.operator.comparison.tsx", + "match": "===|!==|==|!=" + }, + { + "name": "keyword.operator.relational.tsx", + "match": "<=|>=|<>|<|>" + }, + { + "name": "keyword.operator.logical.tsx", + "match": "\\!|&&|\\|\\||\\?\\?" + }, + { + "name": "keyword.operator.bitwise.tsx", + "match": "\\&|~|\\^|\\|" + }, + { + "name": "keyword.operator.assignment.tsx", + "match": "\\=" + }, + { + "name": "keyword.operator.decrement.tsx", + "match": "--" + }, + { + "name": "keyword.operator.increment.tsx", + "match": "\\+\\+" + }, + { + "name": "keyword.operator.arithmetic.tsx", + "match": "%|\\*|/|-|\\+" + }, + { + "begin": "(?<=[_$[:alnum:])\\]])\\s*(?=(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)+(/)(?![/*]))", + "end": "(/)(?!\\*([^\\*]|(\\*[^\\/]))*\\*\\/)", + "endCaptures": { + "1": { + "name": "keyword.operator.arithmetic.tsx" + } + }, + "patterns": [ + { + "include": "#comment" + } + ] + }, + { + "match": "(?<=[_$[:alnum:])\\]])\\s*(/)(?![/*])", + "captures": { + "1": { + "name": "keyword.operator.arithmetic.tsx" + } + } + } + ] + }, + "typeof-operator": { + "name": "keyword.operator.expression.typeof.tsx", + "match": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))typeof(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))" + }, + "literal": { + "patterns": [ + { + "include": "#numeric-literal" + }, + { + "include": "#boolean-literal" + }, + { + "include": "#null-literal" + }, + { + "include": "#undefined-literal" + }, + { + "include": "#numericConstant-literal" + }, + { + "include": "#array-literal" + }, + { + "include": "#this-literal" + }, + { + "include": "#super-literal" + } + ] + }, + "array-literal": { + "name": "meta.array.literal.tsx", + "begin": "\\s*(\\[)", + "beginCaptures": { + "1": { + "name": "meta.brace.square.tsx" + } + }, + "end": "\\]", + "endCaptures": { + "0": { + "name": "meta.brace.square.tsx" + } + }, + "patterns": [ + { + "include": "#expression" + }, + { + "include": "#punctuation-comma" + } + ] + }, + "numeric-literal": { + "patterns": [ + { + "name": "constant.numeric.hex.tsx", + "match": "\\b(?<!\\$)0(?:x|X)[0-9a-fA-F][0-9a-fA-F_]*(n)?\\b(?!\\$)", + "captures": { + "1": { + "name": "storage.type.numeric.bigint.tsx" + } + } + }, + { + "name": "constant.numeric.binary.tsx", + "match": "\\b(?<!\\$)0(?:b|B)[01][01_]*(n)?\\b(?!\\$)", + "captures": { + "1": { + "name": "storage.type.numeric.bigint.tsx" + } + } + }, + { + "name": "constant.numeric.octal.tsx", + "match": "\\b(?<!\\$)0(?:o|O)?[0-7][0-7_]*(n)?\\b(?!\\$)", + "captures": { + "1": { + "name": "storage.type.numeric.bigint.tsx" + } + } + }, + { + "match": "(?x)\n(?<!\\$)(?:\n (?:\\b[0-9][0-9_]*(\\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\\b)| # 1.1E+3\n (?:\\b[0-9][0-9_]*(\\.)[eE][+-]?[0-9][0-9_]*(n)?\\b)| # 1.E+3\n (?:\\B(\\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\\b)| # .1E+3\n (?:\\b[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\\b)| # 1E+3\n (?:\\b[0-9][0-9_]*(\\.)[0-9][0-9_]*(n)?\\b)| # 1.1\n (?:\\b[0-9][0-9_]*(\\.)(n)?\\B)| # 1.\n (?:\\B(\\.)[0-9][0-9_]*(n)?\\b)| # .1\n (?:\\b[0-9][0-9_]*(n)?\\b(?!\\.)) # 1\n)(?!\\$)", + "captures": { + "0": { + "name": "constant.numeric.decimal.tsx" + }, + "1": { + "name": "meta.delimiter.decimal.period.tsx" + }, + "2": { + "name": "storage.type.numeric.bigint.tsx" + }, + "3": { + "name": "meta.delimiter.decimal.period.tsx" + }, + "4": { + "name": "storage.type.numeric.bigint.tsx" + }, + "5": { + "name": "meta.delimiter.decimal.period.tsx" + }, + "6": { + "name": "storage.type.numeric.bigint.tsx" + }, + "7": { + "name": "storage.type.numeric.bigint.tsx" + }, + "8": { + "name": "meta.delimiter.decimal.period.tsx" + }, + "9": { + "name": "storage.type.numeric.bigint.tsx" + }, + "10": { + "name": "meta.delimiter.decimal.period.tsx" + }, + "11": { + "name": "storage.type.numeric.bigint.tsx" + }, + "12": { + "name": "meta.delimiter.decimal.period.tsx" + }, + "13": { + "name": "storage.type.numeric.bigint.tsx" + }, + "14": { + "name": "storage.type.numeric.bigint.tsx" + } + } + } + ] + }, + "boolean-literal": { + "patterns": [ + { + "name": "constant.language.boolean.true.tsx", + "match": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))true(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))" + }, + { + "name": "constant.language.boolean.false.tsx", + "match": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))false(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))" + } + ] + }, + "null-literal": { + "name": "constant.language.null.tsx", + "match": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))null(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))" + }, + "this-literal": { + "name": "variable.language.this.tsx", + "match": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))this\\b(?!\\$)" + }, + "super-literal": { + "name": "variable.language.super.tsx", + "match": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))super\\b(?!\\$)" + }, + "undefined-literal": { + "name": "constant.language.undefined.tsx", + "match": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))undefined(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))" + }, + "numericConstant-literal": { + "patterns": [ + { + "name": "constant.language.nan.tsx", + "match": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))NaN(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))" + }, + { + "name": "constant.language.infinity.tsx", + "match": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))Infinity(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))" + } + ] + }, + "support-objects": { + "patterns": [ + { + "name": "variable.language.arguments.tsx", + "match": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(arguments)\\b(?!\\$)" + }, + { + "name": "support.class.builtin.tsx", + "match": "(?x)(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(Array|ArrayBuffer|Atomics|BigInt|BigInt64Array|BigUint64Array|Boolean|DataView|Date|Float32Array\n |Float64Array|Function|Generator|GeneratorFunction|Int8Array|Int16Array|Int32Array|Intl|Map|Number|Object|Proxy\n |Reflect|RegExp|Set|SharedArrayBuffer|SIMD|String|Symbol|TypedArray\n |Uint8Array|Uint16Array|Uint32Array|Uint8ClampedArray|WeakMap|WeakSet)\\b(?!\\$)" + }, + { + "name": "support.class.error.tsx", + "match": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))((Eval|Internal|Range|Reference|Syntax|Type|URI)?Error)\\b(?!\\$)" + }, + { + "name": "support.class.promise.tsx", + "match": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(Promise)\\b(?!\\$)" + }, + { + "name": "support.function.tsx", + "match": "(?x)(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(clear(Interval|Timeout)|decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|escape|eval|\n isFinite|isNaN|parseFloat|parseInt|require|set(Interval|Timeout)|super|unescape|uneval)(?=\\s*\\()" + }, + { + "match": "(?x)(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(Math)(?:\\s*(?:(\\.)|(\\?\\.(?!\\s*[[:digit:]])))\\s*(?:\n (abs|acos|acosh|asin|asinh|atan|atan2|atanh|cbrt|ceil|clz32|cos|cosh|exp|\n expm1|floor|fround|hypot|imul|log|log10|log1p|log2|max|min|pow|random|\n round|sign|sin|sinh|sqrt|tan|tanh|trunc)\n |\n (E|LN10|LN2|LOG10E|LOG2E|PI|SQRT1_2|SQRT2)))?\\b(?!\\$)", + "captures": { + "1": { + "name": "support.constant.math.tsx" + }, + "2": { + "name": "punctuation.accessor.tsx" + }, + "3": { + "name": "punctuation.accessor.optional.tsx" + }, + "4": { + "name": "support.function.math.tsx" + }, + "5": { + "name": "support.constant.property.math.tsx" + } + } + }, + { + "match": "(?x)(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(console)(?:\\s*(?:(\\.)|(\\?\\.(?!\\s*[[:digit:]])))\\s*(\n assert|clear|count|debug|dir|error|group|groupCollapsed|groupEnd|info|log\n |profile|profileEnd|table|time|timeEnd|timeStamp|trace|warn))?\\b(?!\\$)", + "captures": { + "1": { + "name": "support.class.console.tsx" + }, + "2": { + "name": "punctuation.accessor.tsx" + }, + "3": { + "name": "punctuation.accessor.optional.tsx" + }, + "4": { + "name": "support.function.console.tsx" + } + } + }, + { + "match": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(JSON)(?:\\s*(?:(\\.)|(\\?\\.(?!\\s*[[:digit:]])))\\s*(parse|stringify))?\\b(?!\\$)", + "captures": { + "1": { + "name": "support.constant.json.tsx" + }, + "2": { + "name": "punctuation.accessor.tsx" + }, + "3": { + "name": "punctuation.accessor.optional.tsx" + }, + "4": { + "name": "support.function.json.tsx" + } + } + }, + { + "match": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(import)\\s*(?:(\\.)|(\\?\\.(?!\\s*[[:digit:]])))\\s*(meta)\\b(?!\\$)", + "captures": { + "1": { + "name": "keyword.control.import.tsx" + }, + "2": { + "name": "punctuation.accessor.tsx" + }, + "3": { + "name": "punctuation.accessor.optional.tsx" + }, + "4": { + "name": "support.variable.property.importmeta.tsx" + } + } + }, + { + "match": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(new)\\s*(?:(\\.)|(\\?\\.(?!\\s*[[:digit:]])))\\s*(target)\\b(?!\\$)", + "captures": { + "1": { + "name": "keyword.operator.new.tsx" + }, + "2": { + "name": "punctuation.accessor.tsx" + }, + "3": { + "name": "punctuation.accessor.optional.tsx" + }, + "4": { + "name": "support.variable.property.target.tsx" + } + } + }, + { + "match": "(?x) (?:(\\.)|(\\?\\.(?!\\s*[[:digit:]]))) \\s* (?:\n (?:(constructor|length|prototype|__proto__)\\b(?!\\$|\\s*(<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\\())\n |\n (?:(EPSILON|MAX_SAFE_INTEGER|MAX_VALUE|MIN_SAFE_INTEGER|MIN_VALUE|NEGATIVE_INFINITY|POSITIVE_INFINITY)\\b(?!\\$)))", + "captures": { + "1": { + "name": "punctuation.accessor.tsx" + }, + "2": { + "name": "punctuation.accessor.optional.tsx" + }, + "3": { + "name": "support.variable.property.tsx" + }, + "4": { + "name": "support.constant.tsx" + } + } + }, + { + "name": "support.class.node.tsx", + "match": "(?x)(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(Buffer|EventEmitter|Server|Pipe|Socket|REPLServer|ReadStream|WriteStream|Stream\n |Inflate|Deflate|InflateRaw|DeflateRaw|GZip|GUnzip|Unzip|Zip)\\b(?!\\$)" + }, + { + "match": "(?x)(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(process)(?:(?:(\\.)|(\\?\\.(?!\\s*[[:digit:]])))(?:\n (arch|argv|config|connected|env|execArgv|execPath|exitCode|mainModule|pid|platform|release|stderr|stdin|stdout|title|version|versions)\n |\n (abort|chdir|cwd|disconnect|exit|[sg]ete?[gu]id|send|[sg]etgroups|initgroups|kill|memoryUsage|nextTick|umask|uptime|hrtime)\n))?\\b(?!\\$)", + "captures": { + "1": { + "name": "support.variable.object.process.tsx" + }, + "2": { + "name": "punctuation.accessor.tsx" + }, + "3": { + "name": "punctuation.accessor.optional.tsx" + }, + "4": { + "name": "support.variable.property.process.tsx" + }, + "5": { + "name": "support.function.process.tsx" + } + } + }, + { + "match": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(?:(exports)|(module)(?:(?:(\\.)|(\\?\\.(?!\\s*[[:digit:]])))(exports|id|filename|loaded|parent|children))?)\\b(?!\\$)", + "captures": { + "1": { + "name": "support.type.object.module.tsx" + }, + "2": { + "name": "support.type.object.module.tsx" + }, + "3": { + "name": "punctuation.accessor.tsx" + }, + "4": { + "name": "punctuation.accessor.optional.tsx" + }, + "5": { + "name": "support.type.object.module.tsx" + } + } + }, + { + "name": "support.variable.object.node.tsx", + "match": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(global|GLOBAL|root|__dirname|__filename)\\b(?!\\$)" + } + ] + }, + "identifiers": { + "patterns": [ + { + "include": "#object-identifiers" + }, + { + "match": "(?x)(?:(?:(\\.)|(\\?\\.(?!\\s*[[:digit:]])))\\s*)?([_$[:alpha:]][_$[:alnum:]]*)(?=\\s*=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n))", + "captures": { + "1": { + "name": "punctuation.accessor.tsx" + }, + "2": { + "name": "punctuation.accessor.optional.tsx" + }, + "3": { + "name": "entity.name.function.tsx" + } + } + }, + { + "match": "(?:(\\.)|(\\?\\.(?!\\s*[[:digit:]])))\\s*([[:upper:]][_$[:digit:][:upper:]]*)(?![_$[:alnum:]])", + "captures": { + "1": { + "name": "punctuation.accessor.tsx" + }, + "2": { + "name": "punctuation.accessor.optional.tsx" + }, + "3": { + "name": "variable.other.constant.property.tsx" + } + } + }, + { + "match": "(?:(\\.)|(\\?\\.(?!\\s*[[:digit:]])))\\s*([_$[:alpha:]][_$[:alnum:]]*)", + "captures": { + "1": { + "name": "punctuation.accessor.tsx" + }, + "2": { + "name": "punctuation.accessor.optional.tsx" + }, + "3": { + "name": "variable.other.property.tsx" + } + } + }, + { + "name": "variable.other.constant.tsx", + "match": "([[:upper:]][_$[:digit:][:upper:]]*)(?![_$[:alnum:]])" + }, + { + "name": "variable.other.readwrite.tsx", + "match": "[_$[:alpha:]][_$[:alnum:]]*" + } + ] + }, + "object-identifiers": { + "patterns": [ + { + "name": "support.class.tsx", + "match": "([_$[:alpha:]][_$[:alnum:]]*)(?=\\s*\\??\\.\\s*prototype\\b(?!\\$))" + }, + { + "match": "(?x)(?:(\\.)|(\\?\\.(?!\\s*[[:digit:]])))\\s*(?:\n ([[:upper:]][_$[:digit:][:upper:]]*) |\n ([_$[:alpha:]][_$[:alnum:]]*)\n)(?=\\s*\\??\\.\\s*[_$[:alpha:]][_$[:alnum:]]*)", + "captures": { + "1": { + "name": "punctuation.accessor.tsx" + }, + "2": { + "name": "punctuation.accessor.optional.tsx" + }, + "3": { + "name": "variable.other.constant.object.property.tsx" + }, + "4": { + "name": "variable.other.object.property.tsx" + } + } + }, + { + "match": "(?x)(?:\n ([[:upper:]][_$[:digit:][:upper:]]*) |\n ([_$[:alpha:]][_$[:alnum:]]*)\n)(?=\\s*\\??\\.\\s*[_$[:alpha:]][_$[:alnum:]]*)", + "captures": { + "1": { + "name": "variable.other.constant.object.tsx" + }, + "2": { + "name": "variable.other.object.tsx" + } + } + } + ] + }, + "type-annotation": { + "patterns": [ + { + "name": "meta.type.annotation.tsx", + "begin": "(:)(?=\\s*\\S)", + "beginCaptures": { + "1": { + "name": "keyword.operator.type.annotation.tsx" + } + }, + "end": "(?<![:|&])((?=$|^|[,);\\}\\]]|//)|(?==[^>])|((?<=[\\}>\\]\\)]|[_$[:alpha:]])\\s*(?=\\{)))", + "patterns": [ + { + "include": "#type" + } + ] + }, + { + "name": "meta.type.annotation.tsx", + "begin": "(:)", + "beginCaptures": { + "1": { + "name": "keyword.operator.type.annotation.tsx" + } + }, + "end": "(?<![:|&])((?=[,);\\}\\]]|//)|(?==[^>])|(?=^\\s*$)|((?<=\\S)(?=\\s*$))|((?<=[\\}>\\]\\)]|[_$[:alpha:]])\\s*(?=\\{)))", + "patterns": [ + { + "include": "#type" + } + ] + } + ] + }, + "parameter-type-annotation": { + "patterns": [ + { + "name": "meta.type.annotation.tsx", + "begin": "(:)", + "beginCaptures": { + "1": { + "name": "keyword.operator.type.annotation.tsx" + } + }, + "end": "(?=[,)])|(?==[^>])", + "patterns": [ + { + "include": "#type" + } + ] + } + ] + }, + "return-type": { + "patterns": [ + { + "name": "meta.return.type.tsx", + "begin": "(?<=\\))\\s*(:)(?=\\s*\\S)", + "beginCaptures": { + "1": { + "name": "keyword.operator.type.annotation.tsx" + } + }, + "end": "(?<![:|&])(?=$|^|[{};,]|//)", + "patterns": [ + { + "include": "#return-type-core" + } + ] + }, + { + "name": "meta.return.type.tsx", + "begin": "(?<=\\))\\s*(:)", + "beginCaptures": { + "1": { + "name": "keyword.operator.type.annotation.tsx" + } + }, + "end": "(?<![:|&])((?=[{};,]|//|^\\s*$)|((?<=\\S)(?=\\s*$)))", + "patterns": [ + { + "include": "#return-type-core" + } + ] + } + ] + }, + "return-type-core": { + "patterns": [ + { + "include": "#comment" + }, + { + "begin": "(?<=[:|&])(?=\\s*\\{)", + "end": "(?<=\\})", + "patterns": [ + { + "include": "#type-object" + } + ] + }, + { + "include": "#type-predicate-operator" + }, + { + "include": "#type" + } + ] + }, + "arrow-return-type": { + "name": "meta.return.type.arrow.tsx", + "begin": "(?<=\\))\\s*(:)", + "beginCaptures": { + "1": { + "name": "keyword.operator.type.annotation.tsx" + } + }, + "end": "(?==>|\\{|(^\\s*(export|function|class|interface|let|var|const|import|enum|namespace|module|type|abstract|declare)\\s+))", + "patterns": [ + { + "include": "#arrow-return-type-body" + } + ] + }, + "possibly-arrow-return-type": { + "begin": "(?<=\\)|^)\\s*(:)(?=\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*=>)", + "beginCaptures": { + "1": { + "name": "meta.arrow.tsx meta.return.type.arrow.tsx keyword.operator.type.annotation.tsx" + } + }, + "end": "(?==>|\\{|(^\\s*(export|function|class|interface|let|var|const|import|enum|namespace|module|type|abstract|declare)\\s+))", + "contentName": "meta.arrow.tsx meta.return.type.arrow.tsx", + "patterns": [ + { + "include": "#arrow-return-type-body" + } + ] + }, + "arrow-return-type-body": { + "patterns": [ + { + "begin": "(?<=[:])(?=\\s*\\{)", + "end": "(?<=\\})", + "patterns": [ + { + "include": "#type-object" + } + ] + }, + { + "include": "#type-predicate-operator" + }, + { + "include": "#type" + } + ] + }, + "type-parameters": { + "name": "meta.type.parameters.tsx", + "begin": "(<)", + "beginCaptures": { + "1": { + "name": "punctuation.definition.typeparameters.begin.tsx" + } + }, + "end": "(>)", + "endCaptures": { + "1": { + "name": "punctuation.definition.typeparameters.end.tsx" + } + }, + "patterns": [ + { + "include": "#comment" + }, + { + "name": "storage.modifier.tsx", + "match": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(extends)(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))" + }, + { + "include": "#type" + }, + { + "include": "#punctuation-comma" + }, + { + "name": "keyword.operator.assignment.tsx", + "match": "(=)(?!>)" + } + ] + }, + "type-arguments": { + "name": "meta.type.parameters.tsx", + "begin": "\\<", + "beginCaptures": { + "0": { + "name": "punctuation.definition.typeparameters.begin.tsx" + } + }, + "end": "\\>", + "endCaptures": { + "0": { + "name": "punctuation.definition.typeparameters.end.tsx" + } + }, + "patterns": [ + { + "include": "#type-arguments-body" + } + ] + }, + "type-arguments-body": { + "patterns": [ + { + "match": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(_)(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))", + "captures": { + "0": { + "name": "keyword.operator.type.tsx" + } + } + }, + { + "include": "#type" + }, + { + "include": "#punctuation-comma" + } + ] + }, + "type": { + "patterns": [ + { + "include": "#comment" + }, + { + "include": "#string" + }, + { + "include": "#numeric-literal" + }, + { + "include": "#type-primitive" + }, + { + "include": "#type-builtin-literals" + }, + { + "include": "#type-parameters" + }, + { + "include": "#type-tuple" + }, + { + "include": "#type-object" + }, + { + "include": "#type-conditional" + }, + { + "include": "#type-operators" + }, + { + "include": "#type-fn-type-parameters" + }, + { + "include": "#type-paren-or-function-parameters" + }, + { + "include": "#type-function-return-type" + }, + { + "match": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(readonly)(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))\\s*", + "captures": { + "1": { + "name": "storage.modifier.tsx" + } + } + }, + { + "include": "#type-name" + } + ] + }, + "type-primitive": { + "name": "support.type.primitive.tsx", + "match": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(string|number|bigint|boolean|symbol|any|void|never|unknown)(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))" + }, + "type-builtin-literals": { + "name": "support.type.builtin.tsx", + "match": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(this|true|false|undefined|null|object)(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))" + }, + "type-tuple": { + "name": "meta.type.tuple.tsx", + "begin": "\\[", + "beginCaptures": { + "0": { + "name": "meta.brace.square.tsx" + } + }, + "end": "\\]", + "endCaptures": { + "0": { + "name": "meta.brace.square.tsx" + } + }, + "patterns": [ + { + "include": "#type" + }, + { + "include": "#punctuation-comma" + } + ] + }, + "type-object": { + "name": "meta.object.type.tsx", + "begin": "\\{", + "beginCaptures": { + "0": { + "name": "punctuation.definition.block.tsx" + } + }, + "end": "\\}", + "endCaptures": { + "0": { + "name": "punctuation.definition.block.tsx" + } + }, + "patterns": [ + { + "include": "#comment" + }, + { + "include": "#method-declaration" + }, + { + "include": "#indexer-declaration" + }, + { + "include": "#indexer-mapped-type-declaration" + }, + { + "include": "#field-declaration" + }, + { + "include": "#type-annotation" + }, + { + "begin": "\\.\\.\\.", + "beginCaptures": { + "0": { + "name": "keyword.operator.spread.tsx" + } + }, + "end": "(?=\\}|;|,|$)|(?<=\\})", + "patterns": [ + { + "include": "#type" + } + ] + }, + { + "include": "#punctuation-comma" + }, + { + "include": "#punctuation-semicolon" + }, + { + "include": "#type" + } + ] + }, + "type-conditional": { + "patterns": [ + { + "begin": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(extends)\\s+", + "beginCaptures": { + "1": { + "name": "storage.modifier.tsx" + } + }, + "end": "(?<=:)", + "patterns": [ + { + "begin": "\\?", + "beginCaptures": { + "0": { + "name": "keyword.operator.ternary.tsx" + } + }, + "end": ":", + "endCaptures": { + "0": { + "name": "keyword.operator.ternary.tsx" + } + }, + "patterns": [ + { + "include": "#type" + } + ] + }, + { + "include": "#type" + } + ] + } + ] + }, + "type-paren-or-function-parameters": { + "name": "meta.type.paren.cover.tsx", + "begin": "\\(", + "beginCaptures": { + "0": { + "name": "meta.brace.round.tsx" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "meta.brace.round.tsx" + } + }, + "patterns": [ + { + "match": "(?x)(?:(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(public|private|protected|readonly)\\s+)?(?:(\\.\\.\\.)\\s*)?(?<!=|:)(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(?:(this)|([_$[:alpha:]][_$[:alnum:]]*))\\s*(\\??)(?=\\s*(:\\s*(\n (<) |\n ([(]\\s*(\n ([)]) |\n (\\.\\.\\.) |\n ([_$[:alnum:]]+\\s*(\n ([:,?=])|\n ([)]\\s*=>)\n ))\n ))\n)) |\n(:\\s*(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))Function(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))) |\n(:\\s*((<\\s*$)|([\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*))))))))", + "captures": { + "1": { + "name": "storage.modifier.tsx" + }, + "2": { + "name": "keyword.operator.rest.tsx" + }, + "3": { + "name": "entity.name.function.tsx variable.language.this.tsx" + }, + "4": { + "name": "entity.name.function.tsx" + }, + "5": { + "name": "keyword.operator.optional.tsx" + } + } + }, + { + "match": "(?x)(?:(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(public|private|protected|readonly)\\s+)?(?:(\\.\\.\\.)\\s*)?(?<!=|:)(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(?:(this)|([_$[:alpha:]][_$[:alnum:]]*))\\s*(\\??)(?=:)", + "captures": { + "1": { + "name": "storage.modifier.tsx" + }, + "2": { + "name": "keyword.operator.rest.tsx" + }, + "3": { + "name": "variable.parameter.tsx variable.language.this.tsx" + }, + "4": { + "name": "variable.parameter.tsx" + }, + "5": { + "name": "keyword.operator.optional.tsx" + } + } + }, + { + "include": "#type-annotation" + }, + { + "name": "punctuation.separator.parameter.tsx", + "match": "," + }, + { + "include": "#type" + } + ] + }, + "type-fn-type-parameters": { + "patterns": [ + { + "begin": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(new)\\b(?=\\s*\\<)", + "beginCaptures": { + "1": { + "name": "meta.type.constructor.tsx keyword.control.new.tsx" + } + }, + "end": "(?<=>)", + "patterns": [ + { + "include": "#comment" + }, + { + "include": "#type-parameters" + } + ] + }, + { + "name": "meta.type.constructor.tsx", + "begin": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(new)\\b\\s*(?=\\()", + "beginCaptures": { + "1": { + "name": "keyword.control.new.tsx" + } + }, + "end": "(?<=\\))", + "patterns": [ + { + "include": "#function-parameters" + } + ] + }, + { + "name": "meta.type.function.tsx", + "begin": "(?x)(\n (?=\n [(]\\s*(\n ([)]) |\n (\\.\\.\\.) |\n ([_$[:alnum:]]+\\s*(\n ([:,?=])|\n ([)]\\s*=>)\n ))\n )\n )\n)", + "end": "(?<=\\))", + "patterns": [ + { + "include": "#function-parameters" + } + ] + } + ] + }, + "type-function-return-type": { + "patterns": [ + { + "name": "meta.type.function.return.tsx", + "begin": "(=>)(?=\\s*\\S)", + "beginCaptures": { + "1": { + "name": "storage.type.function.arrow.tsx" + } + }, + "end": "(?<!=>)(?<![|&])(?=[,\\]\\)\\{\\}=;>:\\?]|//|$)", + "patterns": [ + { + "include": "#type-function-return-type-core" + } + ] + }, + { + "name": "meta.type.function.return.tsx", + "begin": "=>", + "beginCaptures": { + "0": { + "name": "storage.type.function.arrow.tsx" + } + }, + "end": "(?<!=>)(?<![|&])((?=[,\\]\\)\\{\\}=;:\\?>]|//|^\\s*$)|((?<=\\S)(?=\\s*$)))", + "patterns": [ + { + "include": "#type-function-return-type-core" + } + ] + } + ] + }, + "type-function-return-type-core": { + "patterns": [ + { + "include": "#comment" + }, + { + "begin": "(?<==>)(?=\\s*\\{)", + "end": "(?<=\\})", + "patterns": [ + { + "include": "#type-object" + } + ] + }, + { + "include": "#type-predicate-operator" + }, + { + "include": "#type" + } + ] + }, + "type-operators": { + "patterns": [ + { + "include": "#typeof-operator" + }, + { + "begin": "([&|])(?=\\s*\\{)", + "beginCaptures": { + "0": { + "name": "keyword.operator.type.tsx" + } + }, + "end": "(?<=\\})", + "patterns": [ + { + "include": "#type-object" + } + ] + }, + { + "begin": "[&|]", + "beginCaptures": { + "0": { + "name": "keyword.operator.type.tsx" + } + }, + "end": "(?=\\S)" + }, + { + "name": "keyword.operator.expression.keyof.tsx", + "match": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))keyof(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))" + }, + { + "name": "keyword.operator.ternary.tsx", + "match": "(\\?|\\:)" + }, + { + "name": "keyword.operator.expression.infer.tsx", + "match": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))infer(?=\\s+[_$[:alpha:]])" + }, + { + "name": "keyword.operator.expression.import.tsx", + "match": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))import(?=\\s*\\()" + } + ] + }, + "type-predicate-operator": { + "patterns": [ + { + "match": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(?:(asserts)\\s+)?(?!asserts)(?:(this)|([_$[:alpha:]][_$[:alnum:]]*))\\s(is)(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))", + "captures": { + "1": { + "name": "keyword.operator.type.asserts.tsx" + }, + "2": { + "name": "variable.parameter.tsx variable.language.this.tsx" + }, + "3": { + "name": "variable.parameter.tsx" + }, + "4": { + "name": "keyword.operator.expression.is.tsx" + } + } + }, + { + "match": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(asserts)\\s+(?!is)(?:(this)|([_$[:alpha:]][_$[:alnum:]]*))(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))", + "captures": { + "1": { + "name": "keyword.operator.type.asserts.tsx" + }, + "2": { + "name": "variable.parameter.tsx variable.language.this.tsx" + }, + "3": { + "name": "variable.parameter.tsx" + } + } + }, + { + "name": "keyword.operator.type.asserts.tsx", + "match": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))asserts(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))" + }, + { + "name": "keyword.operator.expression.is.tsx", + "match": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))is(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))" + } + ] + }, + "type-name": { + "patterns": [ + { + "begin": "([_$[:alpha:]][_$[:alnum:]]*)\\s*(?:(\\.)|(\\?\\.(?!\\s*[[:digit:]])))\\s*(<)", + "captures": { + "1": { + "name": "entity.name.type.module.tsx" + }, + "2": { + "name": "punctuation.accessor.tsx" + }, + "3": { + "name": "punctuation.accessor.optional.tsx" + }, + "4": { + "name": "meta.type.parameters.tsx punctuation.definition.typeparameters.begin.tsx" + } + }, + "end": "(>)", + "endCaptures": { + "1": { + "name": "meta.type.parameters.tsx punctuation.definition.typeparameters.end.tsx" + } + }, + "contentName": "meta.type.parameters.tsx", + "patterns": [ + { + "include": "#type-arguments-body" + } + ] + }, + { + "begin": "([_$[:alpha:]][_$[:alnum:]]*)\\s*(<)", + "beginCaptures": { + "1": { + "name": "entity.name.type.tsx" + }, + "2": { + "name": "meta.type.parameters.tsx punctuation.definition.typeparameters.begin.tsx" + } + }, + "end": "(>)", + "endCaptures": { + "1": { + "name": "meta.type.parameters.tsx punctuation.definition.typeparameters.end.tsx" + } + }, + "contentName": "meta.type.parameters.tsx", + "patterns": [ + { + "include": "#type-arguments-body" + } + ] + }, + { + "match": "([_$[:alpha:]][_$[:alnum:]]*)\\s*(?:(\\.)|(\\?\\.(?!\\s*[[:digit:]])))", + "captures": { + "1": { + "name": "entity.name.type.module.tsx" + }, + "2": { + "name": "punctuation.accessor.tsx" + }, + "3": { + "name": "punctuation.accessor.optional.tsx" + } + } + }, + { + "name": "entity.name.type.tsx", + "match": "[_$[:alpha:]][_$[:alnum:]]*" + } + ] + }, + "punctuation-comma": { + "name": "punctuation.separator.comma.tsx", + "match": "," + }, + "punctuation-semicolon": { + "name": "punctuation.terminator.statement.tsx", + "match": ";" + }, + "punctuation-accessor": { + "match": "(?:(\\.)|(\\?\\.(?!\\s*[[:digit:]])))", + "captures": { + "1": { + "name": "punctuation.accessor.tsx" + }, + "2": { + "name": "punctuation.accessor.optional.tsx" + } + } + }, + "string": { + "patterns": [ + { + "include": "#qstring-single" + }, + { + "include": "#qstring-double" + }, + { + "include": "#template" + } + ] + }, + "qstring-double": { + "name": "string.quoted.double.tsx", + "begin": "\"", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.tsx" + } + }, + "end": "(\")|((?:[^\\\\\\n])$)", + "endCaptures": { + "1": { + "name": "punctuation.definition.string.end.tsx" + }, + "2": { + "name": "invalid.illegal.newline.tsx" + } + }, + "patterns": [ + { + "include": "#string-character-escape" + } + ] + }, + "qstring-single": { + "name": "string.quoted.single.tsx", + "begin": "'", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.tsx" + } + }, + "end": "(\\')|((?:[^\\\\\\n])$)", + "endCaptures": { + "1": { + "name": "punctuation.definition.string.end.tsx" + }, + "2": { + "name": "invalid.illegal.newline.tsx" + } + }, + "patterns": [ + { + "include": "#string-character-escape" + } + ] + }, + "string-character-escape": { + "name": "constant.character.escape.tsx", + "match": "\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4}|u\\{[0-9A-Fa-f]+\\}|[0-2][0-7]{0,2}|3[0-6][0-7]?|37[0-7]?|[4-7][0-7]?|.|$)" + }, + "template": { + "patterns": [ + { + "name": "string.template.tsx", + "begin": "(?=(([_$[:alpha:]][_$[:alnum:]]*\\s*\\??\\.\\s*)*|(\\??\\.\\s*)?)([_$[:alpha:]][_$[:alnum:]]*)(<\\s*(((keyof|infer|typeof)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\'[^\\']*\\')|(\\\"[^\\\"]*\\\")|(\\`[^\\`]*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\'[^\\']*\\')|(\\\"[^\\\"]*\\\")|(\\`[^\\`]*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))(([^<>\\(]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\'[^\\']*\\')|(\\\"[^\\\"]*\\\")|(\\`[^\\`]*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(?<==)\\>)*(?<!=)\\>))*(?<!=)\\>)*(?<!=)>\\s*)?`)", + "end": "(?=`)", + "patterns": [ + { + "begin": "(?=(([_$[:alpha:]][_$[:alnum:]]*\\s*\\??\\.\\s*)*|(\\??\\.\\s*)?)([_$[:alpha:]][_$[:alnum:]]*))", + "end": "(?=(<\\s*(((keyof|infer|typeof)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\'[^\\']*\\')|(\\\"[^\\\"]*\\\")|(\\`[^\\`]*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\'[^\\']*\\')|(\\\"[^\\\"]*\\\")|(\\`[^\\`]*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))(([^<>\\(]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\'[^\\']*\\')|(\\\"[^\\\"]*\\\")|(\\`[^\\`]*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(?<==)\\>)*(?<!=)\\>))*(?<!=)\\>)*(?<!=)>\\s*)?`)", + "patterns": [ + { + "include": "#support-function-call-identifiers" + }, + { + "name": "entity.name.function.tagged-template.tsx", + "match": "([_$[:alpha:]][_$[:alnum:]]*)" + } + ] + }, + { + "include": "#type-arguments" + } + ] + }, + { + "name": "string.template.tsx", + "begin": "([_$[:alpha:]][_$[:alnum:]]*)\\s*(?=(<\\s*(((keyof|infer|typeof)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\'[^\\']*\\')|(\\\"[^\\\"]*\\\")|(\\`[^\\`]*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\'[^\\']*\\')|(\\\"[^\\\"]*\\\")|(\\`[^\\`]*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))(([^<>\\(]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\'[^\\']*\\')|(\\\"[^\\\"]*\\\")|(\\`[^\\`]*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(?<==)\\>)*(?<!=)\\>))*(?<!=)\\>)*(?<!=)>\\s*)`)", + "beginCaptures": { + "1": { + "name": "entity.name.function.tagged-template.tsx" + } + }, + "end": "(?=`)", + "patterns": [ + { + "include": "#type-arguments" + } + ] + }, + { + "name": "string.template.tsx", + "begin": "([_$[:alpha:]][_$[:alnum:]]*)?(`)", + "beginCaptures": { + "1": { + "name": "entity.name.function.tagged-template.tsx" + }, + "2": { + "name": "punctuation.definition.string.template.begin.tsx" + } + }, + "end": "`", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.template.end.tsx" + } + }, + "patterns": [ + { + "include": "#template-substitution-element" + }, + { + "include": "#string-character-escape" + } + ] + } + ] + }, + "template-substitution-element": { + "name": "meta.template.expression.tsx", + "begin": "\\$\\{", + "beginCaptures": { + "0": { + "name": "punctuation.definition.template-expression.begin.tsx" + } + }, + "end": "\\}", + "endCaptures": { + "0": { + "name": "punctuation.definition.template-expression.end.tsx" + } + }, + "patterns": [ + { + "include": "#expression" + } + ], + "contentName": "meta.embedded.line.tsx" + }, + "regex": { + "patterns": [ + { + "name": "string.regexp.tsx", + "begin": "(?<!\\+\\+|--|})(?<=[=(:,\\[?+!]|^return|[^\\._$[:alnum:]]return|^case|[^\\._$[:alnum:]]case|=>|&&|\\|\\||\\*\\/)\\s*(\\/)(?![\\/*])(?=(?:[^\\/\\\\\\[\\()]|\\\\.|\\[([^\\]\\\\]|\\\\.)+\\]|\\(([^\\)\\\\]|\\\\.)+\\))+\\/([gimsuy]+|(?![\\/\\*])|(?=\\/\\*))(?!\\s*[a-zA-Z0-9_$]))", + "beginCaptures": { + "1": { + "name": "punctuation.definition.string.begin.tsx" + } + }, + "end": "(/)([gimsuy]*)", + "endCaptures": { + "1": { + "name": "punctuation.definition.string.end.tsx" + }, + "2": { + "name": "keyword.other.tsx" + } + }, + "patterns": [ + { + "include": "#regexp" + } + ] + }, + { + "name": "string.regexp.tsx", + "begin": "((?<![_$[:alnum:])\\]]|\\+\\+|--|}|\\*\\/)|((?<=^return|[^\\._$[:alnum:]]return|^case|[^\\._$[:alnum:]]case))\\s*)\\/(?![\\/*])(?=(?:[^\\/\\\\\\[]|\\\\.|\\[([^\\]\\\\]|\\\\.)+\\])+\\/([gimsuy]+|(?![\\/\\*])|(?=\\/\\*))(?!\\s*[a-zA-Z0-9_$]))", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.tsx" + } + }, + "end": "(/)([gimsuy]*)", + "endCaptures": { + "1": { + "name": "punctuation.definition.string.end.tsx" + }, + "2": { + "name": "keyword.other.tsx" + } + }, + "patterns": [ + { + "include": "#regexp" + } + ] + } + ] + }, + "regexp": { + "patterns": [ + { + "name": "keyword.control.anchor.regexp", + "match": "\\\\[bB]|\\^|\\$" + }, + { + "match": "\\\\[1-9]\\d*|\\\\k<([a-zA-Z_$][\\w$]*)>", + "captures": { + "0": { + "name": "keyword.other.back-reference.regexp" + }, + "1": { + "name": "variable.other.regexp" + } + } + }, + { + "name": "keyword.operator.quantifier.regexp", + "match": "[?+*]|\\{(\\d+,\\d+|\\d+,|,\\d+|\\d+)\\}\\??" + }, + { + "name": "keyword.operator.or.regexp", + "match": "\\|" + }, + { + "name": "meta.group.assertion.regexp", + "begin": "(\\()((\\?=)|(\\?!)|(\\?<=)|(\\?<!))", + "beginCaptures": { + "1": { + "name": "punctuation.definition.group.regexp" + }, + "2": { + "name": "punctuation.definition.group.assertion.regexp" + }, + "3": { + "name": "meta.assertion.look-ahead.regexp" + }, + "4": { + "name": "meta.assertion.negative-look-ahead.regexp" + }, + "5": { + "name": "meta.assertion.look-behind.regexp" + }, + "6": { + "name": "meta.assertion.negative-look-behind.regexp" + } + }, + "end": "(\\))", + "endCaptures": { + "1": { + "name": "punctuation.definition.group.regexp" + } + }, + "patterns": [ + { + "include": "#regexp" + } + ] + }, + { + "name": "meta.group.regexp", + "begin": "\\((?:(\\?:)|(?:\\?<([a-zA-Z_$][\\w$]*)>))?", + "beginCaptures": { + "0": { + "name": "punctuation.definition.group.regexp" + }, + "1": { + "name": "punctuation.definition.group.no-capture.regexp" + }, + "2": { + "name": "variable.other.regexp" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.definition.group.regexp" + } + }, + "patterns": [ + { + "include": "#regexp" + } + ] + }, + { + "name": "constant.other.character-class.set.regexp", + "begin": "(\\[)(\\^)?", + "beginCaptures": { + "1": { + "name": "punctuation.definition.character-class.regexp" + }, + "2": { + "name": "keyword.operator.negation.regexp" + } + }, + "end": "(\\])", + "endCaptures": { + "1": { + "name": "punctuation.definition.character-class.regexp" + } + }, + "patterns": [ + { + "name": "constant.other.character-class.range.regexp", + "match": "(?:.|(\\\\(?:[0-7]{3}|x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4}))|(\\\\c[A-Z])|(\\\\.))\\-(?:[^\\]\\\\]|(\\\\(?:[0-7]{3}|x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4}))|(\\\\c[A-Z])|(\\\\.))", + "captures": { + "1": { + "name": "constant.character.numeric.regexp" + }, + "2": { + "name": "constant.character.control.regexp" + }, + "3": { + "name": "constant.character.escape.backslash.regexp" + }, + "4": { + "name": "constant.character.numeric.regexp" + }, + "5": { + "name": "constant.character.control.regexp" + }, + "6": { + "name": "constant.character.escape.backslash.regexp" + } + } + }, + { + "include": "#regex-character-class" + } + ] + }, + { + "include": "#regex-character-class" + } + ] + }, + "regex-character-class": { + "patterns": [ + { + "name": "constant.other.character-class.regexp", + "match": "\\\\[wWsSdDtrnvf]|\\." + }, + { + "name": "constant.character.numeric.regexp", + "match": "\\\\([0-7]{3}|x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4})" + }, + { + "name": "constant.character.control.regexp", + "match": "\\\\c[A-Z]" + }, + { + "name": "constant.character.escape.backslash.regexp", + "match": "\\\\." + } + ] + }, + "comment": { + "patterns": [ + { + "name": "comment.block.documentation.tsx", + "begin": "/\\*\\*(?!/)", + "beginCaptures": { + "0": { + "name": "punctuation.definition.comment.tsx" + } + }, + "end": "\\*/", + "endCaptures": { + "0": { + "name": "punctuation.definition.comment.tsx" + } + }, + "patterns": [ + { + "include": "#docblock" + } + ] + }, + { + "name": "comment.block.tsx", + "begin": "(/\\*)(?:\\s*((@)internal)(?=\\s|(\\*/)))?", + "beginCaptures": { + "1": { + "name": "punctuation.definition.comment.tsx" + }, + "2": { + "name": "storage.type.internaldeclaration.tsx" + }, + "3": { + "name": "punctuation.decorator.internaldeclaration.tsx" + } + }, + "end": "\\*/", + "endCaptures": { + "0": { + "name": "punctuation.definition.comment.tsx" + } + } + }, + { + "begin": "(^[ \\t]+)?((//)(?:\\s*((@)internal)(?=\\s|$))?)", + "beginCaptures": { + "1": { + "name": "punctuation.whitespace.comment.leading.tsx" + }, + "2": { + "name": "comment.line.double-slash.tsx" + }, + "3": { + "name": "punctuation.definition.comment.tsx" + }, + "4": { + "name": "storage.type.internaldeclaration.tsx" + }, + "5": { + "name": "punctuation.decorator.internaldeclaration.tsx" + } + }, + "end": "(?=$)", + "contentName": "comment.line.double-slash.tsx" + } + ] + }, + "single-line-comment-consuming-line-ending": { + "begin": "(^[ \\t]+)?((//)(?:\\s*((@)internal)(?=\\s|$))?)", + "beginCaptures": { + "1": { + "name": "punctuation.whitespace.comment.leading.tsx" + }, + "2": { + "name": "comment.line.double-slash.tsx" + }, + "3": { + "name": "punctuation.definition.comment.tsx" + }, + "4": { + "name": "storage.type.internaldeclaration.tsx" + }, + "5": { + "name": "punctuation.decorator.internaldeclaration.tsx" + } + }, + "end": "(?=^)", + "contentName": "comment.line.double-slash.tsx" + }, + "directives": { + "name": "comment.line.triple-slash.directive.tsx", + "begin": "^(///)\\s*(?=<(reference|amd-dependency|amd-module)(\\s+(path|types|no-default-lib|lib|name)\\s*=\\s*((\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`)))+\\s*/>\\s*$)", + "beginCaptures": { + "1": { + "name": "punctuation.definition.comment.tsx" + } + }, + "end": "(?=$)", + "patterns": [ + { + "name": "meta.tag.tsx", + "begin": "(<)(reference|amd-dependency|amd-module)", + "beginCaptures": { + "1": { + "name": "punctuation.definition.tag.directive.tsx" + }, + "2": { + "name": "entity.name.tag.directive.tsx" + } + }, + "end": "/>", + "endCaptures": { + "0": { + "name": "punctuation.definition.tag.directive.tsx" + } + }, + "patterns": [ + { + "name": "entity.other.attribute-name.directive.tsx", + "match": "path|types|no-default-lib|lib|name" + }, + { + "name": "keyword.operator.assignment.tsx", + "match": "=" + }, + { + "include": "#string" + } + ] + } + ] + }, + "docblock": { + "patterns": [ + { + "match": "(?x)\n((@)(?:access|api))\n\\s+\n(private|protected|public)\n\\b", + "captures": { + "1": { + "name": "storage.type.class.jsdoc" + }, + "2": { + "name": "punctuation.definition.block.tag.jsdoc" + }, + "3": { + "name": "constant.language.access-type.jsdoc" + } + } + }, + { + "match": "(?x)\n((@)author)\n\\s+\n(\n [^@\\s<>*/]\n (?:[^@<>*/]|\\*[^/])*\n)\n(?:\n \\s*\n (<)\n ([^>\\s]+)\n (>)\n)?", + "captures": { + "1": { + "name": "storage.type.class.jsdoc" + }, + "2": { + "name": "punctuation.definition.block.tag.jsdoc" + }, + "3": { + "name": "entity.name.type.instance.jsdoc" + }, + "4": { + "name": "punctuation.definition.bracket.angle.begin.jsdoc" + }, + "5": { + "name": "constant.other.email.link.underline.jsdoc" + }, + "6": { + "name": "punctuation.definition.bracket.angle.end.jsdoc" + } + } + }, + { + "match": "(?x)\n((@)borrows) \\s+\n((?:[^@\\s*/]|\\*[^/])+) # <that namepath>\n\\s+ (as) \\s+ # as\n((?:[^@\\s*/]|\\*[^/])+) # <this namepath>", + "captures": { + "1": { + "name": "storage.type.class.jsdoc" + }, + "2": { + "name": "punctuation.definition.block.tag.jsdoc" + }, + "3": { + "name": "entity.name.type.instance.jsdoc" + }, + "4": { + "name": "keyword.operator.control.jsdoc" + }, + "5": { + "name": "entity.name.type.instance.jsdoc" + } + } + }, + { + "name": "meta.example.jsdoc", + "begin": "((@)example)\\s+", + "end": "(?=@|\\*/)", + "beginCaptures": { + "1": { + "name": "storage.type.class.jsdoc" + }, + "2": { + "name": "punctuation.definition.block.tag.jsdoc" + } + }, + "patterns": [ + { + "match": "^\\s\\*\\s+" + }, + { + "contentName": "constant.other.description.jsdoc", + "begin": "\\G(<)caption(>)", + "beginCaptures": { + "0": { + "name": "entity.name.tag.inline.jsdoc" + }, + "1": { + "name": "punctuation.definition.bracket.angle.begin.jsdoc" + }, + "2": { + "name": "punctuation.definition.bracket.angle.end.jsdoc" + } + }, + "end": "(</)caption(>)|(?=\\*/)", + "endCaptures": { + "0": { + "name": "entity.name.tag.inline.jsdoc" + }, + "1": { + "name": "punctuation.definition.bracket.angle.begin.jsdoc" + }, + "2": { + "name": "punctuation.definition.bracket.angle.end.jsdoc" + } + } + }, + { + "match": "[^\\s@*](?:[^*]|\\*[^/])*", + "captures": { + "0": { + "name": "source.embedded.tsx" + } + } + } + ] + }, + { + "match": "(?x) ((@)kind) \\s+ (class|constant|event|external|file|function|member|mixin|module|namespace|typedef) \\b", + "captures": { + "1": { + "name": "storage.type.class.jsdoc" + }, + "2": { + "name": "punctuation.definition.block.tag.jsdoc" + }, + "3": { + "name": "constant.language.symbol-type.jsdoc" + } + } + }, + { + "match": "(?x)\n((@)see)\n\\s+\n(?:\n # URL\n (\n (?=https?://)\n (?:[^\\s*]|\\*[^/])+\n )\n |\n # JSDoc namepath\n (\n (?!\n # Avoid matching bare URIs (also acceptable as links)\n https?://\n |\n # Avoid matching {@inline tags}; we match those below\n (?:\\[[^\\[\\]]*\\])? # Possible description [preceding]{@tag}\n {@(?:link|linkcode|linkplain|tutorial)\\b\n )\n # Matched namepath\n (?:[^@\\s*/]|\\*[^/])+\n )\n)", + "captures": { + "1": { + "name": "storage.type.class.jsdoc" + }, + "2": { + "name": "punctuation.definition.block.tag.jsdoc" + }, + "3": { + "name": "variable.other.link.underline.jsdoc" + }, + "4": { + "name": "entity.name.type.instance.jsdoc" + } + } + }, + { + "match": "(?x)\n((@)template)\n\\s+\n# One or more valid identifiers\n(\n [A-Za-z_$] # First character: non-numeric word character\n [\\w$.\\[\\]]* # Rest of identifier\n (?: # Possible list of additional identifiers\n \\s* , \\s*\n [A-Za-z_$]\n [\\w$.\\[\\]]*\n )*\n)", + "captures": { + "1": { + "name": "storage.type.class.jsdoc" + }, + "2": { + "name": "punctuation.definition.block.tag.jsdoc" + }, + "3": { + "name": "variable.other.jsdoc" + } + } + }, + { + "match": "(?x)\n(\n (@)\n (?:arg|argument|const|constant|member|namespace|param|var)\n)\n\\s+\n(\n [A-Za-z_$]\n [\\w$.\\[\\]]*\n)", + "captures": { + "1": { + "name": "storage.type.class.jsdoc" + }, + "2": { + "name": "punctuation.definition.block.tag.jsdoc" + }, + "3": { + "name": "variable.other.jsdoc" + } + } + }, + { + "begin": "((@)typedef)\\s+(?={)", + "beginCaptures": { + "1": { + "name": "storage.type.class.jsdoc" + }, + "2": { + "name": "punctuation.definition.block.tag.jsdoc" + } + }, + "end": "(?=\\s|\\*/|[^{}\\[\\]A-Za-z_$])", + "patterns": [ + { + "include": "#jsdoctype" + }, + { + "name": "entity.name.type.instance.jsdoc", + "match": "(?:[^@\\s*/]|\\*[^/])+" + } + ] + }, + { + "begin": "((@)(?:arg|argument|const|constant|member|namespace|param|prop|property|var))\\s+(?={)", + "beginCaptures": { + "1": { + "name": "storage.type.class.jsdoc" + }, + "2": { + "name": "punctuation.definition.block.tag.jsdoc" + } + }, + "end": "(?=\\s|\\*/|[^{}\\[\\]A-Za-z_$])", + "patterns": [ + { + "include": "#jsdoctype" + }, + { + "name": "variable.other.jsdoc", + "match": "([A-Za-z_$][\\w$.\\[\\]]*)" + }, + { + "name": "variable.other.jsdoc", + "match": "(?x)\n(\\[)\\s*\n[\\w$]+\n(?:\n (?:\\[\\])? # Foo[ ].bar properties within an array\n \\. # Foo.Bar namespaced parameter\n [\\w$]+\n)*\n(?:\n \\s*\n (=) # [foo=bar] Default parameter value\n \\s*\n (\n # The inner regexes are to stop the match early at */ and to not stop at escaped quotes\n (?>\n \"(?:(?:\\*(?!/))|(?:\\\\(?!\"))|[^*\\\\])*?\" | # [foo=\"bar\"] Double-quoted\n '(?:(?:\\*(?!/))|(?:\\\\(?!'))|[^*\\\\])*?' | # [foo='bar'] Single-quoted\n \\[ (?:(?:\\*(?!/))|[^*])*? \\] | # [foo=[1,2]] Array literal\n (?:(?:\\*(?!/))|\\s(?!\\s*\\])|\\[.*?(?:\\]|(?=\\*/))|[^*\\s\\[\\]])* # Everything else\n )*\n )\n)?\n\\s*(?:(\\])((?:[^*\\s]|\\*[^\\s/])+)?|(?=\\*/))", + "captures": { + "1": { + "name": "punctuation.definition.optional-value.begin.bracket.square.jsdoc" + }, + "2": { + "name": "keyword.operator.assignment.jsdoc" + }, + "3": { + "name": "source.embedded.tsx" + }, + "4": { + "name": "punctuation.definition.optional-value.end.bracket.square.jsdoc" + }, + "5": { + "name": "invalid.illegal.syntax.jsdoc" + } + } + } + ] + }, + { + "begin": "(?x)\n(\n (@)\n (?:define|enum|exception|export|extends|lends|implements|modifies\n |namespace|private|protected|returns?|suppress|this|throws|type\n |yields?)\n)\n\\s+(?={)", + "beginCaptures": { + "1": { + "name": "storage.type.class.jsdoc" + }, + "2": { + "name": "punctuation.definition.block.tag.jsdoc" + } + }, + "end": "(?=\\s|\\*/|[^{}\\[\\]A-Za-z_$])", + "patterns": [ + { + "include": "#jsdoctype" + } + ] + }, + { + "match": "(?x)\n(\n (@)\n (?:alias|augments|callback|constructs|emits|event|fires|exports?\n |extends|external|function|func|host|lends|listens|interface|memberof!?\n |method|module|mixes|mixin|name|requires|see|this|typedef|uses)\n)\n\\s+\n(\n (?:\n [^{}@\\s*] | \\*[^/]\n )+\n)", + "captures": { + "1": { + "name": "storage.type.class.jsdoc" + }, + "2": { + "name": "punctuation.definition.block.tag.jsdoc" + }, + "3": { + "name": "entity.name.type.instance.jsdoc" + } + } + }, + { + "contentName": "variable.other.jsdoc", + "begin": "((@)(?:default(?:value)?|license|version))\\s+(([''\"]))", + "beginCaptures": { + "1": { + "name": "storage.type.class.jsdoc" + }, + "2": { + "name": "punctuation.definition.block.tag.jsdoc" + }, + "3": { + "name": "variable.other.jsdoc" + }, + "4": { + "name": "punctuation.definition.string.begin.jsdoc" + } + }, + "end": "(\\3)|(?=$|\\*/)", + "endCaptures": { + "0": { + "name": "variable.other.jsdoc" + }, + "1": { + "name": "punctuation.definition.string.end.jsdoc" + } + } + }, + { + "match": "((@)(?:default(?:value)?|license|tutorial|variation|version))\\s+([^\\s*]+)", + "captures": { + "1": { + "name": "storage.type.class.jsdoc" + }, + "2": { + "name": "punctuation.definition.block.tag.jsdoc" + }, + "3": { + "name": "variable.other.jsdoc" + } + } + }, + { + "name": "storage.type.class.jsdoc", + "match": "(?x) (@) (?:abstract|access|alias|api|arg|argument|async|attribute|augments|author|beta|borrows|bubbles |callback|chainable|class|classdesc|code|config|const|constant|constructor|constructs|copyright |default|defaultvalue|define|deprecated|desc|description|dict|emits|enum|event|example|exception |exports?|extends|extension(?:_?for)?|external|externs|file|fileoverview|final|fires|for|func |function|generator|global|hideconstructor|host|ignore|implements|implicitCast|inherit[Dd]oc |inner|instance|interface|internal|kind|lends|license|listens|main|member|memberof!?|method |mixes|mixins?|modifies|module|name|namespace|noalias|nocollapse|nocompile|nosideeffects |override|overview|package|param|polymer(?:Behavior)?|preserve|private|prop|property|protected |public|read[Oo]nly|record|require[ds]|returns?|see|since|static|struct|submodule|summary |suppress|template|this|throws|todo|tutorial|type|typedef|unrestricted|uses|var|variation |version|virtual|writeOnce|yields?) \\b", + "captures": { + "1": { + "name": "punctuation.definition.block.tag.jsdoc" + } + } + }, + { + "include": "#inline-tags" + }, + { + "match": "((@)(?:[_$[:alpha:]][_$[:alnum:]]*))(?=\\s+)", + "captures": { + "1": { + "name": "storage.type.class.jsdoc" + }, + "2": { + "name": "punctuation.definition.block.tag.jsdoc" + } + } + } + ] + }, + "brackets": { + "patterns": [ + { + "begin": "{", + "end": "}|(?=\\*/)", + "patterns": [ + { + "include": "#brackets" + } + ] + }, + { + "begin": "\\[", + "end": "\\]|(?=\\*/)", + "patterns": [ + { + "include": "#brackets" + } + ] + } + ] + }, + "inline-tags": { + "patterns": [ + { + "name": "constant.other.description.jsdoc", + "match": "(\\[)[^\\]]+(\\])(?={@(?:link|linkcode|linkplain|tutorial))", + "captures": { + "1": { + "name": "punctuation.definition.bracket.square.begin.jsdoc" + }, + "2": { + "name": "punctuation.definition.bracket.square.end.jsdoc" + } + } + }, + { + "name": "entity.name.type.instance.jsdoc", + "begin": "({)((@)(?:link(?:code|plain)?|tutorial))\\s*", + "beginCaptures": { + "1": { + "name": "punctuation.definition.bracket.curly.begin.jsdoc" + }, + "2": { + "name": "storage.type.class.jsdoc" + }, + "3": { + "name": "punctuation.definition.inline.tag.jsdoc" + } + }, + "end": "}|(?=\\*/)", + "endCaptures": { + "0": { + "name": "punctuation.definition.bracket.curly.end.jsdoc" + } + }, + "patterns": [ + { + "match": "\\G((?=https?://)(?:[^|}\\s*]|\\*[/])+)(\\|)?", + "captures": { + "1": { + "name": "variable.other.link.underline.jsdoc" + }, + "2": { + "name": "punctuation.separator.pipe.jsdoc" + } + } + }, + { + "match": "\\G((?:[^{}@\\s|*]|\\*[^/])+)(\\|)?", + "captures": { + "1": { + "name": "variable.other.description.jsdoc" + }, + "2": { + "name": "punctuation.separator.pipe.jsdoc" + } + } + } + ] + } + ] + }, + "jsdoctype": { + "patterns": [ + { + "contentName": "entity.name.type.instance.jsdoc", + "begin": "\\G({)", + "beginCaptures": { + "0": { + "name": "entity.name.type.instance.jsdoc" + }, + "1": { + "name": "punctuation.definition.bracket.curly.begin.jsdoc" + } + }, + "end": "((}))\\s*|(?=\\*/)", + "endCaptures": { + "1": { + "name": "entity.name.type.instance.jsdoc" + }, + "2": { + "name": "punctuation.definition.bracket.curly.end.jsdoc" + } + }, + "patterns": [ + { + "include": "#brackets" + } + ] + } + ] + }, + "jsx": { + "patterns": [ + { + "include": "#jsx-tag-without-attributes-in-expression" + }, + { + "include": "#jsx-tag-in-expression" + } + ] + }, + "jsx-tag-without-attributes-in-expression": { + "begin": "(?<!\\+\\+|--)(?<=[({\\[,?=>:*]|&&|\\|\\||\\?|\\*\\/|^await|[^\\._$[:alnum:]]await|^return|[^\\._$[:alnum:]]return|^default|[^\\._$[:alnum:]]default|^yield|[^\\._$[:alnum:]]yield|^)\\s*(?=(<)\\s*(?:([_$[:alpha:]][-_$[:alnum:].]*)(?<!\\.|-)(:))?((?:[a-z][a-z0-9]*|([_$[:alpha:]][-_$[:alnum:].]*))(?<!\\.|-))?\\s*(>))", + "end": "(?!(<)\\s*(?:([_$[:alpha:]][-_$[:alnum:].]*)(?<!\\.|-)(:))?((?:[a-z][a-z0-9]*|([_$[:alpha:]][-_$[:alnum:].]*))(?<!\\.|-))?\\s*(>))", + "patterns": [ + { + "include": "#jsx-tag-without-attributes" + } + ] + }, + "jsx-tag-without-attributes": { + "name": "meta.tag.without-attributes.tsx", + "begin": "(<)\\s*(?:([_$[:alpha:]][-_$[:alnum:].]*)(?<!\\.|-)(:))?((?:[a-z][a-z0-9]*|([_$[:alpha:]][-_$[:alnum:].]*))(?<!\\.|-))?\\s*(>)", + "end": "(</)\\s*(?:([_$[:alpha:]][-_$[:alnum:].]*)(?<!\\.|-)(:))?((?:[a-z][a-z0-9]*|([_$[:alpha:]][-_$[:alnum:].]*))(?<!\\.|-))?\\s*(>)", + "beginCaptures": { + "1": { + "name": "punctuation.definition.tag.begin.tsx" + }, + "2": { + "name": "entity.name.tag.namespace.tsx" + }, + "3": { + "name": "punctuation.separator.namespace.tsx" + }, + "4": { + "name": "entity.name.tag.tsx" + }, + "5": { + "name": "support.class.component.tsx" + }, + "6": { + "name": "punctuation.definition.tag.end.tsx" + } + }, + "endCaptures": { + "1": { + "name": "punctuation.definition.tag.begin.tsx" + }, + "2": { + "name": "entity.name.tag.namespace.tsx" + }, + "3": { + "name": "punctuation.separator.namespace.tsx" + }, + "4": { + "name": "entity.name.tag.tsx" + }, + "5": { + "name": "support.class.component.tsx" + }, + "6": { + "name": "punctuation.definition.tag.end.tsx" + } + }, + "contentName": "meta.jsx.children.tsx", + "patterns": [ + { + "include": "#jsx-children" + } + ] + }, + "jsx-tag-in-expression": { + "begin": "(?x)\n (?<!\\+\\+|--)(?<=[({\\[,?=>:*]|&&|\\|\\||\\?|\\*\\/|^await|[^\\._$[:alnum:]]await|^return|[^\\._$[:alnum:]]return|^default|[^\\._$[:alnum:]]default|^yield|[^\\._$[:alnum:]]yield|^)\\s*\n (?!<\\s*[_$[:alpha:]][_$[:alnum:]]*((\\s+extends\\s+[^=>])|,)) # look ahead is not type parameter of arrow\n (?=(<)\\s*(?:([_$[:alpha:]][-_$[:alnum:].]*)(?<!\\.|-)(:))?((?:[a-z][a-z0-9]*|([_$[:alpha:]][-_$[:alnum:].]*))(?<!\\.|-))(?=((<\\s*)|(\\s+))(?!\\?)|\\/?>))", + "end": "(?!(<)\\s*(?:([_$[:alpha:]][-_$[:alnum:].]*)(?<!\\.|-)(:))?((?:[a-z][a-z0-9]*|([_$[:alpha:]][-_$[:alnum:].]*))(?<!\\.|-))(?=((<\\s*)|(\\s+))(?!\\?)|\\/?>))", + "patterns": [ + { + "include": "#jsx-tag" + } + ] + }, + "jsx-tag": { + "name": "meta.tag.tsx", + "begin": "(?=(<)\\s*(?:([_$[:alpha:]][-_$[:alnum:].]*)(?<!\\.|-)(:))?((?:[a-z][a-z0-9]*|([_$[:alpha:]][-_$[:alnum:].]*))(?<!\\.|-))(?=((<\\s*)|(\\s+))(?!\\?)|\\/?>))", + "end": "(/>)|(?:(</)\\s*(?:([_$[:alpha:]][-_$[:alnum:].]*)(?<!\\.|-)(:))?((?:[a-z][a-z0-9]*|([_$[:alpha:]][-_$[:alnum:].]*))(?<!\\.|-))?\\s*(>))", + "endCaptures": { + "1": { + "name": "punctuation.definition.tag.end.tsx" + }, + "2": { + "name": "punctuation.definition.tag.begin.tsx" + }, + "3": { + "name": "entity.name.tag.namespace.tsx" + }, + "4": { + "name": "punctuation.separator.namespace.tsx" + }, + "5": { + "name": "entity.name.tag.tsx" + }, + "6": { + "name": "support.class.component.tsx" + }, + "7": { + "name": "punctuation.definition.tag.end.tsx" + } + }, + "patterns": [ + { + "begin": "(<)\\s*(?:([_$[:alpha:]][-_$[:alnum:].]*)(?<!\\.|-)(:))?((?:[a-z][a-z0-9]*|([_$[:alpha:]][-_$[:alnum:].]*))(?<!\\.|-))(?=((<\\s*)|(\\s+))(?!\\?)|\\/?>)", + "beginCaptures": { + "1": { + "name": "punctuation.definition.tag.begin.tsx" + }, + "2": { + "name": "entity.name.tag.namespace.tsx" + }, + "3": { + "name": "punctuation.separator.namespace.tsx" + }, + "4": { + "name": "entity.name.tag.tsx" + }, + "5": { + "name": "support.class.component.tsx" + } + }, + "end": "(?=[/]?>)", + "patterns": [ + { + "include": "#comment" + }, + { + "include": "#type-arguments" + }, + { + "include": "#jsx-tag-attributes" + } + ] + }, + { + "begin": "(>)", + "beginCaptures": { + "1": { + "name": "punctuation.definition.tag.end.tsx" + } + }, + "end": "(?=</)", + "contentName": "meta.jsx.children.tsx", + "patterns": [ + { + "include": "#jsx-children" + } + ] + } + ] + }, + "jsx-children": { + "patterns": [ + { + "include": "#jsx-tag-without-attributes" + }, + { + "include": "#jsx-tag" + }, + { + "include": "#jsx-evaluated-code" + }, + { + "include": "#jsx-entities" + } + ] + }, + "jsx-evaluated-code": { + "contentName": "meta.embedded.expression.tsx", + "begin": "\\{", + "end": "\\}", + "beginCaptures": { + "0": { + "name": "punctuation.section.embedded.begin.tsx" + } + }, + "endCaptures": { + "0": { + "name": "punctuation.section.embedded.end.tsx" + } + }, + "patterns": [ + { + "include": "#expression" + } + ] + }, + "jsx-entities": { + "patterns": [ + { + "name": "constant.character.entity.tsx", + "match": "(&)([a-zA-Z0-9]+|#[0-9]+|#x[0-9a-fA-F]+)(;)", + "captures": { + "1": { + "name": "punctuation.definition.entity.tsx" + }, + "3": { + "name": "punctuation.definition.entity.tsx" + } + } + }, + { + "name": "invalid.illegal.bad-ampersand.tsx", + "match": "&" + } + ] + }, + "jsx-tag-attributes": { + "name": "meta.tag.attributes.tsx", + "begin": "\\s+", + "end": "(?=[/]?>)", + "patterns": [ + { + "include": "#comment" + }, + { + "include": "#jsx-tag-attribute-name" + }, + { + "include": "#jsx-tag-attribute-assignment" + }, + { + "include": "#jsx-string-double-quoted" + }, + { + "include": "#jsx-string-single-quoted" + }, + { + "include": "#jsx-evaluated-code" + }, + { + "include": "#jsx-tag-attributes-illegal" + } + ] + }, + "jsx-tag-attribute-name": { + "match": "(?x)\n \\s*\n (?:([_$[:alpha:]][-_$[:alnum:].]*)(:))?\n ([_$[:alpha:]][-_$[:alnum:]]*)\n (?=\\s|=|/?>|/\\*|//)", + "captures": { + "1": { + "name": "entity.other.attribute-name.namespace.tsx" + }, + "2": { + "name": "punctuation.separator.namespace.tsx" + }, + "3": { + "name": "entity.other.attribute-name.tsx" + } + } + }, + "jsx-tag-attribute-assignment": { + "name": "keyword.operator.assignment.tsx", + "match": "=(?=\\s*(?:'|\"|{|/\\*|//|\\n))" + }, + "jsx-string-double-quoted": { + "name": "string.quoted.double.tsx", + "begin": "\"", + "end": "\"", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.tsx" + } + }, + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.tsx" + } + }, + "patterns": [ + { + "include": "#jsx-entities" + } + ] + }, + "jsx-string-single-quoted": { + "name": "string.quoted.single.tsx", + "begin": "'", + "end": "'", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.tsx" + } + }, + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.tsx" + } + }, + "patterns": [ + { + "include": "#jsx-entities" + } + ] + }, + "jsx-tag-attributes-illegal": { + "name": "invalid.illegal.attribute.tsx", + "match": "\\S+" + } + } +} diff --git a/data/text.html.erb.json b/data/text.html.erb.json new file mode 100644 index 0000000..bfccaa9 --- /dev/null +++ b/data/text.html.erb.json @@ -0,0 +1,154 @@ +{ + "name": "HTML (Ruby - ERB)", + "scopeName": "text.html.erb", + "fileTypes": [ + "rhtml", + "html.erb" + ], + "injections": { + "text.html.erb - (meta.embedded.block.erb | meta.embedded.line.erb | meta.tag | comment), meta.tag string.quoted, L:source.js.embedded.html": { + "patterns": [ + { + "begin": "(^\\s*)(?=<%+#(?![^%]*%>))", + "beginCaptures": { + "0": { + "name": "punctuation.whitespace.comment.leading.erb" + } + }, + "end": "(?!\\G)(\\s*$\\n)?", + "endCaptures": { + "0": { + "name": "punctuation.whitespace.comment.trailing.erb" + } + }, + "patterns": [ + { + "include": "#comment" + } + ] + }, + { + "begin": "(^\\s*)(?=<%(?![^%]*%>))", + "beginCaptures": { + "0": { + "name": "punctuation.whitespace.embedded.leading.erb" + } + }, + "end": "(?!\\G)(\\s*$\\n)?", + "endCaptures": { + "0": { + "name": "punctuation.whitespace.embedded.trailing.erb" + } + }, + "patterns": [ + { + "include": "#tags" + } + ] + }, + { + "include": "#comment" + }, + { + "include": "#tags" + } + ] + } + }, + "patterns": [ + { + "include": "text.html.basic" + } + ], + "repository": { + "comment": { + "patterns": [ + { + "begin": "<%+#", + "beginCaptures": { + "0": { + "name": "punctuation.definition.comment.begin.erb" + } + }, + "end": "%>", + "endCaptures": { + "0": { + "name": "punctuation.definition.comment.end.erb" + } + }, + "name": "comment.block.erb" + } + ] + }, + "tags": { + "patterns": [ + { + "begin": "<%+(?!>)[-=]?(?![^%]*%>)", + "beginCaptures": { + "0": { + "name": "punctuation.section.embedded.begin.erb" + } + }, + "contentName": "source.ruby.embedded.erb", + "end": "-?%>", + "endCaptures": { + "0": { + "name": "punctuation.section.embedded.end.erb" + }, + "1": { + "name": "source.ruby" + } + }, + "name": "meta.embedded.block.erb", + "patterns": [ + { + "captures": { + "1": { + "name": "punctuation.definition.comment.erb" + } + }, + "match": "(#).*?(?=-?%>)", + "name": "comment.line.number-sign.erb" + }, + { + "include": "source.ruby" + } + ] + }, + { + "begin": "<%+(?!>)[-=]?", + "beginCaptures": { + "0": { + "name": "punctuation.section.embedded.begin.erb" + } + }, + "contentName": "source.ruby.embedded.erb", + "end": "-?%>", + "endCaptures": { + "0": { + "name": "punctuation.section.embedded.end.erb" + }, + "1": { + "name": "source.ruby" + } + }, + "name": "meta.embedded.line.erb", + "patterns": [ + { + "captures": { + "1": { + "name": "punctuation.definition.comment.erb" + } + }, + "match": "(#).*?(?=-?%>)", + "name": "comment.line.number-sign.erb" + }, + { + "include": "source.ruby" + } + ] + } + ] + } + } +} diff --git a/data/text.html.jsp.json b/data/text.html.jsp.json new file mode 100644 index 0000000..b71586f --- /dev/null +++ b/data/text.html.jsp.json @@ -0,0 +1,1202 @@ +{ + "scopeName": "text.html.jsp", + "name": "JavaServer Pages", + "fileTypes": [ + "jsp", + "jspf", + "jspx", + "tag" + ], + "injections": { + "text.html.jsp - (meta.embedded.block.jsp | meta.embedded.line.jsp | meta.tag | comment), meta.tag string.quoted": { + "patterns": [ + { + "include": "#comment" + }, + { + "include": "#declaration" + }, + { + "include": "#expression" + }, + { + "include": "#el_expression" + }, + { + "include": "#tags" + }, + { + "begin": "(^\\s*)(?=<%(?=\\s))", + "beginCaptures": { + "0": { + "name": "punctuation.whitespace.embedded.leading.erb" + } + }, + "end": "(?!\\G)(\\s*$\\n)?", + "endCaptures": { + "0": { + "name": "punctuation.whitespace.embedded.trailing.erb" + } + }, + "patterns": [ + { + "include": "#scriptlet" + } + ] + }, + { + "include": "#scriptlet" + } + ] + } + }, + "patterns": [ + { + "include": "#xml_tags" + }, + { + "include": "text.html.basic" + } + ], + "repository": { + "comment": { + "begin": "<%--", + "captures": { + "0": { + "name": "punctuation.definition.comment.jsp" + } + }, + "end": "--%>", + "name": "comment.block.jsp" + }, + "declaration": { + "begin": "<%!", + "beginCaptures": { + "0": { + "name": "punctuation.section.embedded.begin.jsp" + } + }, + "contentName": "source.java", + "end": "(%)>", + "endCaptures": { + "0": { + "name": "punctuation.section.embedded.end.jsp" + }, + "1": { + "name": "source.java" + } + }, + "name": "meta.embedded.line.declaration.jsp", + "patterns": [ + { + "include": "source.java" + } + ] + }, + "el_expression": { + "begin": "\\$\\{", + "beginCaptures": { + "0": { + "name": "punctuation.section.embedded.begin.jsp" + } + }, + "contentName": "source.java", + "end": "(\\})", + "endCaptures": { + "0": { + "name": "punctuation.section.embedded.end.jsp" + }, + "1": { + "name": "source.java" + } + }, + "name": "meta.embedded.line.el_expression.jsp", + "patterns": [ + { + "include": "source.java.el" + } + ] + }, + "expression": { + "begin": "<%=", + "beginCaptures": { + "0": { + "name": "punctuation.section.embedded.begin.jsp" + } + }, + "contentName": "source.java", + "end": "(%)>", + "endCaptures": { + "0": { + "name": "punctuation.section.embedded.end.jsp" + }, + "1": { + "name": "source.java" + } + }, + "name": "meta.embedded.line.expression.jsp", + "patterns": [ + { + "include": "source.java" + } + ] + }, + "scriptlet": { + "begin": "<%", + "beginCaptures": { + "0": { + "name": "punctuation.section.embedded.begin.jsp" + } + }, + "contentName": "source.java", + "end": "(%)>", + "endCaptures": { + "0": { + "name": "punctuation.section.embedded.end.jsp" + }, + "1": { + "name": "source.java" + } + }, + "name": "meta.embedded.block.scriptlet.jsp", + "patterns": [ + { + "match": "\\{", + "name": "punctuation.section.scope.begin.java" + }, + { + "match": "\\}", + "name": "punctuation.section.scope.end.java" + }, + { + "include": "source.java" + } + ] + }, + "tags": { + "begin": "(<%@)\\s*(?=(attribute|include|page|tag|taglib|variable)\\s)", + "beginCaptures": { + "1": { + "name": "punctuation.definition.tag.begin.jsp" + } + }, + "end": "%>", + "endCaptures": { + "0": { + "name": "punctuation.definition.tag.end.jsp" + } + }, + "name": "meta.tag.template.include.jsp", + "patterns": [ + { + "begin": "\\G(attribute)(?=\\s)", + "captures": { + "1": { + "name": "keyword.control.attribute.jsp" + } + }, + "end": "(?=%>)", + "patterns": [ + { + "captures": { + "1": { + "name": "entity.other.attribute-name.jsp" + }, + "2": { + "name": "punctuation.separator.key-value.jsp" + }, + "3": { + "name": "string.quoted.double.jsp" + }, + "4": { + "name": "punctuation.definition.string.begin.jsp" + }, + "5": { + "name": "punctuation.definition.string.end.jsp" + } + }, + "match": "(name|required|fragment|rtexprvalue|type|description)(=)((\")[^\"]*(\"))" + } + ] + }, + { + "begin": "\\G(include)(?=\\s)", + "captures": { + "1": { + "name": "keyword.control.include.jsp" + } + }, + "end": "(?=%>)", + "patterns": [ + { + "captures": { + "1": { + "name": "entity.other.attribute-name.jsp" + }, + "2": { + "name": "punctuation.separator.key-value.jsp" + }, + "3": { + "name": "string.quoted.double.jsp" + }, + "4": { + "name": "punctuation.definition.string.begin.jsp" + }, + "5": { + "name": "punctuation.definition.string.end.jsp" + } + }, + "match": "(file)(=)((\")[^\"]*(\"))" + } + ] + }, + { + "begin": "\\G(page)(?=\\s)", + "captures": { + "1": { + "name": "keyword.control.page.jsp" + } + }, + "end": "(?=%>)", + "patterns": [ + { + "captures": { + "1": { + "name": "entity.other.attribute-name.jsp" + }, + "2": { + "name": "punctuation.separator.key-value.jsp" + }, + "3": { + "name": "string.quoted.double.jsp" + }, + "4": { + "name": "punctuation.definition.string.begin.jsp" + }, + "5": { + "name": "punctuation.definition.string.end.jsp" + } + }, + "match": "(language|extends|import|session|buffer|autoFlush|isThreadSafe|info|errorPage|isErrorPage|contentType|pageEncoding|isElIgnored)(=)((\")[^\"]*(\"))" + } + ] + }, + { + "begin": "\\G(tag)(?=\\s)", + "captures": { + "1": { + "name": "keyword.control.tag.jsp" + } + }, + "end": "(?=%>)", + "patterns": [ + { + "captures": { + "1": { + "name": "entity.other.attribute-name.jsp" + }, + "2": { + "name": "punctuation.separator.key-value.jsp" + }, + "3": { + "name": "string.quoted.double.jsp" + }, + "4": { + "name": "punctuation.definition.string.begin.jsp" + }, + "5": { + "name": "punctuation.definition.string.end.jsp" + } + }, + "match": "(display-name|body-content|dynamic-attributes|small-icon|large-icon|description|example|language|import|pageEncoding|isELIgnored)(=)((\")[^\"]*(\"))" + } + ] + }, + { + "begin": "\\G(taglib)(?=\\s)", + "captures": { + "1": { + "name": "keyword.control.taglib.jsp" + } + }, + "end": "(?=%>)", + "patterns": [ + { + "captures": { + "1": { + "name": "entity.other.attribute-name.jsp" + }, + "2": { + "name": "punctuation.separator.key-value.jsp" + }, + "3": { + "name": "string.quoted.double.jsp" + }, + "4": { + "name": "punctuation.definition.string.begin.jsp" + }, + "5": { + "name": "punctuation.definition.string.end.jsp" + } + }, + "match": "(uri|tagdir|prefix)(=)((\")[^\"]*(\"))" + } + ] + }, + { + "begin": "\\G(variable)(?=\\s)", + "captures": { + "1": { + "name": "keyword.control.variable.jsp" + } + }, + "end": "(?=%>)", + "patterns": [ + { + "captures": { + "1": { + "name": "entity.other.attribute-name.jsp" + }, + "2": { + "name": "punctuation.separator.key-value.jsp" + }, + "3": { + "name": "string.quoted.double.jsp" + }, + "4": { + "name": "punctuation.definition.string.begin.jsp" + }, + "5": { + "name": "punctuation.definition.string.end.jsp" + } + }, + "match": "(name-given|alias|variable-class|declare|scope|description)(=)((\")[^\"]*(\"))" + } + ] + } + ] + }, + "xml_tags": { + "patterns": [ + { + "begin": "(^\\s*)(?=<jsp:(declaration|expression|scriptlet)>)", + "beginCaptures": { + "0": { + "name": "punctuation.whitespace.embedded.leading.erb" + } + }, + "end": "(?!\\G)(\\s*$\\n)?", + "endCaptures": { + "0": { + "name": "punctuation.whitespace.embedded.trailing.erb" + } + }, + "patterns": [ + { + "include": "#embedded" + } + ] + }, + { + "include": "#embedded" + }, + { + "include": "#directive" + }, + { + "include": "#actions" + } + ], + "repository": { + "actions": { + "patterns": [ + { + "begin": "(</?)(jsp:attribute)\\b", + "beginCaptures": { + "1": { + "name": "punctuation.definition.tag.begin.jsp" + }, + "2": { + "name": "entity.name.tag.jsp" + } + }, + "end": ">", + "endCaptures": { + "0": { + "name": "punctuation.definition.tag.end.jsp" + } + }, + "name": "meta.tag.template.attribute.jsp", + "patterns": [ + { + "captures": { + "1": { + "name": "entity.other.attribute-name.jsp" + }, + "2": { + "name": "punctuation.separator.key-value.jsp" + }, + "3": { + "name": "string.quoted.double.jsp" + }, + "4": { + "name": "punctuation.definition.string.begin.jsp" + }, + "5": { + "name": "punctuation.definition.string.end.jsp" + } + }, + "match": "(name|trim)(=)((\")[^\"]*(\"))" + } + ] + }, + { + "captures": { + "1": { + "name": "punctuation.definition.tag.begin.jsp" + }, + "2": { + "name": "entity.name.tag.jsp" + }, + "3": { + "name": "punctuation.definition.tag.end.jsp" + } + }, + "match": "(</?)(jsp:body)(>)", + "name": "meta.tag.template.body.jsp" + }, + { + "begin": "(</?)(jsp:element)\\b", + "beginCaptures": { + "1": { + "name": "punctuation.definition.tag.begin.jsp" + }, + "2": { + "name": "entity.name.tag.jsp" + } + }, + "end": ">", + "endCaptures": { + "0": { + "name": "punctuation.definition.tag.end.jsp" + } + }, + "name": "meta.tag.template.element.jsp", + "patterns": [ + { + "captures": { + "1": { + "name": "entity.other.attribute-name.jsp" + }, + "2": { + "name": "punctuation.separator.key-value.jsp" + }, + "3": { + "name": "string.quoted.double.jsp" + }, + "4": { + "name": "punctuation.definition.string.begin.jsp" + }, + "5": { + "name": "punctuation.definition.string.end.jsp" + } + }, + "match": "(name)(=)((\")[^\"]*(\"))" + } + ] + }, + { + "begin": "(<)(jsp:doBody)\\b", + "beginCaptures": { + "1": { + "name": "punctuation.definition.tag.begin.jsp" + }, + "2": { + "name": "entity.name.tag.jsp" + } + }, + "end": "/>", + "endCaptures": { + "0": { + "name": "punctuation.definition.tag.end.jsp" + } + }, + "name": "meta.tag.template.dobody.jsp", + "patterns": [ + { + "captures": { + "1": { + "name": "entity.other.attribute-name.jsp" + }, + "2": { + "name": "punctuation.separator.key-value.jsp" + }, + "3": { + "name": "string.quoted.double.jsp" + }, + "4": { + "name": "punctuation.definition.string.begin.jsp" + }, + "5": { + "name": "punctuation.definition.string.end.jsp" + } + }, + "match": "(var|varReader|scope)(=)((\")[^\"]*(\"))" + } + ] + }, + { + "begin": "(</?)(jsp:forward)\\b", + "beginCaptures": { + "1": { + "name": "punctuation.definition.tag.begin.jsp" + }, + "2": { + "name": "entity.name.tag.jsp" + } + }, + "end": "/?>", + "endCaptures": { + "0": { + "name": "punctuation.definition.tag.end.jsp" + } + }, + "name": "meta.tag.template.forward.jsp", + "patterns": [ + { + "captures": { + "1": { + "name": "entity.other.attribute-name.jsp" + }, + "2": { + "name": "punctuation.separator.key-value.jsp" + }, + "3": { + "name": "string.quoted.double.jsp" + }, + "4": { + "name": "punctuation.definition.string.begin.jsp" + }, + "5": { + "name": "punctuation.definition.string.end.jsp" + } + }, + "match": "(page)(=)((\")[^\"]*(\"))" + } + ] + }, + { + "begin": "(<)(jsp:param)\\b", + "beginCaptures": { + "1": { + "name": "punctuation.definition.tag.begin.jsp" + }, + "2": { + "name": "entity.name.tag.jsp" + } + }, + "end": "/>", + "endCaptures": { + "0": { + "name": "punctuation.definition.tag.end.jsp" + } + }, + "name": "meta.tag.template.param.jsp", + "patterns": [ + { + "captures": { + "1": { + "name": "entity.other.attribute-name.jsp" + }, + "2": { + "name": "punctuation.separator.key-value.jsp" + }, + "3": { + "name": "string.quoted.double.jsp" + }, + "4": { + "name": "punctuation.definition.string.begin.jsp" + }, + "5": { + "name": "punctuation.definition.string.end.jsp" + } + }, + "match": "(name|value)(=)((\")[^\"]*(\"))" + } + ] + }, + { + "begin": "(<)(jsp:getProperty)\\b", + "beginCaptures": { + "1": { + "name": "punctuation.definition.tag.begin.jsp" + }, + "2": { + "name": "entity.name.tag.jsp" + } + }, + "end": "/>", + "endCaptures": { + "0": { + "name": "punctuation.definition.tag.end.jsp" + } + }, + "name": "meta.tag.template.getproperty.jsp", + "patterns": [ + { + "captures": { + "1": { + "name": "entity.other.attribute-name.jsp" + }, + "2": { + "name": "punctuation.separator.key-value.jsp" + }, + "3": { + "name": "string.quoted.double.jsp" + }, + "4": { + "name": "punctuation.definition.string.begin.jsp" + }, + "5": { + "name": "punctuation.definition.string.end.jsp" + } + }, + "match": "(name|property)(=)((\")[^\"]*(\"))" + } + ] + }, + { + "begin": "(</?)(jsp:include)\\b", + "beginCaptures": { + "1": { + "name": "punctuation.definition.tag.begin.jsp" + }, + "2": { + "name": "entity.name.tag.jsp" + } + }, + "end": "/?>", + "endCaptures": { + "0": { + "name": "punctuation.definition.tag.end.jsp" + } + }, + "name": "meta.tag.template.include.jsp", + "patterns": [ + { + "captures": { + "1": { + "name": "entity.other.attribute-name.jsp" + }, + "2": { + "name": "punctuation.separator.key-value.jsp" + }, + "3": { + "name": "string.quoted.double.jsp" + }, + "4": { + "name": "punctuation.definition.string.begin.jsp" + }, + "5": { + "name": "punctuation.definition.string.end.jsp" + } + }, + "match": "(page|flush)(=)((\")[^\"]*(\"))" + } + ] + }, + { + "begin": "(<)(jsp:invoke)\\b", + "beginCaptures": { + "1": { + "name": "punctuation.definition.tag.begin.jsp" + }, + "2": { + "name": "entity.name.tag.jsp" + } + }, + "end": "/>", + "endCaptures": { + "0": { + "name": "punctuation.definition.tag.end.jsp" + } + }, + "name": "meta.tag.template.invoke.jsp", + "patterns": [ + { + "captures": { + "1": { + "name": "entity.other.attribute-name.jsp" + }, + "2": { + "name": "punctuation.separator.key-value.jsp" + }, + "3": { + "name": "string.quoted.double.jsp" + }, + "4": { + "name": "punctuation.definition.string.begin.jsp" + }, + "5": { + "name": "punctuation.definition.string.end.jsp" + } + }, + "match": "(fragment|var|varReader|scope)(=)((\")[^\"]*(\"))" + } + ] + }, + { + "begin": "(<)(jsp:output)\\b", + "beginCaptures": { + "1": { + "name": "punctuation.definition.tag.begin.jsp" + }, + "2": { + "name": "entity.name.tag.jsp" + } + }, + "end": "/>", + "endCaptures": { + "0": { + "name": "punctuation.definition.tag.end.jsp" + } + }, + "name": "meta.tag.template.output.jsp", + "patterns": [ + { + "captures": { + "1": { + "name": "entity.other.attribute-name.jsp" + }, + "2": { + "name": "punctuation.separator.key-value.jsp" + }, + "3": { + "name": "string.quoted.double.jsp" + }, + "4": { + "name": "punctuation.definition.string.begin.jsp" + }, + "5": { + "name": "punctuation.definition.string.end.jsp" + } + }, + "match": "(omit-xml-declaration|doctype-root-element|doctype-system|doctype-public)(=)((\")[^\"]*(\"))" + } + ] + }, + { + "begin": "(</?)(jsp:plugin)\\b", + "beginCaptures": { + "1": { + "name": "punctuation.definition.tag.begin.jsp" + }, + "2": { + "name": "entity.name.tag.jsp" + } + }, + "end": ">", + "endCaptures": { + "0": { + "name": "punctuation.definition.tag.end.jsp" + } + }, + "name": "meta.tag.template.plugin.jsp", + "patterns": [ + { + "captures": { + "1": { + "name": "entity.other.attribute-name.jsp" + }, + "2": { + "name": "punctuation.separator.key-value.jsp" + }, + "3": { + "name": "string.quoted.double.jsp" + }, + "4": { + "name": "punctuation.definition.string.begin.jsp" + }, + "5": { + "name": "punctuation.definition.string.end.jsp" + } + }, + "match": "(type|code|codebase|name|archive|align|height|hspace|jreversion|nspluginurl|iepluginurl)(=)((\")[^\"]*(\"))" + } + ] + }, + { + "captures": { + "1": { + "name": "punctuation.definition.tag.begin.jsp" + }, + "2": { + "name": "entity.name.tag.jsp" + }, + "3": { + "name": "punctuation.definition.tag.end.jsp" + } + }, + "end": ">", + "match": "(</?)(jsp:fallback)(>)", + "name": "meta.tag.template.fallback.jsp" + }, + { + "begin": "(</?)(jsp:root)\\b", + "beginCaptures": { + "1": { + "name": "punctuation.definition.tag.begin.jsp" + }, + "2": { + "name": "entity.name.tag.jsp" + } + }, + "end": ">", + "endCaptures": { + "0": { + "name": "punctuation.definition.tag.end.jsp" + } + }, + "name": "meta.tag.template.root.jsp", + "patterns": [ + { + "captures": { + "1": { + "name": "entity.other.attribute-name.jsp" + }, + "2": { + "name": "punctuation.separator.key-value.jsp" + }, + "3": { + "name": "string.quoted.double.jsp" + }, + "4": { + "name": "punctuation.definition.string.begin.jsp" + }, + "5": { + "name": "punctuation.definition.string.end.jsp" + } + }, + "match": "(xmlns|version|xmlns:taglibPrefix)(=)((\")[^\"]*(\"))" + } + ] + }, + { + "begin": "(<)(jsp:setProperty)\\b", + "beginCaptures": { + "1": { + "name": "punctuation.definition.tag.begin.jsp" + }, + "2": { + "name": "entity.name.tag.jsp" + } + }, + "end": "/>", + "endCaptures": { + "0": { + "name": "punctuation.definition.tag.end.jsp" + } + }, + "name": "meta.tag.template.setproperty.jsp", + "patterns": [ + { + "captures": { + "1": { + "name": "entity.other.attribute-name.jsp" + }, + "2": { + "name": "punctuation.separator.key-value.jsp" + }, + "3": { + "name": "string.quoted.double.jsp" + }, + "4": { + "name": "punctuation.definition.string.begin.jsp" + }, + "5": { + "name": "punctuation.definition.string.end.jsp" + } + }, + "match": "(name|property|value)(=)((\")[^\"]*(\"))" + } + ] + }, + { + "captures": { + "1": { + "name": "punctuation.definition.tag.begin.jsp" + }, + "2": { + "name": "entity.name.tag.jsp" + }, + "3": { + "name": "punctuation.definition.tag.end.jsp" + } + }, + "end": ">", + "match": "(</?)(jsp:text)(>)", + "name": "meta.tag.template.text.jsp" + }, + { + "begin": "(</?)(jsp:useBean)\\b", + "beginCaptures": { + "1": { + "name": "punctuation.definition.tag.begin.jsp" + }, + "2": { + "name": "entity.name.tag.jsp" + } + }, + "end": "/?>", + "endCaptures": { + "0": { + "name": "punctuation.definition.tag.end.jsp" + } + }, + "name": "meta.tag.template.usebean.jsp", + "patterns": [ + { + "captures": { + "1": { + "name": "entity.other.attribute-name.jsp" + }, + "2": { + "name": "punctuation.separator.key-value.jsp" + }, + "3": { + "name": "string.quoted.double.jsp" + }, + "4": { + "name": "punctuation.definition.string.begin.jsp" + }, + "5": { + "name": "punctuation.definition.string.end.jsp" + } + }, + "match": "(id|scope|class|type|beanName)(=)((\")[^\"]*(\"))" + } + ] + } + ] + }, + "directive": { + "begin": "(<)(jsp:directive\\.(?=(attribute|include|page|tag|variable)\\s))", + "beginCaptures": { + "1": { + "name": "punctuation.definition.tag.begin.jsp" + }, + "2": { + "name": "entity.name.tag.jsp" + } + }, + "end": "/>", + "endCaptures": { + "0": { + "name": "punctuation.definition.tag.end.jsp" + } + }, + "name": "meta.tag.template.$3.jsp", + "patterns": [ + { + "begin": "\\G(attribute)(?=\\s)", + "captures": { + "1": { + "name": "entity.name.tag.jsp" + } + }, + "end": "(?=/>)", + "patterns": [ + { + "captures": { + "1": { + "name": "entity.other.attribute-name.jsp" + }, + "2": { + "name": "punctuation.separator.key-value.jsp" + }, + "3": { + "name": "string.quoted.double.jsp" + }, + "4": { + "name": "punctuation.definition.string.begin.jsp" + }, + "5": { + "name": "punctuation.definition.string.end.jsp" + } + }, + "match": "(name|required|fragment|rtexprvalue|type|description)(=)((\")[^\"]*(\"))" + } + ] + }, + { + "begin": "\\G(include)(?=\\s)", + "captures": { + "1": { + "name": "entity.name.tag.jsp" + } + }, + "end": "(?=/>)", + "patterns": [ + { + "captures": { + "1": { + "name": "entity.other.attribute-name.jsp" + }, + "2": { + "name": "punctuation.separator.key-value.jsp" + }, + "3": { + "name": "string.quoted.double.jsp" + }, + "4": { + "name": "punctuation.definition.string.begin.jsp" + }, + "5": { + "name": "punctuation.definition.string.end.jsp" + } + }, + "match": "(file)(=)((\")[^\"]*(\"))" + } + ] + }, + { + "begin": "\\G(page)(?=\\s)", + "captures": { + "1": { + "name": "entity.name.tag.jsp" + } + }, + "end": "(?=/>)", + "patterns": [ + { + "captures": { + "1": { + "name": "entity.other.attribute-name.jsp" + }, + "2": { + "name": "punctuation.separator.key-value.jsp" + }, + "3": { + "name": "string.quoted.double.jsp" + }, + "4": { + "name": "punctuation.definition.string.begin.jsp" + }, + "5": { + "name": "punctuation.definition.string.end.jsp" + } + }, + "match": "(language|extends|import|session|buffer|autoFlush|isThreadSafe|info|errorPage|isErrorPage|contentType|pageEncoding|isElIgnored)(=)((\")[^\"]*(\"))" + } + ] + }, + { + "begin": "\\G(tag)(?=\\s)", + "captures": { + "1": { + "name": "entity.name.tag.jsp" + } + }, + "end": "(?=/>)", + "patterns": [ + { + "captures": { + "1": { + "name": "entity.other.attribute-name.jsp" + }, + "2": { + "name": "punctuation.separator.key-value.jsp" + }, + "3": { + "name": "string.quoted.double.jsp" + }, + "4": { + "name": "punctuation.definition.string.begin.jsp" + }, + "5": { + "name": "punctuation.definition.string.end.jsp" + } + }, + "match": "(display-name|body-content|dynamic-attributes|small-icon|large-icon|description|example|language|import|pageEncoding|isELIgnored)(=)((\")[^\"]*(\"))" + } + ] + }, + { + "begin": "\\G(variable)(?=\\s)", + "captures": { + "1": { + "name": "entity.name.tag.jsp" + } + }, + "end": "(?=/>)", + "patterns": [ + { + "captures": { + "1": { + "name": "entity.other.attribute-name.jsp" + }, + "2": { + "name": "punctuation.separator.key-value.jsp" + }, + "3": { + "name": "string.quoted.double.jsp" + }, + "4": { + "name": "punctuation.definition.string.begin.jsp" + }, + "5": { + "name": "punctuation.definition.string.end.jsp" + } + }, + "match": "(name-given|alias|variable-class|declare|scope|description)(=)((\")[^\"]*(\"))" + } + ] + } + ] + }, + "embedded": { + "begin": "(<)(jsp:(declaration|expression|scriptlet))(>)", + "beginCaptures": { + "0": { + "name": "meta.tag.template.$3.jsp" + }, + "1": { + "name": "punctuation.definition.tag.begin.jsp" + }, + "2": { + "name": "entity.name.tag.jsp" + }, + "4": { + "name": "punctuation.definition.tag.end.jsp" + } + }, + "contentName": "source.java", + "end": "((<)/)(jsp:\\3)(>)", + "endCaptures": { + "0": { + "name": "meta.tag.template.$4.jsp" + }, + "1": { + "name": "punctuation.definition.tag.begin.jsp" + }, + "2": { + "name": "source.java" + }, + "3": { + "name": "entity.name.tag.jsp" + }, + "4": { + "name": "punctuation.definition.tag.end.jsp" + } + }, + "name": "meta.embedded.block.jsp", + "patterns": [ + { + "include": "source.java" + } + ] + } + } + } + } +} diff --git a/data/text.html.smarty.json b/data/text.html.smarty.json new file mode 100644 index 0000000..caeaa81 --- /dev/null +++ b/data/text.html.smarty.json @@ -0,0 +1,201 @@ +{ + "fileTypes": [ + "tpl" + ], + "scopeName": "text.html.smarty", + "foldingStartMarker": "\\{%?", + "foldingStopMarker": "%?\\}", + "name": "Smarty", + "patterns": [ + { + "include": "#comments" + }, + { + "include": "#blocks" + }, + { + "include": "text.html.basic" + } + ], + "repository": { + "blocks": { + "patterns": [ + { + "begin": "(\\{%?)", + "beginCaptures": { + "1": { + "name": "punctuation.section.embedded.begin.smarty" + } + }, + "end": "(%?\\})", + "endCaptures": { + "1": { + "name": "punctuation.section.embedded.end.smarty" + } + }, + "name": "source.smarty", + "patterns": [ + { + "include": "#strings" + }, + { + "include": "#variables" + }, + { + "include": "#lang" + } + ] + } + ] + }, + "comments": { + "patterns": [ + { + "begin": "(\\{%?)\\*", + "beginCaptures": { + "1": { + "name": "punctuation.definition.comment.smarty" + } + }, + "end": "\\*(%?\\})", + "name": "comment.block.smarty", + "patterns": [] + } + ] + }, + "lang": { + "patterns": [ + { + "match": "(!==|!=|!|<=|>=|<|>|===|==|%|&&|\\|\\|)|\\b(and|or|eq|neq|ne|gte|gt|ge|lte|lt|le|not|mod)\\b", + "name": "keyword.operator.smarty" + }, + { + "match": "\\b(TRUE|FALSE|true|false)\\b", + "name": "constant.language.smarty" + }, + { + "match": "\\b(php|if|else|elseif|foreach|foreachelse|for|section|switch|case|break|default)\\b", + "name": "keyword.control.smarty" + }, + { + "captures": { + "0": { + "name": "variable.parameter.smarty" + } + }, + "match": "\\b([a-zA-Z]+)=", + "name": "meta.attribute.smarty" + }, + { + "match": "\\b(capture|config_load|counter|cycle|debug|eval|fetch|include_php|include|insert|literal|math|strip|rdelim|ldelim|assign|constant|block|html_[a-z_]*)\\b", + "name": "support.function.built-in.smarty" + }, + { + "match": "\\|(capitalize|cat|count_characters|count_paragraphs|count_sentences|count_words|date_format|default|escape|indent|lower|nl2br|regex_replace|replace|spacify|string_format|strip_tags|strip|truncate|upper|wordwrap)", + "name": "support.function.variable-modifier.smarty" + } + ] + }, + "strings": { + "patterns": [ + { + "begin": "'", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.smarty" + } + }, + "end": "'", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.smarty" + } + }, + "name": "string.quoted.single.smarty", + "patterns": [ + { + "match": "\\\\.", + "name": "constant.character.escape.smarty" + } + ] + }, + { + "begin": "\"", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.smarty" + } + }, + "end": "\"", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.smarty" + } + }, + "name": "string.quoted.double.smarty", + "patterns": [ + { + "match": "\\\\.", + "name": "constant.character.escape.smarty" + } + ] + } + ] + }, + "variables": { + "patterns": [ + { + "captures": { + "1": { + "name": "punctuation.definition.variable.smarty" + } + }, + "match": "\\b(\\$)Smarty\\.", + "name": "variable.other.global.smarty" + }, + { + "captures": { + "1": { + "name": "punctuation.definition.variable.smarty" + }, + "2": { + "name": "variable.other.smarty" + } + }, + "match": "(\\$)([a-zA-Z_][a-zA-Z0-9_]*)\\b", + "name": "variable.other.smarty" + }, + { + "captures": { + "1": { + "name": "keyword.operator.smarty" + }, + "2": { + "name": "variable.other.property.smarty" + } + }, + "match": "(->)([a-zA-Z_][a-zA-Z0-9_]*)\\b", + "name": "variable.other.smarty" + }, + { + "captures": { + "1": { + "name": "keyword.operator.smarty" + }, + "2": { + "name": "meta.function-call.object.smarty" + }, + "3": { + "name": "punctuation.definition.variable.smarty" + }, + "4": { + "name": "punctuation.definition.variable.smarty" + } + }, + "match": "(->)([a-zA-Z_][a-zA-Z0-9_]*)(\\().*?(\\))", + "name": "variable.other.smarty" + } + ] + } + } +} diff --git a/data/text.html.textile.json b/data/text.html.textile.json new file mode 100644 index 0000000..678e897 --- /dev/null +++ b/data/text.html.textile.json @@ -0,0 +1,271 @@ +{ + "fileTypes": [ + "textile" + ], + "firstLineMatch": "textile", + "name": "Textile", + "patterns": [ + { + "begin": "(^h[1-6]([<>=()]+)?)(\\([^)]*\\)|{[^}]*})*(\\.)", + "captures": { + "1": { + "name": "entity.name.tag.heading.textile" + }, + "3": { + "name": "entity.name.type.textile" + }, + "4": { + "name": "entity.name.tag.heading.textile" + } + }, + "end": "^$", + "name": "markup.heading.textile", + "patterns": [ + { + "include": "#inline" + }, + { + "include": "text.html.basic" + } + ] + }, + { + "begin": "(^bq([<>=()]+)?)(\\([^)]*\\)|{[^}]*})*(\\.)", + "captures": { + "1": { + "name": "entity.name.tag.blockquote.textile" + }, + "3": { + "name": "entity.name.type.textile" + }, + "4": { + "name": "entity.name.tag.blockquote.textile" + } + }, + "end": "^$", + "name": "markup.quote.textile", + "patterns": [ + { + "include": "#inline" + }, + { + "include": "text.html.basic" + } + ] + }, + { + "begin": "(^fn[0-9]+([<>=()]+)?)(\\([^)]*\\)|{[^}]*})*(\\.)", + "captures": { + "1": { + "name": "entity.name.tag.footnote.textile" + }, + "3": { + "name": "entity.name.type.textile" + }, + "4": { + "name": "entity.name.tag.footnote.textile" + } + }, + "end": "^$", + "name": "markup.other.footnote.textile", + "patterns": [ + { + "include": "#inline" + }, + { + "include": "text.html.basic" + } + ] + }, + { + "begin": "(^table([<>=()]+)?)(\\([^)]*\\)|{[^}]*})*(\\.)", + "captures": { + "1": { + "name": "entity.name.tag.footnote.textile" + }, + "3": { + "name": "entity.name.type.textile" + }, + "4": { + "name": "entity.name.tag.footnote.textile" + } + }, + "end": "^$", + "name": "markup.other.table.textile", + "patterns": [ + { + "include": "#inline" + }, + { + "include": "text.html.basic" + } + ] + }, + { + "begin": "^(?=\\S)", + "end": "^$", + "name": "meta.paragraph.textile", + "patterns": [ + { + "captures": { + "1": { + "name": "entity.name.tag.paragraph.textile" + }, + "3": { + "name": "entity.name.type.textile" + }, + "4": { + "name": "entity.name.tag.paragraph.textile" + } + }, + "match": "(^p([<>=()]+)?)(\\([^)]*\\)|{[^}]*})*(\\.)", + "name": "entity.name.section.paragraph.textile" + }, + { + "include": "#inline" + }, + { + "include": "text.html.basic" + } + ] + }, + { + "comment": "Since html is valid in Textile include the html patterns", + "include": "text.html.basic" + } + ], + "repository": { + "inline": { + "patterns": [ + { + "comment": "& is handled automagically by textile, so we match it to avoid text.html.basic from flagging it", + "match": "&(?![A-Za-z0-9]+;)", + "name": "text.html.textile" + }, + { + "captures": { + "1": { + "name": "entity.name.type.textile" + } + }, + "match": "^\\*+(\\([^)]*\\)|{[^}]*})*(\\s+|$)", + "name": "markup.list.unnumbered.textile" + }, + { + "captures": { + "1": { + "name": "entity.name.type.textile" + } + }, + "match": "^#+(\\([^)]*\\)|{[^}]*})*\\s+", + "name": "markup.list.numbered.textile" + }, + { + "captures": { + "1": { + "name": "string.other.link.title.textile" + }, + "2": { + "name": "string.other.link.description.title.textile" + }, + "3": { + "name": "constant.other.reference.link.textile" + } + }, + "match": "(?x)\n\t\t\t\t\t\t\t\t\"\t\t\t\t\t\t\t\t# Start name, etc\n\t\t\t\t\t\t\t\t\t(?:\t\t\t\t\t\t\t# Attributes\n\t\t\t\t\t\t\t\t\t\t# I swear, this is how the language is defined,\n\t\t\t\t\t\t\t\t\t\t# couldnt make it up if I tried.\n\t\t\t\t\t\t\t\t\t\t(?:\\([^)]+\\))?(?:\\{[^}]+\\})?(?:\\[[^\\]]+\\])?\n\t\t\t\t\t\t\t\t\t\t\t# Class, Style, Lang\n\t\t\t\t\t\t\t\t\t | (?:\\{[^}]+\\})?(?:\\[[^\\]]+\\])?(?:\\([^)]+\\))?\n\t\t\t\t\t\t\t\t\t\t\t# Style, Lang, Class\n\t\t\t\t\t\t\t\t\t | (?:\\[[^\\]]+\\])?(?:\\{[^}]+\\})?(?:\\([^)]+\\))?\n\t\t\t\t\t\t\t\t\t\t\t# Lang, Style, Class\n\t\t\t\t\t\t\t\t\t)?\n\t\t\t\t\t\t\t\t\t([^\"]+?)\t\t\t\t\t# Link name\n\t\t\t\t\t\t\t\t\t\\s?\t\t\t\t\t\t\t# Optional whitespace\n\t\t\t\t\t\t\t\t\t(?:\\(([^)]+?)\\))?\n\t\t\t\t\t\t\t\t\":\t\t\t\t\t\t\t\t# End name\n\t\t\t\t\t\t\t\t(\\w[-\\w_]*)\t\t\t\t\t\t# Linkref\n\t\t\t\t\t\t\t\t(?=[^\\w\\/;]*?(<|\\s|$))\t\t\t# Catch closing punctuation\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t# and end of meta.link\n\t\t\t\t\t", + "name": "meta.link.reference.textile" + }, + { + "captures": { + "1": { + "name": "string.other.link.title.textile" + }, + "2": { + "name": "string.other.link.description.title.textile" + }, + "3": { + "name": "markup.underline.link.textile" + } + }, + "match": "(?x)\n\t\t\t\t\t\t\t\t\"\t\t\t\t\t\t\t\t# Start name, etc\n\t\t\t\t\t\t\t\t\t(?:\t\t\t\t\t\t\t# Attributes\n\t\t\t\t\t\t\t\t\t\t# I swear, this is how the language is defined,\n\t\t\t\t\t\t\t\t\t\t# couldnt make it up if I tried.\n\t\t\t\t\t\t\t\t\t\t(?:\\([^)]+\\))?(?:\\{[^}]+\\})?(?:\\[[^\\]]+\\])?\n\t\t\t\t\t\t\t\t\t\t\t# Class, Style, Lang\n\t\t\t\t\t\t\t\t\t | (?:\\{[^}]+\\})?(?:\\[[^\\]]+\\])?(?:\\([^)]+\\))?\n\t\t\t\t\t\t\t\t\t\t\t# Style, Lang, Class\n\t\t\t\t\t\t\t\t\t | (?:\\[[^\\]]+\\])?(?:\\{[^}]+\\})?(?:\\([^)]+\\))?\n\t\t\t\t\t\t\t\t\t\t\t# Lang, Style, Class\n\t\t\t\t\t\t\t\t\t)?\n\t\t\t\t\t\t\t\t\t([^\"]+?)\t\t\t\t\t# Link name\n\t\t\t\t\t\t\t\t\t\\s?\t\t\t\t\t\t\t# Optional whitespace\n\t\t\t\t\t\t\t\t\t(?:\\(([^)]+?)\\))?\n\t\t\t\t\t\t\t\t\":\t\t\t\t\t\t\t\t# End Name\n\t\t\t\t\t\t\t\t(\\S*?(?:\\w|\\/|;))\t\t\t\t# URL\n\t\t\t\t\t\t\t\t(?=[^\\w\\/;]*?(<|\\s|$))\t\t\t# Catch closing punctuation\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t# and end of meta.link\n\t\t\t\t\t", + "name": "meta.link.inline.textile" + }, + { + "captures": { + "2": { + "name": "markup.underline.link.image.textile" + }, + "3": { + "name": "string.other.link.description.textile" + }, + "4": { + "name": "markup.underline.link.textile" + } + }, + "match": "(?x)\n\t\t\t\t\t\t\t\t\\!\t\t\t\t\t\t\t\t\t\t# Open image\n\t\t\t\t\t\t\t\t(\\<|\\=|\\>)?\t\t\t\t\t\t\t\t# Optional alignment\n\t\t\t\t\t\t\t\t(?:\t\t\t\t\t\t\t\t\t\t# Attributes\n\t\t\t\t\t\t\t\t\t# I swear, this is how the language is defined,\n\t\t\t\t\t\t\t\t\t# couldnt make it up if I tried.\n\t\t\t\t\t\t\t\t\t(?:\\([^)]+\\))?(?:\\{[^}]+\\})?(?:\\[[^\\]]+\\])?\n\t\t\t\t\t\t\t\t\t\t# Class, Style, Lang\n\t\t\t\t\t\t\t\t | (?:\\{[^}]+\\})?(?:\\[[^\\]]+\\])?(?:\\([^)]+\\))?\n\t\t\t\t\t\t\t\t\t\t# Style, Lang, Class\n\t\t\t\t\t\t\t\t | (?:\\[[^\\]]+\\])?(?:\\{[^}]+\\})?(?:\\([^)]+\\))?\n\t\t\t\t\t\t\t\t\t\t# Lang, Style, Class\n\t\t\t\t\t\t\t\t)?\n\t\t\t\t\t\t\t\t(?:\\.[ ])? \t\t\t\t\t# Optional\n\t\t\t\t\t\t\t\t([^\\s(!]+?) \t\t\t\t\t# Image URL\n\t\t\t\t\t\t\t\t\\s? \t\t\t\t\t\t# Optional space\n\t\t\t\t\t\t\t\t(?:\\(((?:[^\\(\\)]|\\([^\\)]+\\))+?)\\))? \t# Optional title\n\t\t\t\t\t\t\t\t\\!\t\t\t\t\t\t\t\t\t\t# Close image\n\t\t\t\t\t\t\t\t(?:\n\t\t\t\t\t\t\t\t\t:\n\t\t\t\t\t\t\t\t\t(\\S*?(?:\\w|\\/|;))\t\t\t\t\t# URL\n\t\t\t\t\t\t\t\t\t(?=[^\\w\\/;]*?(<|\\s|$))\t\t\t\t# Catch closing punctuation\n\t\t\t\t\t\t\t\t)?\n\t\t\t\t\t", + "name": "meta.image.inline.textile" + }, + { + "captures": { + "1": { + "name": "entity.name.type.textile" + } + }, + "match": "\\|(\\([^)]*\\)|{[^}]*})*(\\\\\\||.)+\\|", + "name": "markup.other.table.cell.textile" + }, + { + "captures": { + "3": { + "name": "entity.name.type.textile" + } + }, + "match": "\\B(\\*\\*?)((\\([^)]*\\)|{[^}]*}|\\[[^]]+\\]){0,3})(\\S.*?\\S|\\S)\\1\\B", + "name": "markup.bold.textile" + }, + { + "captures": { + "2": { + "name": "entity.name.type.textile" + } + }, + "match": "\\B-((\\([^)]*\\)|{[^}]*}|\\[[^]]+\\]){0,3})(\\S.*?\\S|\\S)-\\B", + "name": "markup.deleted.textile" + }, + { + "captures": { + "2": { + "name": "entity.name.type.textile" + } + }, + "match": "\\B\\+((\\([^)]*\\)|{[^}]*}|\\[[^]]+\\]){0,3})(\\S.*?\\S|\\S)\\+\\B", + "name": "markup.inserted.textile" + }, + { + "captures": { + "2": { + "name": "entity.name.type.textile" + } + }, + "match": "(?:\\b|\\s)_((\\([^)]*\\)|{[^}]*}|\\[[^]]+\\]){0,3})(\\S.*?\\S|\\S)_(?:\\b|\\s)", + "name": "markup.italic.textile" + }, + { + "captures": { + "3": { + "name": "entity.name.type.textile" + } + }, + "match": "\\B([@\\^~%]|\\?\\?)((\\([^)]*\\)|{[^}]*}|\\[[^]]+\\]){0,3})(\\S.*?\\S|\\S)\\1", + "name": "markup.italic.phrasemodifiers.textile" + }, + { + "comment": "Footnotes", + "match": "(?<!w)\\[[0-9+]\\]", + "name": "entity.name.tag.textile" + } + ] + } + }, + "scopeName": "text.html.textile" +} diff --git a/data/text.junit-test-report.json b/data/text.junit-test-report.json new file mode 100644 index 0000000..c3fe5f0 --- /dev/null +++ b/data/text.junit-test-report.json @@ -0,0 +1,90 @@ +{ + "scopeName": "text.junit-test-report", + "name": "JUnit Test Report", + "firstLineMatch": "^Testsuite:", + "patterns": [ + { + "captures": { + "1": { + "name": "meta.testsuite.label.junit-test-report" + }, + "2": { + "name": "entity.name.testsuite.junit-test-report" + } + }, + "match": "(Testsuite:) (.+)$\\n", + "name": "meta.testsuite.name.junit-test-report" + }, + { + "captures": { + "1": { + "name": "meta.testcase.label.junit-test-report" + }, + "2": { + "name": "entity.name.testcase.junit-test-report" + } + }, + "match": "(Testcase:) (.+) took ([\\d\\.]+) sec$\\n", + "name": "meta.testcase.name.junit-test-report" + }, + { + "begin": "at\\s+(?=.+?\\(.+?\\)$)", + "end": "$\\n", + "name": "meta.stackframe.junit-test-report", + "patterns": [ + { + "match": "(?<=\\.)[^\\.]+?(?=\\()", + "name": "meta.stackframe.method.junit-test-report" + }, + { + "captures": { + "1": { + "name": "meta.stackframe.source.junit-test-report" + }, + "3": { + "name": "meta.stackframe.source.line.junit-test-report" + } + }, + "match": "\\((.+)(:)(.+)\\)$" + } + ] + }, + { + "begin": "------------- Standard Output ---------------$\\n", + "end": "------------- ---------------- ---------------$\\n", + "name": "meta.section.output.junit-test-report", + "patterns": [ + { + "begin": "--Output from (.+?)--$\\n", + "beginCaptures": { + "1": { + "name": "entity.name.testcase.junit-test-report" + } + }, + "contentName": "meta.output.content.junit-test-report", + "end": "(?=--Output from|------------- ---------------- ---------------)", + "name": "meta.output.junit-test-report" + } + ] + }, + { + "begin": "------------- Standard Error -----------------$\\n", + "contentName": "meta.error.junit-test-report", + "end": "------------- ---------------- ---------------$\\n", + "name": "meta.section.error.junit-test-report", + "patterns": [ + { + "begin": "--Output from (.+?)--$\\n", + "beginCaptures": { + "1": { + "name": "entity.name.testcase.junit-test-report" + } + }, + "contentName": "meta.error.content.junit-test-report", + "end": "(?=--Output from|------------- ---------------- ---------------)", + "name": "meta.error.junit-test-report" + } + ] + } + ] +} diff --git a/data/text.md.json b/data/text.md.json new file mode 100644 index 0000000..71060c2 --- /dev/null +++ b/data/text.md.json @@ -0,0 +1,4313 @@ +{ + "name": "Markdown", + "scopeName": "text.md", + "limitLineLength": false, + "fileTypes": [ + "markdown", + "md", + "mdown", + "mkd", + "mkdown", + "rmd", + "ron", + "emdee", + "spec" + ], + "patterns": [ + { + "include": "#blocks" + }, + { + "include": "#inlines" + }, + { + "include": "#flavors" + } + ], + "repository": { + "blocks": { + "patterns": [ + { + "include": "#comments" + }, + { + "include": "#front-matter" + }, + { + "include": "#hr" + }, + { + "include": "#headings" + }, + { + "include": "#lists" + }, + { + "include": "#quotes" + }, + { + "include": "#rmarkdown" + }, + { + "include": "#fenced-code-blocks" + }, + { + "include": "#fenced-code" + }, + { + "include": "#github-blocks" + }, + { + "include": "#math-block" + } + ] + }, + "inlines": { + "patterns": [ + { + "include": "#escapes" + }, + { + "include": "#code" + }, + { + "include": "#entities" + }, + { + "include": "#links" + }, + { + "include": "#html" + }, + { + "include": "#liquid" + }, + { + "include": "#emphasis" + }, + { + "include": "#line-breaks" + }, + { + "include": "#todo" + }, + { + "include": "#references" + }, + { + "include": "#github-inlines" + }, + { + "include": "#math-inline" + } + ] + }, + "flavors": { + "patterns": [ + { + "include": "#criticmark" + }, + { + "include": "#github-inlines" + }, + { + "include": "#markdown-extra" + }, + { + "include": "#pandoc" + }, + { + "include": "#ia-writer" + } + ] + }, + "inlines-in-blocks": { + "patterns": [ + { + "include": "#escapes" + }, + { + "include": "#code" + }, + { + "include": "#entities" + }, + { + "include": "#links" + }, + { + "include": "#html" + }, + { + "include": "#liquid" + }, + { + "include": "#emphasis" + }, + { + "include": "#todo" + }, + { + "include": "#references" + }, + { + "include": "#flavors" + }, + { + "include": "#math-inline" + } + ] + }, + "inlines-in-inlines": { + "patterns": [ + { + "include": "#escapes" + }, + { + "include": "#code" + }, + { + "include": "#entities" + }, + { + "include": "#links" + }, + { + "include": "#html" + }, + { + "include": "#liquid" + }, + { + "include": "#emphasis" + }, + { + "include": "#todo" + }, + { + "include": "#references" + }, + { + "include": "#github-inlines" + }, + { + "include": "#criticmark" + } + ] + }, + "fenced-code": { + "patterns": [ + { + "begin": "^\\s{0,3}([`]{3,})$", + "beginCaptures": { + "1": { + "name": "punctuation.md" + } + }, + "end": "^\\s{0,3}(\\1)$", + "endCaptures": { + "1": { + "name": "punctuation.md" + } + }, + "name": "fenced.code.md", + "contentName": "source.embedded" + }, + { + "begin": "^\\s{0,3}([~]{3,})$", + "beginCaptures": { + "1": { + "name": "punctuation.md" + } + }, + "end": "^\\s{0,3}(\\1)$", + "endCaptures": { + "1": { + "name": "punctuation.md" + } + }, + "name": "fenced.code.md", + "contentName": "source.embedded" + } + ] + }, + "headings": { + "patterns": [ + { + "match": "^(?:[ ]{0,3})((?:#{1,6})\\s*(?:#*)\\s*)$", + "name": "empty.heading.markup.md", + "captures": { + "1": { + "patterns": [ + { + "match": "^(#{6})\\s*(#*)\\s*$", + "name": "heading-6.md", + "captures": { + "1": { + "name": "punctuation.md" + }, + "2": { + "name": "punctuation.md" + } + } + }, + { + "match": "^(#{5})\\s*(#*)\\s*$", + "name": "heading-5.md", + "captures": { + "1": { + "name": "punctuation.md" + }, + "2": { + "name": "punctuation.md" + } + } + }, + { + "match": "^(#{4})\\s*(#*)\\s*$", + "name": "heading-4.md", + "captures": { + "1": { + "name": "punctuation.md" + }, + "2": { + "name": "punctuation.md" + } + } + }, + { + "match": "^(#{3})\\s*(#*)\\s*$", + "name": "heading-3.md", + "captures": { + "1": { + "name": "punctuation.md" + }, + "2": { + "name": "punctuation.md" + } + } + }, + { + "match": "^(#{2})\\s*(#*)\\s*$", + "name": "heading-2.md", + "captures": { + "1": { + "name": "punctuation.md" + }, + "2": { + "name": "punctuation.md" + } + } + }, + { + "match": "^(#{1})\\s*(#*)\\s*$", + "name": "heading-1.md", + "captures": { + "1": { + "name": "punctuation.md" + }, + "2": { + "name": "punctuation.md" + } + } + } + ] + } + } + }, + { + "match": "^((?: {0,3})(?:#{1,6})(?: +)(?:.+))$", + "name": "heading.markup.md", + "captures": { + "1": { + "patterns": [ + { + "begin": "^(?: {0,3})(#{1})(?: +)", + "end": "(?: ){1}(#*)(?:\\s*)(?:(\\{[[:ascii:]]*\\}))?$", + "name": "heading-1.md", + "beginCaptures": { + "1": { + "name": "punctuation.md" + } + }, + "endCaptures": { + "1": { + "name": "punctuation.md" + }, + "2": { + "patterns": [ + { + "include": "#special-attributes" + } + ] + } + }, + "patterns": [ + { + "include": "#inlines-in-blocks" + } + ] + }, + { + "begin": "^(?: {0,3})(#{2})(?: +)", + "end": "(?: ){1}(#*)(?:\\s*)(?:(\\{[[:ascii:]]*\\}))?$", + "name": "heading-2.md", + "beginCaptures": { + "1": { + "name": "punctuation.md" + } + }, + "endCaptures": { + "1": { + "name": "punctuation.md" + }, + "2": { + "patterns": [ + { + "include": "#special-attributes" + } + ] + } + }, + "patterns": [ + { + "include": "#inlines-in-blocks" + } + ] + }, + { + "begin": "^(?: {0,3})(#{3})(?: +)", + "end": "(?: ){1}(#*)(?:\\s*)(?:(\\{[[:ascii:]]*\\}))?$", + "name": "heading-3.md", + "beginCaptures": { + "1": { + "name": "punctuation.md" + } + }, + "endCaptures": { + "1": { + "name": "punctuation.md" + }, + "2": { + "patterns": [ + { + "include": "#special-attributes" + } + ] + } + }, + "patterns": [ + { + "include": "#inlines-in-blocks" + } + ] + }, + { + "begin": "^(?: {0,3})(#{4})(?: +)", + "end": "(?: ){1}(#*)(?:\\s*)(?:(\\{[[:ascii:]]*\\}))?$", + "name": "heading-4.md", + "beginCaptures": { + "1": { + "name": "punctuation.md" + } + }, + "endCaptures": { + "1": { + "name": "punctuation.md" + }, + "2": { + "patterns": [ + { + "include": "#special-attributes" + } + ] + } + }, + "patterns": [ + { + "include": "#inlines-in-blocks" + } + ] + }, + { + "begin": "^(?: {0,3})(#{5})(?: +)", + "end": "(?: ){1}(#*)(?:\\s*)(?:(\\{[[:ascii:]]*\\}))?$", + "name": "heading-5.md", + "beginCaptures": { + "1": { + "name": "punctuation.md" + } + }, + "endCaptures": { + "1": { + "name": "punctuation.md" + }, + "2": { + "patterns": [ + { + "include": "#special-attributes" + } + ] + } + }, + "patterns": [ + { + "include": "#inlines-in-blocks" + } + ] + }, + { + "begin": "^(?: {0,3})(#{6})(?: +)", + "end": "(?: ){1}(#*)(?:\\s*)(?:(\\{[[:ascii:]]*\\}))?$", + "name": "heading-6.md", + "beginCaptures": { + "1": { + "name": "punctuation.md" + } + }, + "endCaptures": { + "1": { + "name": "punctuation.md" + }, + "2": { + "patterns": [ + { + "include": "#special-attributes" + } + ] + } + }, + "patterns": [ + { + "include": "#inlines-in-blocks" + } + ] + } + ] + } + } + } + ] + }, + "hr": { + "patterns": [ + { + "name": "hr.constant.md", + "match": "^[ ]{0,3}[-]{1,} *[-]{1,} *[-]{1,}[ -]*$" + }, + { + "name": "hr.constant.md", + "match": "^[ ]{0,3}[*]{1,} *[*]{1,} *[*]{1,}[ *]*$" + }, + { + "name": "hr.constant.md", + "match": "^[ ]{0,3}[_]{1,} *[_]{1,} *[_]{1,}[ _]*$" + } + ] + }, + "lists": { + "patterns": [ + { + "match": "^(?:\\s*)([-+\\*] \\[ \\]\\s?)$", + "name": "empty.task.unordered.list.markup.md", + "captures": { + "1": { + "name": "punctuation.md" + } + } + }, + { + "match": "^(?:\\s*)([0-9]{1,9}[\\.\\)] \\[ \\]\\s)$", + "name": "empty.task.ordered.list.markup.md", + "captures": { + "1": { + "name": "punctuation.md" + } + } + }, + { + "match": "^(?:\\s*)([-+\\*]{1}\\s?)$", + "name": "empty.unordered.list.markup.md", + "captures": { + "1": { + "name": "punctuation.md" + } + } + }, + { + "match": "^(?:\\s*)([0-9]{1,9}[\\.\\)]\\s?)$", + "name": "empty.ordered.list.markup.md", + "captures": { + "1": { + "name": "punctuation.md" + } + } + }, + { + "match": "^(?:\\s*)([-+\\*] \\[ \\]\\s)(.*)$", + "name": "task.unordered.list.markup.md", + "captures": { + "1": { + "name": "punctuation.md" + }, + "2": { + "patterns": [ + { + "include": "#blocks" + }, + { + "include": "#inlines-in-blocks" + } + ] + } + } + }, + { + "match": "^(?:\\s*)([0-9]{1,9}[\\.\\)] \\[ \\]\\s)(.*)$", + "name": "task.ordered.list.markup.md", + "captures": { + "1": { + "name": "punctuation.md" + }, + "2": { + "patterns": [ + { + "include": "#blocks" + }, + { + "include": "#inlines-in-blocks" + } + ] + } + } + }, + { + "match": "^(?:\\s*)([-+\\*] \\[[xX]\\]\\s)(.*)$", + "name": "completed.task.unordered.list.markup.md", + "captures": { + "1": { + "name": "punctuation.md" + }, + "2": { + "patterns": [ + { + "include": "#blocks" + }, + { + "include": "#inlines-in-blocks" + } + ] + } + } + }, + { + "match": "^(?:\\s*)([0-9]{1,9}[\\.\\)] \\[[xX]\\]\\s)(.*)$", + "name": "completed.task.ordered.list.markup.md", + "captures": { + "1": { + "name": "punctuation.md" + }, + "2": { + "patterns": [ + { + "include": "#blocks" + }, + { + "include": "#inlines-in-blocks" + } + ] + } + } + }, + { + "match": "^(?:\\s*)([-+\\*]{1}\\s)(.*)$", + "name": "unordered.list.markup.md", + "captures": { + "1": { + "name": "punctuation.md" + }, + "2": { + "patterns": [ + { + "include": "#blocks" + }, + { + "include": "#inlines-in-blocks" + } + ] + } + } + }, + { + "match": "^(?:\\s*)([0-9]{1,9}[\\.\\)]\\s)(.*)$", + "name": "ordered.list.markup.md", + "captures": { + "1": { + "name": "punctuation.md" + }, + "2": { + "patterns": [ + { + "include": "#blocks" + }, + { + "include": "#inlines-in-blocks" + } + ] + } + } + } + ] + }, + "quotes": { + "patterns": [ + { + "match": "^(?: {0,3})(>){1}(?: ){0,1}(.*)$", + "name": "quote.markup.md", + "captures": { + "1": { + "name": "punctuation.md" + }, + "2": { + "patterns": [ + { + "include": "#blocks" + }, + { + "include": "#inlines-in-blocks" + } + ] + } + } + } + ] + }, + "criticmark": { + "patterns": [ + { + "name": "addition.critic.inserted.markup.md", + "begin": "({\\+\\+)", + "beginCaptures": { + "1": { + "name": "punctuation.md" + } + }, + "end": "(\\+\\+})", + "endCaptures": { + "1": { + "name": "punctuation.md" + } + }, + "patterns": [ + { + "include": "#emphasis" + } + ] + }, + { + "name": "deletion.critic.deleted.markup.md", + "begin": "({--)", + "beginCaptures": { + "1": { + "name": "punctuation.md" + } + }, + "end": "(--})", + "endCaptures": { + "1": { + "name": "punctuation.md" + } + }, + "patterns": [ + { + "include": "#emphasis" + } + ] + }, + { + "name": "highlight.critic.changed.markup.md", + "begin": "({==)", + "beginCaptures": { + "1": { + "name": "punctuation.md" + } + }, + "end": "(==})", + "endCaptures": { + "1": { + "name": "punctuation.md" + } + }, + "patterns": [ + { + "include": "#emphasis" + } + ] + }, + { + "name": "comment.critic.markup.md", + "begin": "({>>)", + "beginCaptures": { + "1": { + "name": "punctuation.md" + } + }, + "patterns": [ + { + "match": "(?<=[\\s|>])((@)(\\w[-\\w:]*))(?=[\\s|:|<])", + "captures": { + "1": { + "name": "username.reference.variable.md" + }, + "2": { + "name": "punctuation.md" + } + } + }, + { + "include": "#emphasis" + } + ], + "end": "(<<})", + "endCaptures": { + "1": { + "name": "punctuation.md" + } + } + }, + { + "name": "substitution.critic.inserted.markup.md", + "begin": "({~~)", + "beginCaptures": { + "1": { + "name": "punctuation.md" + } + }, + "end": "(~~})", + "endCaptures": { + "1": { + "name": "punctuation.md" + } + }, + "patterns": [ + { + "match": "~>", + "name": "punctuation.md" + }, + { + "include": "#emphasis" + } + ] + } + ] + }, + "front-matter": { + "patterns": [ + { + "begin": "\\A---$", + "beginCaptures": { + "0": { + "name": "hr.constant.md" + } + }, + "end": "^(---|\\.\\.\\.)$", + "endCaptures": { + "1": { + "name": "hr.constant.md" + } + }, + "name": "front-matter.yaml.source.md", + "patterns": [ + { + "include": "source.yaml" + } + ] + }, + { + "begin": "\\A\\+\\+\\+$", + "beginCaptures": { + "0": { + "name": "hr.constant.md" + } + }, + "end": "^\\+\\+\\+$", + "endCaptures": { + "0": { + "name": "hr.constant.md" + } + }, + "name": "front-matter.toml.source.md", + "patterns": [ + { + "include": "source.toml" + } + ] + }, + { + "begin": "\\A;{3}$", + "beginCaptures": { + "0": { + "name": "hr.constant.md" + } + }, + "end": "^;{3}$", + "endCaptures": { + "0": { + "name": "hr.constant.md" + } + }, + "name": "front-matter.json.source.md", + "patterns": [ + { + "include": "source.json" + } + ] + } + ] + }, + "github-blocks": { + "patterns": [ + { + "name": "table.storage.md", + "match": "^(\\|(?= |:|-)[ |:-]*?)(\\|?)$", + "captures": { + "1": { + "patterns": [ + { + "match": "(\\|)(?: ?)(:?)(-+)(:?)(?: ?)(?=\\|| |$)", + "captures": { + "1": { + "name": "vertical.punctuation.md" + }, + "2": { + "name": "alignment.punctuation.md" + }, + "3": { + "name": "horizontal.punctuation.md" + }, + "4": { + "name": "alignment.punctuation.md" + } + } + } + ] + }, + "2": { + "name": "vertical.punctuation.md" + } + } + }, + { + "name": "table.storage.md", + "match": "^(\\|)(?= )(.+)$", + "captures": { + "1": { + "name": "vertical.punctuation.md" + }, + "2": { + "patterns": [ + { + "match": "(?<= )\\|(?=$| )", + "name": "vertical.punctuation.md" + }, + { + "include": "#inlines-in-blocks" + } + ] + }, + "3": { + "name": "punctuation.md" + } + } + } + ] + }, + "github-inlines": { + "patterns": [ + { + "match": "(?<=^|\\s|\"|'|\\(|\\[)((#|GH-)(\\d+))(?=[\\s\"'\\.,;:\\)\\]]|$)", + "captures": { + "1": { + "name": "reference.gfm.variable.md" + }, + "2": { + "name": "punctuation.md" + }, + "3": { + "name": "issue.gfm.md" + } + } + }, + { + "match": "(?<![0-9a-f])(([a-zA-Z0-9][a-zA-Z0-9\\-]*)(/)([a-zA-Z0-9][a-zA-Z0-9\\-\\._]*)((#)(\\d+)))(?![0-9a-f])", + "name": "reference.gfm.variable.md", + "captures": { + "2": { + "name": "user.gfm.md" + }, + "3": { + "name": "punctuation.md" + }, + "4": { + "name": "repository.gfm.md" + }, + "6": { + "name": "punctuation.md" + }, + "7": { + "name": "issue.gfm.md" + } + } + }, + { + "match": "(?<![0-9a-f])(([a-zA-Z0-9][a-zA-Z0-9\\-]*)(/)([a-zA-Z0-9][a-zA-Z0-9\\-\\._]*)(@)(([0-9a-f]{7})([0-9a-f]{33})))(?![0-9a-f])", + "name": "reference.gfm.variable.md", + "captures": { + "2": { + "name": "user.gfm.md" + }, + "3": { + "name": "punctuation.md" + }, + "4": { + "name": "repository.gfm.md" + }, + "5": { + "name": "punctuation.md" + }, + "6": { + "name": "sha.gfm.md" + }, + "8": { + "name": "punctuation.md" + } + } + }, + { + "match": "(?<![0-9a-f])(([a-zA-Z0-9][a-zA-Z0-9\\-]*)(@)(([0-9a-f]{7})([0-9a-f]{33})))(?![0-9a-f])", + "name": "reference.gfm.variable.md", + "captures": { + "2": { + "name": "user.gfm.md" + }, + "3": { + "name": "punctuation.md" + }, + "4": { + "name": "sha.gfm.md" + }, + "6": { + "name": "punctuation.md" + } + } + }, + { + "match": "(?<![0-9a-f])(([0-9a-f]{7})([0-9a-f]{33}))(?![0-9a-f])", + "name": "reference.gfm.variable.md", + "captures": { + "1": { + "name": "sha.gfm.md" + }, + "3": { + "name": "punctuation.md" + } + } + }, + { + "match": "({)([A-Z][a-zA-Z]+)(})", + "name": "class.reference.gfm.variable.md", + "captures": { + "1": { + "name": "punctuation.md" + }, + "3": { + "name": "punctuation.md" + } + } + }, + { + "match": "({)([A-Z][a-zA-Z]+)(::)([a-z][a-zA-Z]+)(})", + "name": "instance.method.reference.gfm.variable.md", + "captures": { + "1": { + "name": "punctuation.md" + }, + "3": { + "name": "punctuation.md" + }, + "5": { + "name": "punctuation.md" + } + } + }, + { + "match": "({)([A-Z][a-zA-Z]+)(.)([a-z][a-zA-Z]+)(})", + "name": "class.method.reference.gfm.variable.md", + "captures": { + "1": { + "name": "punctuation.md" + }, + "3": { + "name": "punctuation.md" + }, + "5": { + "name": "punctuation.md" + } + } + }, + { + "match": "(?<=^|[^\\w\\d~])(~~)(?!~)(.+?)(~~(?=$|[^\\w\\d~]))", + "name": "strike.markup.md", + "captures": { + "1": { + "name": "punctuation.md" + }, + "3": { + "name": "punctuation.md" + } + } + }, + { + "match": "(?<=^|\\s)(:)(\\+1|\\-1|100|1234|8ball|a|ab|abc|abcd|accept|aerial_tramway|airplane|alarm_clock|alien|ambulance|anchor|angel|anger|angry|anguished|ant|apple|aquarius|aries|arrow_backward|arrow_double_down|arrow_double_up|arrow_down|arrow_down_small|arrow_forward|arrow_heading_down|arrow_heading_up|arrow_left|arrow_lower_left|arrow_lower_right|arrow_right|arrow_right_hook|arrow_up|arrow_up_down|arrow_up_small|arrow_upper_left|arrow_upper_right|arrows_clockwise|arrows_counterclockwise|art|articulated_lorry|astonished|atm|b|baby|baby_bottle|baby_chick|baby_symbol|back|baggage_claim|balloon|ballot_box_with_check|bamboo|banana|bangbang|bank|bar_chart|barber|baseball|basketball|bath|bathtub|battery|bear|bee|beer|beers|beetle|beginner|bell|bento|bicyclist|bike|bikini|bird|birthday|black_circle|black_joker|black_medium_small_square|black_medium_square|black_nib|black_small_square|black_square|black_square_button|blossom|blowfish|blue_book|blue_car|blue_heart|blush|boar|boat|bomb|book|bookmark|bookmark_tabs|books|boom|boot|bouquet|bow|bowling|bowtie|boy|bread|bride_with_veil|bridge_at_night|briefcase|broken_heart|bug|bulb|bullettrain_front|bullettrain_side|bus|busstop|bust_in_silhouette|busts_in_silhouette|cactus|cake|calendar|calling|camel|camera|cancer|candy|capital_abcd|capricorn|car|card_index|carousel_horse|cat|cat2|cd|chart|chart_with_downwards_trend|chart_with_upwards_trend|checkered_flag|cherries|cherry_blossom|chestnut|chicken|children_crossing|chocolate_bar|christmas_tree|church|cinema|circus_tent|city_sunrise|city_sunset|cl|clap|clapper|clipboard|clock1|clock10|clock1030|clock11|clock1130|clock12|clock1230|clock130|clock2|clock230|clock3|clock330|clock4|clock430|clock5|clock530|clock6|clock630|clock7|clock730|clock8|clock830|clock9|clock930|closed_book|closed_lock_with_key|closed_umbrella|cloud|clubs|cn|cocktail|coffee|cold_sweat|collision|computer|confetti_ball|confounded|confused|congratulations|construction|construction_worker|convenience_store|cookie|cool|cop|copyright|corn|couple|couple_with_heart|couplekiss|cow|cow2|credit_card|crocodile|crossed_flags|crown|cry|crying_cat_face|crystal_ball|cupid|curly_loop|currency_exchange|curry|custard|customs|cyclone|dancer|dancers|dango|dart|dash|date|de|deciduous_tree|department_store|diamond_shape_with_a_dot_inside|diamonds|disappointed|disappointed_relieved|dizzy|dizzy_face|do_not_litter|dog|dog2|dollar|dolls|dolphin|donut|door|doughnut|dragon|dragon_face|dress|dromedary_camel|droplet|dvd|e\\-mail|ear|ear_of_rice|earth_africa|earth_americas|earth_asia|egg|eggplant|eight|eight_pointed_black_star|eight_spoked_asterisk|electric_plug|elephant|email|end|envelope|es|euro|european_castle|european_post_office|evergreen_tree|exclamation|expressionless|eyeglasses|eyes|facepunch|factory|fallen_leaf|family|fast_forward|fax|fearful|feelsgood|feet|ferris_wheel|file_folder|finnadie|fire|fire_engine|fireworks|first_quarter_moon|first_quarter_moon_with_face|fish|fish_cake|fishing_pole_and_fish|fist|five|flags|flashlight|floppy_disk|flower_playing_cards|flushed|foggy|football|fork_and_knife|fountain|four|four_leaf_clover|fr|free|fried_shrimp|fries|frog|frowning|fu|fuelpump|full_moon|full_moon_with_face|game_die|gb|gem|gemini|ghost|gift|gift_heart|girl|globe_with_meridians|goat|goberserk|godmode|golf|grapes|green_apple|green_book|green_heart|grey_exclamation|grey_question|grimacing|grin|grinning|guardsman|guitar|gun|haircut|hamburger|hammer|hamster|hand|handbag|hankey|hash|hatched_chick|hatching_chick|headphones|hear_no_evil|heart|heart_decoration|heart_eyes|heart_eyes_cat|heartbeat|heartpulse|hearts|heavy_check_mark|heavy_division_sign|heavy_dollar_sign|heavy_exclamation_mark|heavy_minus_sign|heavy_multiplication_x|heavy_plus_sign|helicopter|herb|hibiscus|high_brightness|high_heel|hocho|honey_pot|honeybee|horse|horse_racing|hospital|hotel|hotsprings|hourglass|hourglass_flowing_sand|house|house_with_garden|hurtrealbad|hushed|ice_cream|icecream|id|ideograph_advantage|imp|inbox_tray|incoming_envelope|information_desk_person|information_source|innocent|interrobang|iphone|it|izakaya_lantern|jack_o_lantern|japan|japanese_castle|japanese_goblin|japanese_ogre|jeans|joy|joy_cat|jp|key|keycap_ten|kimono|kiss|kissing|kissing_cat|kissing_closed_eyes|kissing_face|kissing_heart|kissing_smiling_eyes|koala|koko|kr|large_blue_circle|large_blue_diamond|large_orange_diamond|last_quarter_moon|last_quarter_moon_with_face|laughing|leaves|ledger|left_luggage|left_right_arrow|leftwards_arrow_with_hook|lemon|leo|leopard|libra|light_rail|link|lips|lipstick|lock|lock_with_ink_pen|lollipop|loop|loudspeaker|love_hotel|love_letter|low_brightness|m|mag|mag_right|mahjong|mailbox|mailbox_closed|mailbox_with_mail|mailbox_with_no_mail|man|man_with_gua_pi_mao|man_with_turban|mans_shoe|maple_leaf|mask|massage|meat_on_bone|mega|melon|memo|mens|metal|metro|microphone|microscope|milky_way|minibus|minidisc|mobile_phone_off|money_with_wings|moneybag|monkey|monkey_face|monorail|moon|mortar_board|mount_fuji|mountain_bicyclist|mountain_cableway|mountain_railway|mouse|mouse2|movie_camera|moyai|muscle|mushroom|musical_keyboard|musical_note|musical_score|mute|nail_care|name_badge|neckbeard|necktie|negative_squared_cross_mark|neutral_face|new|new_moon|new_moon_with_face|newspaper|ng|nine|no_bell|no_bicycles|no_entry|no_entry_sign|no_good|no_mobile_phones|no_mouth|no_pedestrians|no_smoking|non\\-potable_water|nose|notebook|notebook_with_decorative_cover|notes|nut_and_bolt|o|o2|ocean|octocat|octopus|oden|office|ok|ok_hand|ok_woman|older_man|older_woman|on|oncoming_automobile|oncoming_bus|oncoming_police_car|oncoming_taxi|one|open_file_folder|open_hands|open_mouth|ophiuchus|orange_book|outbox_tray|ox|package|page_facing_up|page_with_curl|pager|palm_tree|panda_face|paperclip|parking|part_alternation_mark|partly_sunny|passport_control|paw_prints|peach|pear|pencil|pencil2|penguin|pensive|performing_arts|persevere|person_frowning|person_with_blond_hair|person_with_pouting_face|phone|pig|pig2|pig_nose|pill|pineapple|pisces|pizza|plus1|point_down|point_left|point_right|point_up|point_up_2|police_car|poodle|poop|post_office|postal_horn|postbox|potable_water|pouch|poultry_leg|pound|pouting_cat|pray|princess|punch|purple_heart|purse|pushpin|put_litter_in_its_place|question|rabbit|rabbit2|racehorse|radio|radio_button|rage|rage1|rage2|rage3|rage4|railway_car|rainbow|raised_hand|raised_hands|raising_hand|ram|ramen|rat|recycle|red_car|red_circle|registered|relaxed|relieved|repeat|repeat_one|restroom|revolving_hearts|rewind|ribbon|rice|rice_ball|rice_cracker|rice_scene|ring|rocket|roller_coaster|rooster|rose|rotating_light|round_pushpin|rowboat|ru|rugby_football|runner|running|running_shirt_with_sash|sa|sagittarius|sailboat|sake|sandal|santa|satellite|satisfied|saxophone|school|school_satchel|scissors|scorpius|scream|scream_cat|scroll|seat|secret|see_no_evil|seedling|seven|shaved_ice|sheep|shell|ship|shipit|shirt|shit|shoe|shower|signal_strength|six|six_pointed_star|ski|skull|sleeping|sleepy|slot_machine|small_blue_diamond|small_orange_diamond|small_red_triangle|small_red_triangle_down|smile|smile_cat|smiley|smiley_cat|smiling_imp|smirk|smirk_cat|smoking|snail|snake|snowboarder|snowflake|snowman|sob|soccer|soon|sos|sound|space_invader|spades|spaghetti|sparkle|sparkler|sparkles|sparkling_heart|speak_no_evil|speaker|speech_balloon|speedboat|squirrel|star|star2|stars|station|statue_of_liberty|steam_locomotive|stew|straight_ruler|strawberry|stuck_out_tongue|stuck_out_tongue_closed_eyes|stuck_out_tongue_winking_eye|sun_with_face|sunflower|sunglasses|sunny|sunrise|sunrise_over_mountains|surfer|sushi|suspect|suspension_railway|sweat|sweat_drops|sweat_smile|sweet_potato|swimmer|symbols|syringe|tada|tanabata_tree|tangerine|taurus|taxi|tea|telephone|telephone_receiver|telescope|tennis|tent|thought_balloon|three|thumbsdown|thumbsup|ticket|tiger|tiger2|tired_face|tm|toilet|tokyo_tower|tomato|tongue|top|tophat|tractor|traffic_light|train|train2|tram|triangular_flag_on_post|triangular_ruler|trident|triumph|trolleybus|trollface|trophy|tropical_drink|tropical_fish|truck|trumpet|tshirt|tulip|turtle|tv|twisted_rightwards_arrows|two|two_hearts|two_men_holding_hands|two_women_holding_hands|u5272|u5408|u55b6|u6307|u6708|u6709|u6e80|u7121|u7533|u7981|u7a7a|uk|umbrella|unamused|underage|unlock|up|us|v|vertical_traffic_light|vhs|vibration_mode|video_camera|video_game|violin|virgo|volcano|vs|walking|waning_crescent_moon|waning_gibbous_moon|warning|watch|water_buffalo|watermelon|wave|wavy_dash|waxing_crescent_moon|waxing_gibbous_moon|wc|weary|wedding|whale|whale2|wheelchair|white_check_mark|white_circle|white_flower|white_large_square|white_medium_small_square|white_medium_square|white_small_square|white_square_button|wind_chime|wine_glass|wink|wolf|woman|womans_clothes|womans_hat|womens|worried|wrench|x|yellow_heart|yen|yum|zap|zero|zzz)(:)(?=\\s|$)", + "name": "emoji.constant.gfm.md", + "captures": { + "1": { + "name": "punctuation.md" + }, + "3": { + "name": "punctuation.md" + } + } + } + ] + }, + "ia-writer": { + "patterns": [ + { + "match": "(?x) ^\\s{0,3}( (/)([^'\"()]*?) (\\.[a-z0-9]+) (\\s*?) ((\"|')[^'\"]*?(\\7))? )$", + "captures": { + "1": { + "name": "block.content.link.markup.md" + }, + "2": { + "name": "punctuation.md" + }, + "6": { + "name": "title.string.markup.md" + }, + "7": { + "name": "punctuation.md" + }, + "8": { + "name": "punctuation.md" + } + } + }, + { + "match": "(?x) ^\\s{0,3}( (/)([^'\"()]*?) (\\.[a-z0-9]+) (\\s*?) ((\\()[^()]*?(\\)))? )$", + "captures": { + "1": { + "name": "block.content.link.markup.md" + }, + "2": { + "name": "punctuation.md" + }, + "6": { + "name": "title.string.markup.md" + }, + "7": { + "name": "punctuation.md" + }, + "8": { + "name": "punctuation.md" + } + } + } + ] + }, + "markdown-extra": { + "patterns": [ + { + "name": "definition.list.markup.md", + "match": "^(?:\\s*)(:)( +)(.*)$", + "captures": { + "1": { + "name": "punctuation.md" + } + } + }, + { + "name": "abbreviation.reference.link.markup.md", + "match": "^((?:\\*\\[)(?:[^\\]]+)(?:\\]))(:) (.*)$", + "captures": { + "1": { + "patterns": [ + { + "include": "#link-label" + } + ] + }, + "2": { + "name": "punctuation.md" + } + } + } + ] + }, + "math-block": { + "patterns": [ + { + "name": "block.math.markup.md", + "begin": "(\\${2})", + "end": "(\\${2})(?:.*)", + "patterns": [ + { + "include": "text.tex.latex" + } + ], + "beginCaptures": { + "1": { + "name": "punctuation.md" + } + }, + "endCaptures": { + "1": { + "name": "punctuation.md" + } + } + } + ] + }, + "math-inline": { + "patterns": [ + { + "name": "inline.math.markup.md", + "match": "(\\$)(?! )(.+?)(?<! )(\\$)(?!\\d)", + "captures": { + "1": { + "name": "punctuation.md" + }, + "2": { + "patterns": [ + { + "include": "text.tex.latex" + } + ] + }, + "3": { + "name": "punctuation.md" + } + } + } + ] + }, + "pandoc": { + "patterns": [ + { + "name": "table.storage.md", + "match": "^(\\+-+)+\\+$", + "captures": { + "0": { + "name": "punctuation.md" + } + } + }, + { + "name": "table.storage.md", + "match": "^(\\+=+)+\\+$", + "captures": { + "0": { + "name": "punctuation.md" + } + } + } + ] + }, + "rmarkdown-attributes": { + "patterns": [ + { + "match": "(?x) (?#<=^|,|,\\s) ([A-Za-z0-9\\.]+) (?:\\s?) (=) (?:\\s?) (TRUE|FALSE)", + "name": "rmarkdown.attribute.meta.md", + "captures": { + "1": { + "name": "key.keyword.md" + }, + "2": { + "name": "punctuation.md" + }, + "3": { + "name": "value.constant.md" + } + } + }, + { + "match": "(?x) (?#<=^|,|,\\s) ([A-Za-z0-9\\.]+) (?:\\s?) (=) (?:\\s?) ([A-Za-z0-9]+)", + "name": "rmarkdown.attribute.meta.md", + "captures": { + "1": { + "name": "key.keyword.md" + }, + "2": { + "name": "punctuation.md" + }, + "3": { + "name": "value.constant.md" + } + } + }, + { + "match": "(?x) (?#<=^|,|,\\s) ([A-Za-z0-9\\.]+) (?:\\s?) (=) (?:\\s?) ( ('|\") ([^\\4]*?) (\\4) )", + "name": "rmarkdown.attribute.meta.md", + "captures": { + "1": { + "name": "key.keyword.md" + }, + "2": { + "name": "punctuation.md" + }, + "3": { + "name": "value.string.md" + }, + "4": { + "name": "punctuation.md" + }, + "6": { + "name": "punctuation.md" + } + } + } + ] + }, + "rmarkdown": { + "patterns": [ + { + "begin": "(?x) (```)( \\{r\\s? (.*?) \\}$ )", + "end": "^(\\1)$", + "name": "fenced.code.md", + "contentName": "source.embedded.r", + "patterns": [ + { + "include": "source.r" + } + ], + "beginCaptures": { + "1": { + "name": "punctuation.md" + }, + "2": { + "patterns": [ + { + "begin": "(\\{)(r)(\\s?)", + "beginCaptures": { + "1": { + "name": "punctuation.md" + }, + "2": { + "name": "language.constant.md" + } + }, + "end": "(\\})$", + "endCaptures": { + "1": { + "name": "punctuation.md" + } + }, + "patterns": [ + { + "include": "#rmarkdown-attributes" + } + ] + } + ] + } + }, + "endCaptures": { + "1": { + "name": "punctuation.md" + } + } + } + ] + }, + "special-attribute-elements": { + "patterns": [ + { + "name": "id.special.attribute.meta.md", + "match": "(?<=^|\\s)(#)([^\\s|\\}]*)", + "captures": { + "1": { + "name": "punctuation.md" + } + } + }, + { + "name": "class.special.attribute.meta.md", + "match": "(\\.)([^\\s|\\}]*)", + "captures": { + "1": { + "name": "punctuation.md" + } + } + }, + { + "match": "([^ ]+)(=)([^\\s|\\}]*)", + "name": "other.special.attribute.meta.md", + "captures": { + "1": { + "name": "key.keyword.md" + }, + "2": { + "name": "punctuation.md" + }, + "3": { + "name": "value.string.md" + } + } + } + ] + }, + "special-attributes": { + "patterns": [ + { + "name": "special-attributes.raw.markup.md", + "match": "^(\\{)([^\\}]*)(\\})$", + "captures": { + "1": { + "name": "punctuation.md" + }, + "2": { + "patterns": [ + { + "include": "#special-attribute-elements" + } + ] + }, + "3": { + "name": "punctuation.md" + } + } + } + ] + }, + "code": { + "patterns": [ + { + "match": "(?<!`)(`+)(?!`).+?(?<!`)(\\1)(?!`)", + "name": "code.raw.markup.md", + "captures": { + "1": { + "name": "punctuation.md" + }, + "2": { + "name": "punctuation.md" + } + } + } + ] + }, + "comments": { + "patterns": [ + { + "name": "comment.md", + "begin": "(<!(?:-{2,}))", + "end": "((?:-{2,})>)", + "captures": { + "1": { + "name": "punctuation.md" + }, + "3": { + "name": "punctuation.md" + } + } + } + ] + }, + "emphasis": { + "patterns": [ + { + "match": "(?<![\\w|\\\\])([_]{2})(?!\\s)(?m:(.+?))(?<![\\s|\\\\])(\\1)(?!\\w)", + "name": "strong.emphasis.bold.markup.md", + "captures": { + "1": { + "name": "punctuation.md" + }, + "2": { + "patterns": [ + { + "include": "#inlines-in-inlines" + } + ] + }, + "3": { + "name": "punctuation.md" + } + } + }, + { + "match": "(?<![\\w|\\\\])([\\*]{2})(?!\\s)(?m:(.+?))(?<![\\s|\\\\])(\\1)(?!\\w)", + "name": "strong.emphasis.bold.markup.md", + "captures": { + "1": { + "name": "punctuation.md" + }, + "2": { + "patterns": [ + { + "include": "#inlines-in-inlines" + } + ] + }, + "3": { + "name": "punctuation.md" + } + } + }, + { + "match": "(?<=\\w)([\\*]{2})(?:.+?)(?<!\\W)(\\1)", + "name": "strong.emphasis.bold.markup.md", + "captures": { + "1": { + "name": "punctuation.md" + }, + "2": { + "name": "punctuation.md" + } + } + }, + { + "match": "(?<=\\s|^)([\\*]{2})(?=\\w)(?:.+?)(\\1)(?=\\w)", + "name": "strong.emphasis.bold.markup.md", + "captures": { + "1": { + "name": "punctuation.md" + }, + "2": { + "name": "punctuation.md" + } + } + }, + { + "match": "(?<![\\w|_|\\\\])([_])(?!\\s|\\1)(?m:(.+?))(?<![\\s|\\\\])(\\1)(?!\\w)", + "name": "emphasis.italic.markup.md", + "captures": { + "1": { + "name": "punctuation.md" + }, + "2": { + "patterns": [ + { + "include": "#inlines-in-inlines" + } + ] + }, + "3": { + "name": "punctuation.md" + } + } + }, + { + "match": "(?<![\\w|\\*|\\\\])([\\*])(?!\\s|\\1)(?m:(.+?))(?<![\\s|\\\\])(\\1)(?!\\w)", + "name": "emphasis.italic.markup.md", + "captures": { + "1": { + "name": "punctuation.md" + }, + "2": { + "patterns": [ + { + "include": "#inlines-in-inlines" + } + ] + }, + "3": { + "name": "punctuation.md" + } + } + }, + { + "match": "(?<=\\w)([\\*])(?:.+?)(?<!\\W)(\\1)", + "name": "emphasis.italic.markup.md", + "captures": { + "1": { + "name": "punctuation.md" + }, + "2": { + "name": "punctuation.md" + } + } + }, + { + "match": "(?<=\\s|^)([\\*])(?=\\w)(?:.+?)(\\1)(?=\\w)", + "name": "emphasis.italic.markup.md", + "captures": { + "1": { + "name": "punctuation.md" + }, + "2": { + "name": "punctuation.md" + } + } + } + ] + }, + "entities": { + "patterns": [ + { + "match": "(?<=^|\\s)(&)(?=$|\\s|,|!|\\?|\\.)", + "name": "ampersand.md" + }, + { + "match": "(&)([a-zA-Z0-9]{2,32})(;)", + "name": "entity.constant.md", + "captures": { + "1": { + "name": "punctuation.md" + }, + "3": { + "name": "punctuation.md" + } + } + }, + { + "match": "(&#)([0-9]{1,8})(;)", + "name": "entity.constant.md", + "captures": { + "1": { + "name": "punctuation.md" + }, + "3": { + "name": "punctuation.md" + } + } + }, + { + "match": "(&#[x|X])([0-9a-fA-F]{1,8})(;)", + "name": "entity.constant.md", + "captures": { + "1": { + "name": "punctuation.md" + }, + "3": { + "name": "punctuation.md" + } + } + } + ] + }, + "escapes": { + "patterns": [ + { + "match": "\\\\.", + "name": "escape.constant.md" + } + ] + }, + "html": { + "patterns": [ + { + "match": "<(?![a-zA-Z!/])", + "name": "" + }, + { + "include": "text.html.basic" + } + ] + }, + "line-breaks": { + "patterns": [ + { + "match": "( )$", + "name": "line-break.constant.md" + }, + { + "match": "(\\\\)$", + "name": "line-break.constant.md" + } + ] + }, + "link-destination": { + "patterns": [ + { + "name": "destination.link.md", + "match": "^(<)(.*)(>)$", + "captures": { + "1": { + "name": "punctuation.md" + }, + "2": { + "name": "markup.underline.link" + }, + "3": { + "name": "punctuation.md" + } + } + }, + { + "name": "destination.link.md", + "match": "(.+)", + "captures": { + "1": { + "name": "markup.underline.link" + } + } + } + ] + }, + "link-label": { + "patterns": [ + { + "name": "label.link.string.md", + "match": "^(\\*?\\[\\^?)(.*)(\\])$", + "captures": { + "1": { + "name": "punctuation.md" + }, + "2": { + "patterns": [ + { + "include": "#references" + } + ] + }, + "3": { + "name": "punctuation.md" + } + } + } + ] + }, + "link-text": { + "patterns": [ + { + "name": "text.link.string.md", + "match": "(?x) ^(\\[) ( ( (?:!\\[) (?:[^\\[\\]]*) (?:\\]) ) (\\() ([^ [:cntrl:]]+)? (?: (?:\\s+) ( (?:[\"'\\(]) .*? (?:[\"'\\)]) ) (?:\\s*) )? (\\)) (\\{[[:ascii:]]*\\})? ) (\\])", + "captures": { + "1": { + "name": "punctuation.md" + }, + "2": { + "name": "link.markup.md" + }, + "3": { + "patterns": [ + { + "include": "#link-text" + } + ] + }, + "4": { + "name": "punctuation.md" + }, + "5": { + "patterns": [ + { + "include": "#link-destination" + } + ] + }, + "6": { + "patterns": [ + { + "include": "#link-title" + } + ] + }, + "7": { + "name": "punctuation.md" + }, + "8": { + "patterns": [ + { + "include": "#special-attributes" + } + ] + }, + "9": { + "name": "punctuation.md" + } + } + }, + { + "name": "image.link.string.md", + "match": "^(!\\[)(.*)(\\])$", + "captures": { + "1": { + "name": "punctuation.md" + }, + "2": { + "patterns": [ + { + "include": "#emphasis" + }, + { + "include": "#code" + } + ] + }, + "3": { + "name": "punctuation.md" + } + } + }, + { + "name": "text.link.string.md", + "match": "^(\\[)(.*)(\\])$", + "captures": { + "1": { + "name": "punctuation.md" + }, + "2": { + "patterns": [ + { + "include": "#emphasis" + }, + { + "include": "#code" + } + ] + }, + "3": { + "name": "punctuation.md" + } + } + } + ] + }, + "link-title": { + "patterns": [ + { + "name": "title.link.md", + "match": "^(['|\"])(.*)(\\1)$", + "captures": { + "1": { + "name": "punctuation.md" + }, + "3": { + "name": "punctuation.md" + } + } + }, + { + "name": "title.link.md", + "match": "^(\\()(.*)(\\))$", + "captures": { + "1": { + "name": "punctuation.md" + }, + "3": { + "name": "punctuation.md" + } + } + } + ] + }, + "links": { + "patterns": [ + { + "name": "reference.footnote.link.markup.md", + "match": "((?:\\[\\^)(?:[^\\[\\]]+)(?:\\]))(?!:)", + "captures": { + "1": { + "patterns": [ + { + "include": "#link-label" + } + ] + } + } + }, + { + "name": "definition.footnote.link.markup.md", + "match": "((?:\\[\\^)(?:[^\\[\\]]+)(?:\\]))(:)", + "captures": { + "1": { + "patterns": [ + { + "include": "#link-label" + } + ] + }, + "2": { + "name": "punctuation.md" + } + } + }, + { + "name": "link.markup.md", + "match": "(?x) ( (?:\\[) (?: (?: (?:!\\[) (?:[^\\[\\]]*) (?:\\]) ) (?:\\() (?:[^ [:cntrl:]]+)? (?: (?:\\s+) (?: (?:[\"'\\(]) .*? (?:[\"'\\)]) ) (?:\\s*) )? (?:\\)) (?:\\{[[:ascii:]]*\\})? ) (?:\\]) ) (\\() ([^ [:cntrl:]]+)? (?: (?:\\s+) ( (?:[\"'\\(]) .*? (?:[\"'\\)]) ) (?:\\s*) )? (\\)) (\\{[^}]*\\})?", + "captures": { + "1": { + "patterns": [ + { + "include": "#link-text" + } + ] + }, + "2": { + "name": "punctuation.md" + }, + "3": { + "patterns": [ + { + "include": "#link-destination" + } + ] + }, + "4": { + "patterns": [ + { + "include": "#link-title" + } + ] + }, + "5": { + "name": "punctuation.md" + }, + "6": { + "patterns": [ + { + "include": "#special-attributes" + } + ] + } + } + }, + { + "name": "link.markup.md", + "match": "(?x) ( (?:!?\\[) (?:[^\\[\\]]*) (?:\\]) ) (\\() ([^ [:cntrl:]()]+)? (?: (?:\\s+) ( (?:[\"'\\(]) .*? (?:[\"'\\)]) ) (?:\\s*) )? (\\)) (\\{[^}]*\\})?", + "captures": { + "1": { + "patterns": [ + { + "include": "#link-text" + } + ] + }, + "2": { + "name": "punctuation.md" + }, + "3": { + "patterns": [ + { + "include": "#link-destination" + } + ] + }, + "4": { + "patterns": [ + { + "include": "#link-title" + } + ] + }, + "5": { + "name": "punctuation.md" + }, + "6": { + "patterns": [ + { + "include": "#special-attributes" + } + ] + } + } + }, + { + "name": "link.markup.md", + "match": "(?x) ( (?:!?\\[) (?:[^\\[\\]]*) (?:\\]) ) (\\() (<[^[:cntrl:]]*>) (?: (?:\\s+) ( (?:[\"'\\(]) .*? (?:[\"'\\)]) ) (?:\\s*) )? (\\)) (\\{[^}]*\\})?", + "captures": { + "1": { + "patterns": [ + { + "include": "#link-text" + } + ] + }, + "2": { + "name": "punctuation.md" + }, + "3": { + "patterns": [ + { + "include": "#link-destination" + } + ] + }, + "4": { + "patterns": [ + { + "include": "#link-title" + } + ] + }, + "5": { + "name": "punctuation.md" + }, + "6": { + "patterns": [ + { + "include": "#special-attributes" + } + ] + } + } + }, + { + "name": "link.markup.md", + "match": "(?x) ( (?:\\[) (?: (?: (?:!\\[) (?:[^\\[\\]]*) (?:\\]) ) (?:\\() (?:[^ [:cntrl:]]+)? (?: (?:\\s+) (?: (?:[\"'\\(]) .*? (?:[\"'\\)]) ) (?:\\s*) )? (?:\\)) (?:\\{[[:ascii:]]*\\})? ) (?:\\]) ) ( (?:\\[) (?:[^\\[\\]]*) (?:\\]) ) (\\{[^}]*\\})?", + "captures": { + "1": { + "patterns": [ + { + "include": "#link-text" + } + ] + }, + "2": { + "patterns": [ + { + "include": "#link-label" + } + ] + }, + "3": { + "patterns": [ + { + "include": "#special-attributes" + } + ] + } + } + }, + { + "name": "link.markup.md", + "match": "(?x) ( (?:!?\\[) (?:[^\\[\\]]*) (?:\\]) ) ( (?:\\[) (?:[^\\[\\]]*) (?:\\]) ) (\\{[^}]*\\})?", + "captures": { + "1": { + "patterns": [ + { + "include": "#link-text" + } + ] + }, + "2": { + "patterns": [ + { + "include": "#link-label" + } + ] + }, + "3": { + "patterns": [ + { + "include": "#special-attributes" + } + ] + } + } + }, + { + "name": "link.markup.md", + "match": "(?x) ( (?:!\\[) (?:[^\\[\\]]*) (?:\\]) ) (\\{[^}]*\\})?", + "captures": { + "1": { + "patterns": [ + { + "include": "#link-text" + } + ] + }, + "2": { + "patterns": [ + { + "include": "#special-attributes" + } + ] + } + } + }, + { + "name": "reference.link.markup.md", + "match": "(?x) ((?:\\[)(?:[^\\[\\]]*)(?:\\])) (:) (?:\\s) ([^ [:cntrl:]]+) (?:(?:\\s)((?:\")(?:.*?)(?:\")))? (?:(?:\\s)(\\{[[:ascii:]]*\\}))?", + "captures": { + "1": { + "patterns": [ + { + "include": "#link-label" + } + ] + }, + "2": { + "name": "punctuation.md" + }, + "3": { + "patterns": [ + { + "include": "#link-destination" + } + ] + }, + "4": { + "patterns": [ + { + "include": "#link-title" + } + ] + }, + "5": { + "patterns": [ + { + "include": "#special-attributes" + } + ] + } + } + }, + { + "match": "(?x) ( (?:\\[) (?:[^\\[\\]]*) (?:\\]) ) (?!:) (\\{[^}]*\\})?", + "captures": { + "1": { + "patterns": [ + { + "include": "#link-label" + } + ] + }, + "2": { + "patterns": [ + { + "include": "#special-attributes" + } + ] + } + } + }, + { + "name": "auto.link.markup.md", + "match": "(?i:(<)((coap|doi|javascript|aaa|aaas|about|acap|cap|cid|crid|data|dav|dict|dns|file|ftp|geo|go|gopher|h323|http|https|iax|icap|im|imap|info|ipp|iris|iris.beep|iris.xpc|iris.xpcs|iris.lwz|ldap|mailto|mid|msrp|msrps|mtqp|mupdate|news|nfs|ni|nih|nntp|opaquelocktoken|pop|pres|rtsp|service|session|shttp|sieve|sip|sips|sms|snmp|soap.beep|soap.beeps|tag|tel|telnet|tftp|thismessage|tn3270|tip|tv|urn|vemmi|ws|wss|xcon|xcon-userid|xmlrpc.beep|xmlrpc.beeps|xmpp|z39.50r|z39.50s|adiumxtra|afp|afs|aim|apt|attachment|aw|beshare|bitcoin|bolo|callto|chrome|chrome-extension|com-eventbrite-attendee|content|cvs|dlna-playsingle|dlna-playcontainer|dtn|dvb|ed2k|facetime|feed|finger|fish|gg|git|gizmoproject|gtalk|hcp|icon|ipn|irc|irc6|ircs|itms|jar|jms|keyparc|lastfm|ldaps|magnet|maps|market|message|mms|ms-help|msnim|mumble|mvn|notes|oid|palm|paparazzi|platform|proxy|psyc|query|res|resource|rmi|rsync|rtmp|secondlife|sftp|sgn|skype|smb|soldat|spotify|ssh|steam|svn|teamspeak|things|udp|unreal|ut2004|ventrilo|view-source|webcal|wtai|wyciwyg|xfire|xri|ymsgr):(?:[^ [:cntrl:]<>]+))(>))", + "captures": { + "1": { + "name": "punctuation.md" + }, + "2": { + "name": "markup.underline.link" + }, + "4": { + "name": "punctuation.md" + } + } + }, + { + "name": "email.auto.link.markup.md", + "match": "(<)(([a-zA-Z0-9\\.!#$%&'\\*\\+/=?^_`{\\|}~-]+)(@)([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*))(>)", + "captures": { + "1": { + "name": "punctuation.md" + }, + "2": { + "name": "markup.underline.link" + }, + "4": { + "name": "punctuation.md" + }, + "6": { + "name": "punctuation.md" + } + } + } + ] + }, + "liquid": { + "patterns": [ + { + "include": "text.html.liquid" + } + ] + }, + "references": { + "patterns": [ + { + "match": "(?x) (?<=^|\\s|\"|'|\\(|\\[) ( (-?@) ( [a-zA-Z0-9_] [a-zA-Z0-9_:.#$%&+?<>~/-]* (?<![:|.|+|?|<|>|/|-]) ) )", + "captures": { + "2": { + "name": "punctuation.md" + } + }, + "name": "reference.variable.md" + } + ] + }, + "todo": { + "patterns": [ + { + "match": "(?<!\\w)@?(TODO|FIXME|CHANGED|XXX|IDEA|HACK|NOTE|REVIEW|NB|BUG|QUESTION|COMBAK|TEMP)\\b", + "name": "storage.type.class.${1:/downcase}.md" + } + ] + }, + "fenced-code-blocks": { + "patterns": [ + { + "begin": "^\\s*([`~]{3,})\\s*(\\{?)((?:\\.?)(?:apib|apiblueprint))(?=(}| |$|{))\\s*(\\{?)([^`\\{\\}]*)(\\}?)$", + "beginCaptures": { + "1": { + "name": "punctuation.md" + }, + "2": { + "name": "punctuation.md" + }, + "3": { + "name": "language.constant.md" + }, + "5": { + "name": "punctuation.md" + }, + "6": { + "patterns": [ + { + "include": "#special-attribute-elements" + } + ] + }, + "7": { + "name": "punctuation.md" + } + }, + "end": "^\\s*(\\1)$", + "endCaptures": { + "1": { + "name": "punctuation.md" + } + }, + "name": "fenced.code.md", + "contentName": "source.embedded.gfm.apib", + "patterns": [ + { + "include": "text.html.markdown.source.gfm.apib" + } + ] + }, + { + "begin": "^\\s*([`~]{3,})\\s*(\\{?)((?:\\.?)(?:ass))(?=(}| |$|{))\\s*(\\{?)([^`\\{\\}]*)(\\}?)$", + "beginCaptures": { + "1": { + "name": "punctuation.md" + }, + "2": { + "name": "punctuation.md" + }, + "3": { + "name": "language.constant.md" + }, + "5": { + "name": "punctuation.md" + }, + "6": { + "patterns": [ + { + "include": "#special-attribute-elements" + } + ] + }, + "7": { + "name": "punctuation.md" + } + }, + "end": "^\\s*(\\1)$", + "endCaptures": { + "1": { + "name": "punctuation.md" + } + }, + "name": "fenced.code.md", + "contentName": "source.embedded.ass", + "patterns": [ + { + "include": "source.ass" + } + ] + }, + { + "begin": "^\\s*([`~]{3,})\\s*(\\{?)((?:\\.?)(?:babel))(?=(}| |$|{))\\s*(\\{?)([^`\\{\\}]*)(\\}?)$", + "beginCaptures": { + "1": { + "name": "punctuation.md" + }, + "2": { + "name": "punctuation.md" + }, + "3": { + "name": "language.constant.md" + }, + "5": { + "name": "punctuation.md" + }, + "6": { + "patterns": [ + { + "include": "#special-attribute-elements" + } + ] + }, + "7": { + "name": "punctuation.md" + } + }, + "end": "^\\s*(\\1)$", + "endCaptures": { + "1": { + "name": "punctuation.md" + } + }, + "name": "fenced.code.md", + "contentName": "source.embedded.js.jsx", + "patterns": [ + { + "include": "source.js.jsx" + } + ] + }, + { + "begin": "^\\s*([`~]{3,})\\s*(\\{?)((?:\\.?)(?:coffee|coffeescript|coffee-script))(?=(}| |$|{))\\s*(\\{?)([^`\\{\\}]*)(\\}?)$", + "beginCaptures": { + "1": { + "name": "punctuation.md" + }, + "2": { + "name": "punctuation.md" + }, + "3": { + "name": "language.constant.md" + }, + "5": { + "name": "punctuation.md" + }, + "6": { + "patterns": [ + { + "include": "#special-attribute-elements" + } + ] + }, + "7": { + "name": "punctuation.md" + } + }, + "end": "^\\s*(\\1)$", + "endCaptures": { + "1": { + "name": "punctuation.md" + } + }, + "name": "fenced.code.md", + "contentName": "source.embedded.coffee", + "patterns": [ + { + "include": "source.coffee" + } + ] + }, + { + "begin": "^\\s*([`~]{3,})\\s*(\\{?)((?:\\.?)(?:c))(?=(}| |$|{))\\s*(\\{?)([^`\\{\\}]*)(\\}?)$", + "beginCaptures": { + "1": { + "name": "punctuation.md" + }, + "2": { + "name": "punctuation.md" + }, + "3": { + "name": "language.constant.md" + }, + "5": { + "name": "punctuation.md" + }, + "6": { + "patterns": [ + { + "include": "#special-attribute-elements" + } + ] + }, + "7": { + "name": "punctuation.md" + } + }, + "end": "^\\s*(\\1)$", + "endCaptures": { + "1": { + "name": "punctuation.md" + } + }, + "name": "fenced.code.md", + "contentName": "source.embedded.c", + "patterns": [ + { + "include": "source.c" + } + ] + }, + { + "begin": "^\\s*([`~]{3,})\\s*(\\{?)((?:\\.?)(?:clean))(?=(}| |$|{))\\s*(\\{?)([^`\\{\\}]*)(\\}?)$", + "beginCaptures": { + "1": { + "name": "punctuation.md" + }, + "2": { + "name": "punctuation.md" + }, + "3": { + "name": "language.constant.md" + }, + "5": { + "name": "punctuation.md" + }, + "6": { + "patterns": [ + { + "include": "#special-attribute-elements" + } + ] + }, + "7": { + "name": "punctuation.md" + } + }, + "end": "^\\s*(\\1)$", + "endCaptures": { + "1": { + "name": "punctuation.md" + } + }, + "name": "fenced.code.md", + "contentName": "source.embedded.clean", + "patterns": [ + { + "include": "source.clean" + } + ] + }, + { + "begin": "^\\s*([`~]{3,})\\s*(\\{?)((?:\\.?)(?:clojure))(?=(}| |$|{))\\s*(\\{?)([^`\\{\\}]*)(\\}?)$", + "beginCaptures": { + "1": { + "name": "punctuation.md" + }, + "2": { + "name": "punctuation.md" + }, + "3": { + "name": "language.constant.md" + }, + "5": { + "name": "punctuation.md" + }, + "6": { + "patterns": [ + { + "include": "#special-attribute-elements" + } + ] + }, + "7": { + "name": "punctuation.md" + } + }, + "end": "^\\s*(\\1)$", + "endCaptures": { + "1": { + "name": "punctuation.md" + } + }, + "name": "fenced.code.md", + "contentName": "source.embedded.clojure", + "patterns": [ + { + "include": "source.clojure" + } + ] + }, + { + "begin": "^\\s*([`~]{3,})\\s*(\\{?)((?:\\.?)(?:cpp|c\\+\\+))(?=(}| |$|{))\\s*(\\{?)([^`\\{\\}]*)(\\}?)$", + "beginCaptures": { + "1": { + "name": "punctuation.md" + }, + "2": { + "name": "punctuation.md" + }, + "3": { + "name": "language.constant.md" + }, + "5": { + "name": "punctuation.md" + }, + "6": { + "patterns": [ + { + "include": "#special-attribute-elements" + } + ] + }, + "7": { + "name": "punctuation.md" + } + }, + "end": "^\\s*(\\1)$", + "endCaptures": { + "1": { + "name": "punctuation.md" + } + }, + "name": "fenced.code.md", + "contentName": "source.embedded.cpp", + "patterns": [ + { + "include": "source.cpp" + } + ] + }, + { + "begin": "^\\s*([`~]{3,})\\s*(\\{?)((?:\\.?)(?:cr|crystal))(?=(}| |$|{))\\s*(\\{?)([^`\\{\\}]*)(\\}?)$", + "beginCaptures": { + "1": { + "name": "punctuation.md" + }, + "2": { + "name": "punctuation.md" + }, + "3": { + "name": "language.constant.md" + }, + "5": { + "name": "punctuation.md" + }, + "6": { + "patterns": [ + { + "include": "#special-attribute-elements" + } + ] + }, + "7": { + "name": "punctuation.md" + } + }, + "end": "^\\s*(\\1)$", + "endCaptures": { + "1": { + "name": "punctuation.md" + } + }, + "name": "fenced.code.md", + "contentName": "source.embedded.crystal", + "patterns": [ + { + "include": "source.crystal" + } + ] + }, + { + "begin": "^\\s*([`~]{3,})\\s*(\\{?)((?:\\.?)(?:cs|csharp))(?=(}| |$|{))\\s*(\\{?)([^`\\{\\}]*)(\\}?)$", + "beginCaptures": { + "1": { + "name": "punctuation.md" + }, + "2": { + "name": "punctuation.md" + }, + "3": { + "name": "language.constant.md" + }, + "5": { + "name": "punctuation.md" + }, + "6": { + "patterns": [ + { + "include": "#special-attribute-elements" + } + ] + }, + "7": { + "name": "punctuation.md" + } + }, + "end": "^\\s*(\\1)$", + "endCaptures": { + "1": { + "name": "punctuation.md" + } + }, + "name": "fenced.code.md", + "contentName": "source.embedded.cs", + "patterns": [ + { + "include": "source.cs" + } + ] + }, + { + "begin": "^\\s*([`~]{3,})\\s*(\\{?)((?:\\.?)(?:css))(?=(}| |$|{))\\s*(\\{?)([^`\\{\\}]*)(\\}?)$", + "beginCaptures": { + "1": { + "name": "punctuation.md" + }, + "2": { + "name": "punctuation.md" + }, + "3": { + "name": "language.constant.md" + }, + "5": { + "name": "punctuation.md" + }, + "6": { + "patterns": [ + { + "include": "#special-attribute-elements" + } + ] + }, + "7": { + "name": "punctuation.md" + } + }, + "end": "^\\s*(\\1)$", + "endCaptures": { + "1": { + "name": "punctuation.md" + } + }, + "name": "fenced.code.md", + "contentName": "source.embedded.css", + "patterns": [ + { + "include": "source.css" + } + ] + }, + { + "begin": "^\\s*([`~]{3,})\\s*(\\{?)((?:\\.?)(?:diff|patch|rej))(?=(}| |$|{))\\s*(\\{?)([^`\\{\\}]*)(\\}?)$", + "beginCaptures": { + "1": { + "name": "punctuation.md" + }, + "2": { + "name": "punctuation.md" + }, + "3": { + "name": "language.constant.md" + }, + "5": { + "name": "punctuation.md" + }, + "6": { + "patterns": [ + { + "include": "#special-attribute-elements" + } + ] + }, + "7": { + "name": "punctuation.md" + } + }, + "end": "^\\s*(\\1)$", + "endCaptures": { + "1": { + "name": "punctuation.md" + } + }, + "name": "fenced.code.md", + "contentName": "source.embedded.diff", + "patterns": [ + { + "include": "source.diff" + } + ] + }, + { + "begin": "^\\s*([`~]{3,})\\s*(\\{?)((?:\\.?)(?:elixir))(?=(}| |$|{))\\s*(\\{?)([^`\\{\\}]*)(\\}?)$", + "beginCaptures": { + "1": { + "name": "punctuation.md" + }, + "2": { + "name": "punctuation.md" + }, + "3": { + "name": "language.constant.md" + }, + "5": { + "name": "punctuation.md" + }, + "6": { + "patterns": [ + { + "include": "#special-attribute-elements" + } + ] + }, + "7": { + "name": "punctuation.md" + } + }, + "end": "^\\s*(\\1)$", + "endCaptures": { + "1": { + "name": "punctuation.md" + } + }, + "name": "fenced.code.md", + "contentName": "source.embedded.elixir", + "patterns": [ + { + "include": "source.elixir" + } + ] + }, + { + "begin": "^\\s*([`~]{3,})\\s*(\\{?)((?:\\.?)(?:elm))(?=(}| |$|{))\\s*(\\{?)([^`\\{\\}]*)(\\}?)$", + "beginCaptures": { + "1": { + "name": "punctuation.md" + }, + "2": { + "name": "punctuation.md" + }, + "3": { + "name": "language.constant.md" + }, + "5": { + "name": "punctuation.md" + }, + "6": { + "patterns": [ + { + "include": "#special-attribute-elements" + } + ] + }, + "7": { + "name": "punctuation.md" + } + }, + "end": "^\\s*(\\1)$", + "endCaptures": { + "1": { + "name": "punctuation.md" + } + }, + "name": "fenced.code.md", + "contentName": "source.embedded.elm", + "patterns": [ + { + "include": "source.elm" + } + ] + }, + { + "begin": "^\\s*([`~]{3,})\\s*(\\{?)((?:\\.?)(?:erlang))(?=(}| |$|{))\\s*(\\{?)([^`\\{\\}]*)(\\}?)$", + "beginCaptures": { + "1": { + "name": "punctuation.md" + }, + "2": { + "name": "punctuation.md" + }, + "3": { + "name": "language.constant.md" + }, + "5": { + "name": "punctuation.md" + }, + "6": { + "patterns": [ + { + "include": "#special-attribute-elements" + } + ] + }, + "7": { + "name": "punctuation.md" + } + }, + "end": "^\\s*(\\1)$", + "endCaptures": { + "1": { + "name": "punctuation.md" + } + }, + "name": "fenced.code.md", + "contentName": "source.embedded.erlang", + "patterns": [ + { + "include": "source.erlang" + } + ] + }, + { + "begin": "^\\s*([`~]{3,})\\s*(\\{?)((?:\\.?)(?:go|golang))(?=(}| |$|{))\\s*(\\{?)([^`\\{\\}]*)(\\}?)$", + "beginCaptures": { + "1": { + "name": "punctuation.md" + }, + "2": { + "name": "punctuation.md" + }, + "3": { + "name": "language.constant.md" + }, + "5": { + "name": "punctuation.md" + }, + "6": { + "patterns": [ + { + "include": "#special-attribute-elements" + } + ] + }, + "7": { + "name": "punctuation.md" + } + }, + "end": "^\\s*(\\1)$", + "endCaptures": { + "1": { + "name": "punctuation.md" + } + }, + "name": "fenced.code.md", + "contentName": "source.embedded.go", + "patterns": [ + { + "include": "source.go" + } + ] + }, + { + "begin": "^\\s*([`~]{3,})\\s*(\\{?)((?:\\.?)(?:haskell))(?=(}| |$|{))\\s*(\\{?)([^`\\{\\}]*)(\\}?)$", + "beginCaptures": { + "1": { + "name": "punctuation.md" + }, + "2": { + "name": "punctuation.md" + }, + "3": { + "name": "language.constant.md" + }, + "5": { + "name": "punctuation.md" + }, + "6": { + "patterns": [ + { + "include": "#special-attribute-elements" + } + ] + }, + "7": { + "name": "punctuation.md" + } + }, + "end": "^\\s*(\\1)$", + "endCaptures": { + "1": { + "name": "punctuation.md" + } + }, + "name": "fenced.code.md", + "contentName": "source.embedded.haskell", + "patterns": [ + { + "include": "source.haskell" + } + ] + }, + { + "begin": "^\\s*([`~]{3,})\\s*(\\{?)((?:\\.?)(?:hcl))(?=(}| |$|{))\\s*(\\{?)([^`\\{\\}]*)(\\}?)$", + "beginCaptures": { + "1": { + "name": "punctuation.md" + }, + "2": { + "name": "punctuation.md" + }, + "3": { + "name": "language.constant.md" + }, + "5": { + "name": "punctuation.md" + }, + "6": { + "patterns": [ + { + "include": "#special-attribute-elements" + } + ] + }, + "7": { + "name": "punctuation.md" + } + }, + "end": "^\\s*(\\1)$", + "endCaptures": { + "1": { + "name": "punctuation.md" + } + }, + "name": "fenced.code.md", + "contentName": "source.embedded.hcl", + "patterns": [ + { + "include": "source.hcl" + } + ] + }, + { + "begin": "^\\s*([`~]{3,})\\s*(\\{?)((?:\\.?)(?:html))(?=(}| |$|{))\\s*(\\{?)([^`\\{\\}]*)(\\}?)$", + "beginCaptures": { + "1": { + "name": "punctuation.md" + }, + "2": { + "name": "punctuation.md" + }, + "3": { + "name": "language.constant.md" + }, + "5": { + "name": "punctuation.md" + }, + "6": { + "patterns": [ + { + "include": "#special-attribute-elements" + } + ] + }, + "7": { + "name": "punctuation.md" + } + }, + "end": "^\\s*(\\1)$", + "endCaptures": { + "1": { + "name": "punctuation.md" + } + }, + "name": "fenced.code.md", + "contentName": "source.embedded.html", + "patterns": [ + { + "include": "text.html.basic" + } + ] + }, + { + "begin": "^\\s*([`~]{3,})\\s*(\\{?)((?:\\.?)(?:idris))(?=(}| |$|{))\\s*(\\{?)([^`\\{\\}]*)(\\}?)$", + "beginCaptures": { + "1": { + "name": "punctuation.md" + }, + "2": { + "name": "punctuation.md" + }, + "3": { + "name": "language.constant.md" + }, + "5": { + "name": "punctuation.md" + }, + "6": { + "patterns": [ + { + "include": "#special-attribute-elements" + } + ] + }, + "7": { + "name": "punctuation.md" + } + }, + "end": "^\\s*(\\1)$", + "endCaptures": { + "1": { + "name": "punctuation.md" + } + }, + "name": "fenced.code.md", + "contentName": "source.embedded.idris", + "patterns": [ + { + "include": "source.idris" + } + ] + }, + { + "begin": "^\\s*([`~]{3,})\\s*(\\{?)((?:\\.?)(?:java))(?=(}| |$|{))\\s*(\\{?)([^`\\{\\}]*)(\\}?)$", + "beginCaptures": { + "1": { + "name": "punctuation.md" + }, + "2": { + "name": "punctuation.md" + }, + "3": { + "name": "language.constant.md" + }, + "5": { + "name": "punctuation.md" + }, + "6": { + "patterns": [ + { + "include": "#special-attribute-elements" + } + ] + }, + "7": { + "name": "punctuation.md" + } + }, + "end": "^\\s*(\\1)$", + "endCaptures": { + "1": { + "name": "punctuation.md" + } + }, + "name": "fenced.code.md", + "contentName": "source.embedded.java", + "patterns": [ + { + "include": "source.java" + } + ] + }, + { + "begin": "^\\s*([`~]{3,})\\s*(\\{?)((?:\\.?)(?:javascript|js|jsx))(?=(}| |$|{))\\s*(\\{?)([^`\\{\\}]*)(\\}?)$", + "beginCaptures": { + "1": { + "name": "punctuation.md" + }, + "2": { + "name": "punctuation.md" + }, + "3": { + "name": "language.constant.md" + }, + "5": { + "name": "punctuation.md" + }, + "6": { + "patterns": [ + { + "include": "#special-attribute-elements" + } + ] + }, + "7": { + "name": "punctuation.md" + } + }, + "end": "^\\s*(\\1)$", + "endCaptures": { + "1": { + "name": "punctuation.md" + } + }, + "name": "fenced.code.md", + "contentName": "source.embedded.js", + "patterns": [ + { + "include": "source.js" + } + ] + }, + { + "begin": "^\\s*([`~]{3,})\\s*(\\{?)((?:\\.?)(?:json|har))(?=(}| |$|{))\\s*(\\{?)([^`\\{\\}]*)(\\}?)$", + "beginCaptures": { + "1": { + "name": "punctuation.md" + }, + "2": { + "name": "punctuation.md" + }, + "3": { + "name": "language.constant.md" + }, + "5": { + "name": "punctuation.md" + }, + "6": { + "patterns": [ + { + "include": "#special-attribute-elements" + } + ] + }, + "7": { + "name": "punctuation.md" + } + }, + "end": "^\\s*(\\1)$", + "endCaptures": { + "1": { + "name": "punctuation.md" + } + }, + "name": "fenced.code.md", + "contentName": "source.embedded.json", + "patterns": [ + { + "include": "source.json" + } + ] + }, + { + "begin": "^\\s*([`~]{3,})\\s*(\\{?)((?:\\.?)(?:julia|julia-repl))(?=(}| |$|{))\\s*(\\{?)([^`\\{\\}]*)(\\}?)$", + "beginCaptures": { + "1": { + "name": "punctuation.md" + }, + "2": { + "name": "punctuation.md" + }, + "3": { + "name": "language.constant.md" + }, + "5": { + "name": "punctuation.md" + }, + "6": { + "patterns": [ + { + "include": "#special-attribute-elements" + } + ] + }, + "7": { + "name": "punctuation.md" + } + }, + "end": "^\\s*(\\1)$", + "endCaptures": { + "1": { + "name": "punctuation.md" + } + }, + "name": "fenced.code.md", + "contentName": "source.embedded.julia", + "patterns": [ + { + "include": "source.julia" + } + ] + }, + { + "begin": "^\\s*([`~]{3,})\\s*(\\{?)((?:\\.?)(?:kotlin|kt|kts))(?=(}| |$|{))\\s*(\\{?)([^`\\{\\}]*)(\\}?)$", + "beginCaptures": { + "1": { + "name": "punctuation.md" + }, + "2": { + "name": "punctuation.md" + }, + "3": { + "name": "language.constant.md" + }, + "5": { + "name": "punctuation.md" + }, + "6": { + "patterns": [ + { + "include": "#special-attribute-elements" + } + ] + }, + "7": { + "name": "punctuation.md" + } + }, + "end": "^\\s*(\\1)$", + "endCaptures": { + "1": { + "name": "punctuation.md" + } + }, + "name": "fenced.code.md", + "contentName": "source.embedded.kotlin", + "patterns": [ + { + "include": "source.kotlin" + } + ] + }, + { + "begin": "^\\s*([`~]{3,})\\s*(\\{?)((?:\\.?)(?:latex|tex))(?=(}| |$|{))\\s*(\\{?)([^`\\{\\}]*)(\\}?)$", + "beginCaptures": { + "1": { + "name": "punctuation.md" + }, + "2": { + "name": "punctuation.md" + }, + "3": { + "name": "language.constant.md" + }, + "5": { + "name": "punctuation.md" + }, + "6": { + "patterns": [ + { + "include": "#special-attribute-elements" + } + ] + }, + "7": { + "name": "punctuation.md" + } + }, + "end": "^\\s*(\\1)$", + "endCaptures": { + "1": { + "name": "punctuation.md" + } + }, + "name": "fenced.code.md", + "contentName": "text.embedded.latex", + "patterns": [ + { + "include": "text.tex.latex" + } + ] + }, + { + "begin": "^\\s*([`~]{3,})\\s*(\\{?)((?:\\.?)(?:less))(?=(}| |$|{))\\s*(\\{?)([^`\\{\\}]*)(\\}?)$", + "beginCaptures": { + "1": { + "name": "punctuation.md" + }, + "2": { + "name": "punctuation.md" + }, + "3": { + "name": "language.constant.md" + }, + "5": { + "name": "punctuation.md" + }, + "6": { + "patterns": [ + { + "include": "#special-attribute-elements" + } + ] + }, + "7": { + "name": "punctuation.md" + } + }, + "end": "^\\s*(\\1)$", + "endCaptures": { + "1": { + "name": "punctuation.md" + } + }, + "name": "fenced.code.md", + "contentName": "source.embedded.css.less", + "patterns": [ + { + "include": "source.css.less" + } + ] + }, + { + "begin": "^\\s*([`~]{3,})\\s*(\\{?)((?:\\.?)(?:lua))(?=(}| |$|{))\\s*(\\{?)([^`\\{\\}]*)(\\}?)$", + "beginCaptures": { + "1": { + "name": "punctuation.md" + }, + "2": { + "name": "punctuation.md" + }, + "3": { + "name": "language.constant.md" + }, + "5": { + "name": "punctuation.md" + }, + "6": { + "patterns": [ + { + "include": "#special-attribute-elements" + } + ] + }, + "7": { + "name": "punctuation.md" + } + }, + "end": "^\\s*(\\1)$", + "endCaptures": { + "1": { + "name": "punctuation.md" + } + }, + "name": "fenced.code.md", + "contentName": "source.embedded.lua", + "patterns": [ + { + "include": "source.lua" + } + ] + }, + { + "begin": "^\\s*([`~]{3,})\\s*(\\{?)((?:\\.?)(?:make|makefile))(?=(}| |$|{))\\s*(\\{?)([^`\\{\\}]*)(\\}?)$", + "beginCaptures": { + "1": { + "name": "punctuation.md" + }, + "2": { + "name": "punctuation.md" + }, + "3": { + "name": "language.constant.md" + }, + "5": { + "name": "punctuation.md" + }, + "6": { + "patterns": [ + { + "include": "#special-attribute-elements" + } + ] + }, + "7": { + "name": "punctuation.md" + } + }, + "end": "^\\s*(\\1)$", + "endCaptures": { + "1": { + "name": "punctuation.md" + } + }, + "name": "fenced.code.md", + "contentName": "source.embedded.makefile", + "patterns": [ + { + "include": "source.makefile" + } + ] + }, + { + "begin": "^\\s*([`~]{3,})\\s*(\\{?)((?:\\.?)(?:markdown|mdown|md))(?=(}| |$|{))\\s*(\\{?)([^`\\{\\}]*)(\\}?)$", + "beginCaptures": { + "1": { + "name": "punctuation.md" + }, + "2": { + "name": "punctuation.md" + }, + "3": { + "name": "language.constant.md" + }, + "5": { + "name": "punctuation.md" + }, + "6": { + "patterns": [ + { + "include": "#special-attribute-elements" + } + ] + }, + "7": { + "name": "punctuation.md" + } + }, + "end": "^\\s*(\\1)$", + "endCaptures": { + "1": { + "name": "punctuation.md" + } + }, + "name": "fenced.code.md", + "contentName": "text.embedded.md", + "patterns": [ + { + "include": "text.md" + } + ] + }, + { + "begin": "^\\s*([`~]{3,})\\s*(\\{?)((?:\\.?)(?:m|mathematica))(?=(}| |$|{))\\s*(\\{?)([^`\\{\\}]*)(\\}?)$", + "beginCaptures": { + "1": { + "name": "punctuation.md" + }, + "2": { + "name": "punctuation.md" + }, + "3": { + "name": "language.constant.md" + }, + "5": { + "name": "punctuation.md" + }, + "6": { + "patterns": [ + { + "include": "#special-attribute-elements" + } + ] + }, + "7": { + "name": "punctuation.md" + } + }, + "end": "^\\s*(\\1)$", + "endCaptures": { + "1": { + "name": "punctuation.md" + } + }, + "name": "fenced.code.md", + "contentName": "source.embedded.mathematica", + "patterns": [ + { + "include": "source.mathematica" + } + ] + }, + { + "begin": "^\\s*([`~]{3,})\\s*(\\{?)((?:\\.?)(?:mermaid))(?=(}| |$|{))\\s*(\\{?)([^`\\{\\}]*)(\\}?)$", + "beginCaptures": { + "1": { + "name": "punctuation.md" + }, + "2": { + "name": "punctuation.md" + }, + "3": { + "name": "language.constant.md" + }, + "5": { + "name": "punctuation.md" + }, + "6": { + "patterns": [ + { + "include": "#special-attribute-elements" + } + ] + }, + "7": { + "name": "punctuation.md" + } + }, + "end": "^\\s*(\\1)$", + "endCaptures": { + "1": { + "name": "punctuation.md" + } + }, + "name": "fenced.code.md", + "contentName": "source.embedded.mermaid", + "patterns": [ + { + "include": "source.mermaid" + } + ] + }, + { + "begin": "^\\s*([`~]{3,})\\s*(\\{?)((?:\\.?)(?:mson))(?=(}| |$|{))\\s*(\\{?)([^`\\{\\}]*)(\\}?)$", + "beginCaptures": { + "1": { + "name": "punctuation.md" + }, + "2": { + "name": "punctuation.md" + }, + "3": { + "name": "language.constant.md" + }, + "5": { + "name": "punctuation.md" + }, + "6": { + "patterns": [ + { + "include": "#special-attribute-elements" + } + ] + }, + "7": { + "name": "punctuation.md" + } + }, + "end": "^\\s*(\\1)$", + "endCaptures": { + "1": { + "name": "punctuation.md" + } + }, + "name": "fenced.code.md", + "contentName": "source.embedded.mson", + "patterns": [ + { + "include": "text.html.markdown.source.gfm.mson" + } + ] + }, + { + "begin": "^\\s*([`~]{3,})\\s*(\\{?)((?:\\.?)(?:objc|objective-c))(?=(}| |$|{))\\s*(\\{?)([^`\\{\\}]*)(\\}?)$", + "beginCaptures": { + "1": { + "name": "punctuation.md" + }, + "2": { + "name": "punctuation.md" + }, + "3": { + "name": "language.constant.md" + }, + "5": { + "name": "punctuation.md" + }, + "6": { + "patterns": [ + { + "include": "#special-attribute-elements" + } + ] + }, + "7": { + "name": "punctuation.md" + } + }, + "end": "^\\s*(\\1)$", + "endCaptures": { + "1": { + "name": "punctuation.md" + } + }, + "name": "fenced.code.md", + "contentName": "source.embedded.objc", + "patterns": [ + { + "include": "source.objc" + } + ] + }, + { + "begin": "^\\s*([`~]{3,})\\s*(\\{?)((?:\\.?)(?:php))(?=(}| |$|{))\\s*(\\{?)([^`\\{\\}]*)(\\}?)$", + "beginCaptures": { + "1": { + "name": "punctuation.md" + }, + "2": { + "name": "punctuation.md" + }, + "3": { + "name": "language.constant.md" + }, + "5": { + "name": "punctuation.md" + }, + "6": { + "patterns": [ + { + "include": "#special-attribute-elements" + } + ] + }, + "7": { + "name": "punctuation.md" + } + }, + "end": "^\\s*(\\1)$", + "endCaptures": { + "1": { + "name": "punctuation.md" + } + }, + "name": "fenced.code.md", + "contentName": "source.embedded.text.html.php", + "patterns": [ + { + "include": "text.html.php" + } + ] + }, + { + "begin": "^\\s*([`~]{3,})\\s*(\\{?)((?:\\.?)(?:py|python))(?=(}| |$|{))\\s*(\\{?)([^`\\{\\}]*)(\\}?)$", + "beginCaptures": { + "1": { + "name": "punctuation.md" + }, + "2": { + "name": "punctuation.md" + }, + "3": { + "name": "language.constant.md" + }, + "5": { + "name": "punctuation.md" + }, + "6": { + "patterns": [ + { + "include": "#special-attribute-elements" + } + ] + }, + "7": { + "name": "punctuation.md" + } + }, + "end": "^\\s*(\\1)$", + "endCaptures": { + "1": { + "name": "punctuation.md" + } + }, + "name": "fenced.code.md", + "contentName": "source.embedded.python", + "patterns": [ + { + "include": "source.python" + } + ] + }, + { + "begin": "^\\s*([`~]{3,})\\s*(\\{?)((?:\\.?)(?:r))(?=(}| |$|{))\\s*(\\{?)([^`\\{\\}]*)(\\}?)$", + "beginCaptures": { + "1": { + "name": "punctuation.md" + }, + "2": { + "name": "punctuation.md" + }, + "3": { + "name": "language.constant.md" + }, + "5": { + "name": "punctuation.md" + }, + "6": { + "patterns": [ + { + "include": "#special-attribute-elements" + } + ] + }, + "7": { + "name": "punctuation.md" + } + }, + "end": "^\\s*(\\1)$", + "endCaptures": { + "1": { + "name": "punctuation.md" + } + }, + "name": "fenced.code.md", + "contentName": "source.embedded.r", + "patterns": [ + { + "include": "source.r" + } + ] + }, + { + "begin": "^\\s*([`~]{3,})\\s*(\\{?)((?:\\.?)(?:ruby))(?=(}| |$|{))\\s*(\\{?)([^`\\{\\}]*)(\\}?)$", + "beginCaptures": { + "1": { + "name": "punctuation.md" + }, + "2": { + "name": "punctuation.md" + }, + "3": { + "name": "language.constant.md" + }, + "5": { + "name": "punctuation.md" + }, + "6": { + "patterns": [ + { + "include": "#special-attribute-elements" + } + ] + }, + "7": { + "name": "punctuation.md" + } + }, + "end": "^\\s*(\\1)$", + "endCaptures": { + "1": { + "name": "punctuation.md" + } + }, + "name": "fenced.code.md", + "contentName": "source.embedded.ruby", + "patterns": [ + { + "include": "source.ruby" + } + ] + }, + { + "begin": "^\\s*([`~]{3,})\\s*(\\{?)((?:\\.?)(?:rust|rs))(?=(}| |$|{))\\s*(\\{?)([^`\\{\\}]*)(\\}?)$", + "beginCaptures": { + "1": { + "name": "punctuation.md" + }, + "2": { + "name": "punctuation.md" + }, + "3": { + "name": "language.constant.md" + }, + "5": { + "name": "punctuation.md" + }, + "6": { + "patterns": [ + { + "include": "#special-attribute-elements" + } + ] + }, + "7": { + "name": "punctuation.md" + } + }, + "end": "^\\s*(\\1)$", + "endCaptures": { + "1": { + "name": "punctuation.md" + } + }, + "name": "fenced.code.md", + "contentName": "source.embedded.rust", + "patterns": [ + { + "include": "source.rust" + } + ] + }, + { + "begin": "^\\s*([`~]{3,})\\s*(\\{?)((?:\\.?)(?:sas))(?=(}| |$|{))\\s*(\\{?)([^`\\{\\}]*)(\\}?)$", + "beginCaptures": { + "1": { + "name": "punctuation.md" + }, + "2": { + "name": "punctuation.md" + }, + "3": { + "name": "language.constant.md" + }, + "5": { + "name": "punctuation.md" + }, + "6": { + "patterns": [ + { + "include": "#special-attribute-elements" + } + ] + }, + "7": { + "name": "punctuation.md" + } + }, + "end": "^\\s*(\\1)$", + "endCaptures": { + "1": { + "name": "punctuation.md" + } + }, + "name": "fenced.code.md", + "contentName": "source.embedded.sas", + "patterns": [ + { + "include": "source.sas" + } + ] + }, + { + "begin": "^\\s*([`~]{3,})\\s*(\\{?)((?:\\.?)(?:sass))(?=(}| |$|{))\\s*(\\{?)([^`\\{\\}]*)(\\}?)$", + "beginCaptures": { + "1": { + "name": "punctuation.md" + }, + "2": { + "name": "punctuation.md" + }, + "3": { + "name": "language.constant.md" + }, + "5": { + "name": "punctuation.md" + }, + "6": { + "patterns": [ + { + "include": "#special-attribute-elements" + } + ] + }, + "7": { + "name": "punctuation.md" + } + }, + "end": "^\\s*(\\1)$", + "endCaptures": { + "1": { + "name": "punctuation.md" + } + }, + "name": "fenced.code.md", + "contentName": "source.embedded.sass", + "patterns": [ + { + "include": "source.sass" + } + ] + }, + { + "begin": "^\\s*([`~]{3,})\\s*(\\{?)((?:\\.?)(?:scss))(?=(}| |$|{))\\s*(\\{?)([^`\\{\\}]*)(\\}?)$", + "beginCaptures": { + "1": { + "name": "punctuation.md" + }, + "2": { + "name": "punctuation.md" + }, + "3": { + "name": "language.constant.md" + }, + "5": { + "name": "punctuation.md" + }, + "6": { + "patterns": [ + { + "include": "#special-attribute-elements" + } + ] + }, + "7": { + "name": "punctuation.md" + } + }, + "end": "^\\s*(\\1)$", + "endCaptures": { + "1": { + "name": "punctuation.md" + } + }, + "name": "fenced.code.md", + "contentName": "source.embedded.css.scss", + "patterns": [ + { + "include": "source.css.scss" + } + ] + }, + { + "begin": "^\\s*([`~]{3,})\\s*(\\{?)((?:\\.?)(?:sh|bash))(?=(}| |$|{))\\s*(\\{?)([^`\\{\\}]*)(\\}?)$", + "beginCaptures": { + "1": { + "name": "punctuation.md" + }, + "2": { + "name": "punctuation.md" + }, + "3": { + "name": "language.constant.md" + }, + "5": { + "name": "punctuation.md" + }, + "6": { + "patterns": [ + { + "include": "#special-attribute-elements" + } + ] + }, + "7": { + "name": "punctuation.md" + } + }, + "end": "^\\s*(\\1)$", + "endCaptures": { + "1": { + "name": "punctuation.md" + } + }, + "name": "fenced.code.md", + "contentName": "source.embedded.shell", + "patterns": [ + { + "include": "source.shell" + } + ] + }, + { + "begin": "^\\s*([`~]{3,})\\s*(\\{?)((?:\\.?)(?:shellsession|console))(?=(}| |$|{))\\s*(\\{?)([^`\\{\\}]*)(\\}?)$", + "beginCaptures": { + "1": { + "name": "punctuation.md" + }, + "2": { + "name": "punctuation.md" + }, + "3": { + "name": "language.constant.md" + }, + "5": { + "name": "punctuation.md" + }, + "6": { + "patterns": [ + { + "include": "#special-attribute-elements" + } + ] + }, + "7": { + "name": "punctuation.md" + } + }, + "end": "^\\s*(\\1)$", + "endCaptures": { + "1": { + "name": "punctuation.md" + } + }, + "name": "fenced.code.md", + "contentName": "text.embedded.shell-session", + "patterns": [ + { + "include": "text.shell-session" + } + ] + }, + { + "begin": "^\\s*([`~]{3,})\\s*(\\{?)((?:\\.?)(?:sql))(?=(}| |$|{))\\s*(\\{?)([^`\\{\\}]*)(\\}?)$", + "beginCaptures": { + "1": { + "name": "punctuation.md" + }, + "2": { + "name": "punctuation.md" + }, + "3": { + "name": "language.constant.md" + }, + "5": { + "name": "punctuation.md" + }, + "6": { + "patterns": [ + { + "include": "#special-attribute-elements" + } + ] + }, + "7": { + "name": "punctuation.md" + } + }, + "end": "^\\s*(\\1)$", + "endCaptures": { + "1": { + "name": "punctuation.md" + } + }, + "name": "fenced.code.md", + "contentName": "source.embedded.sql", + "patterns": [ + { + "include": "source.sql" + } + ] + }, + { + "begin": "^\\s*([`~]{3,})\\s*(\\{?)((?:\\.?)(?:stata))(?=(}| |$|{))\\s*(\\{?)([^`\\{\\}]*)(\\}?)$", + "beginCaptures": { + "1": { + "name": "punctuation.md" + }, + "2": { + "name": "punctuation.md" + }, + "3": { + "name": "language.constant.md" + }, + "5": { + "name": "punctuation.md" + }, + "6": { + "patterns": [ + { + "include": "#special-attribute-elements" + } + ] + }, + "7": { + "name": "punctuation.md" + } + }, + "end": "^\\s*(\\1)$", + "endCaptures": { + "1": { + "name": "punctuation.md" + } + }, + "name": "fenced.code.md", + "contentName": "source.embedded.stata", + "patterns": [ + { + "include": "source.stata" + } + ] + }, + { + "begin": "^\\s*([`~]{3,})\\s*(\\{?)((?:\\.?)(?:swift))(?=(}| |$|{))\\s*(\\{?)([^`\\{\\}]*)(\\}?)$", + "beginCaptures": { + "1": { + "name": "punctuation.md" + }, + "2": { + "name": "punctuation.md" + }, + "3": { + "name": "language.constant.md" + }, + "5": { + "name": "punctuation.md" + }, + "6": { + "patterns": [ + { + "include": "#special-attribute-elements" + } + ] + }, + "7": { + "name": "punctuation.md" + } + }, + "end": "^\\s*(\\1)$", + "endCaptures": { + "1": { + "name": "punctuation.md" + } + }, + "name": "fenced.code.md", + "contentName": "source.embedded.swift", + "patterns": [ + { + "include": "source.swift" + } + ] + }, + { + "begin": "^\\s*([`~]{3,})\\s*(\\{?)((?:\\.?)(?:ts|typescript))(?=(}| |$|{))\\s*(\\{?)([^`\\{\\}]*)(\\}?)$", + "beginCaptures": { + "1": { + "name": "punctuation.md" + }, + "2": { + "name": "punctuation.md" + }, + "3": { + "name": "language.constant.md" + }, + "5": { + "name": "punctuation.md" + }, + "6": { + "patterns": [ + { + "include": "#special-attribute-elements" + } + ] + }, + "7": { + "name": "punctuation.md" + } + }, + "end": "^\\s*(\\1)$", + "endCaptures": { + "1": { + "name": "punctuation.md" + } + }, + "name": "fenced.code.md", + "contentName": "source.embedded.ts", + "patterns": [ + { + "include": "source.ts" + } + ] + }, + { + "begin": "^\\s*([`~]{3,})\\s*(\\{?)((?:\\.?)(?:xml))(?=(}| |$|{))\\s*(\\{?)([^`\\{\\}]*)(\\}?)$", + "beginCaptures": { + "1": { + "name": "punctuation.md" + }, + "2": { + "name": "punctuation.md" + }, + "3": { + "name": "language.constant.md" + }, + "5": { + "name": "punctuation.md" + }, + "6": { + "patterns": [ + { + "include": "#special-attribute-elements" + } + ] + }, + "7": { + "name": "punctuation.md" + } + }, + "end": "^\\s*(\\1)$", + "endCaptures": { + "1": { + "name": "punctuation.md" + } + }, + "name": "fenced.code.md", + "contentName": "text.embedded.xml", + "patterns": [ + { + "include": "text.xml" + } + ] + }, + { + "begin": "^\\s*([`~]{3,})\\s*(\\{?)((?:\\.?)(?:yaml))(?=(}| |$|{))\\s*(\\{?)([^`\\{\\}]*)(\\}?)$", + "beginCaptures": { + "1": { + "name": "punctuation.md" + }, + "2": { + "name": "punctuation.md" + }, + "3": { + "name": "language.constant.md" + }, + "5": { + "name": "punctuation.md" + }, + "6": { + "patterns": [ + { + "include": "#special-attribute-elements" + } + ] + }, + "7": { + "name": "punctuation.md" + } + }, + "end": "^\\s*(\\1)$", + "endCaptures": { + "1": { + "name": "punctuation.md" + } + }, + "name": "fenced.code.md", + "contentName": "source.embedded.yaml", + "patterns": [ + { + "include": "source.yaml" + } + ] + }, + { + "begin": "^\\s*([`~]{3,})\\s*(\\{?)((?:\\.?)(?:[a-zA-Z0-9-_]+))(?=(}| |$|{))\\s*(\\{?)([^`\\{\\}]*)(\\}?)$", + "beginCaptures": { + "1": { + "name": "punctuation.md" + }, + "2": { + "name": "punctuation.md" + }, + "3": { + "name": "language.constant.md" + }, + "5": { + "name": "punctuation.md" + }, + "6": { + "patterns": [ + { + "include": "#special-attribute-elements" + } + ] + }, + "7": { + "name": "punctuation.md" + } + }, + "end": "^\\s*(\\1)$", + "endCaptures": { + "1": { + "name": "punctuation.md" + } + }, + "name": "fenced.code.md", + "contentName": "source.embedded", + "patterns": [ + { + "include": "source" + } + ] + } + ] + } + }, + "injections": { + "source.embedded.text.html.php - (meta.embedded | meta.tag), L:source.embedded.text.html.php meta.tag, L:embedded.source.js.embedded.html": { + "patterns": [ + { + "begin": "(^\\s*)(?=<\\?(?![^?]*\\?>))", + "beginCaptures": { + "0": { + "name": "punctuation.whitespace.embedded.leading.php" + } + }, + "end": "(?!\\G)(\\s*$)?", + "endCaptures": { + "0": { + "name": "punctuation.whitespace.embedded.trailing.php" + } + }, + "patterns": [ + { + "begin": "<\\?(?i:php|=)?", + "beginCaptures": { + "0": { + "name": "punctuation.section.embedded.begin.php" + } + }, + "contentName": "source.php", + "end": "(\\?)>", + "endCaptures": { + "0": { + "name": "punctuation.section.embedded.end.php" + }, + "1": { + "name": "source.php" + } + }, + "name": "meta.embedded.block.php", + "patterns": [ + { + "include": "text.html.php#language" + } + ] + } + ] + }, + { + "begin": "<\\?(?i:php|=)?(?![^?]*\\?>)", + "beginCaptures": { + "0": { + "name": "punctuation.section.embedded.begin.php" + } + }, + "contentName": "source.php", + "end": "(\\G)>", + "endCaptures": { + "0": { + "name": "punctuation.section.embedded.end.php" + }, + "1": { + "name": "source.php" + } + }, + "name": "meta.embedded.block.php", + "patterns": [ + { + "include": "text.html.php#language" + } + ] + }, + { + "begin": "<\\?(?i:php|=)?", + "beginCaptures": { + "0": { + "name": "punctuation.section.embedded.begin.php" + } + }, + "end": ">", + "endCaptures": { + "0": { + "name": "punctuation.section.embedded.end.php" + } + }, + "name": "meta.embedded.line.php", + "patterns": [ + { + "captures": { + "1": { + "name": "source.php" + }, + "2": { + "name": "punctuation.section.embedded.end.php" + }, + "3": { + "name": "source.php" + } + }, + "match": "\\G(\\s*)((\\?))(?=>)", + "name": "meta.special.empty-tag.php" + }, + { + "begin": "\\G", + "contentName": "source.php", + "end": "(\\?)(?=>)", + "endCaptures": { + "0": { + "name": "punctuation.section.embedded.end.php" + }, + "1": { + "name": "source.php" + } + }, + "patterns": [ + { + "include": "text.html.php#language" + } + ] + } + ] + } + ] + } + } +} diff --git a/data/text.python.console.json b/data/text.python.console.json new file mode 100644 index 0000000..704aeca --- /dev/null +++ b/data/text.python.console.json @@ -0,0 +1,25 @@ +{ + "scopeName": "text.python.console", + "name": "Python Console", + "fileTypes": [ + "doctest", + "pycon" + ], + "patterns": [ + { + "match": "^(>{3}|\\.{3}|In \\[\\d+\\]:) (.+)$", + "captures": { + "1": { + "name": "punctuation.separator.prompt.python.console" + }, + "2": { + "patterns": [ + { + "include": "source.python" + } + ] + } + } + } + ] +} diff --git a/data/text.python.traceback.json b/data/text.python.traceback.json new file mode 100644 index 0000000..3e88ec7 --- /dev/null +++ b/data/text.python.traceback.json @@ -0,0 +1,46 @@ +{ + "scopeName": "text.python.traceback", + "name": "Python Traceback", + "fileTypes": [ + "pytb" + ], + "patterns": [ + { + "match": "^ File (\"[^\"]+\"), line (\\d+)(?:, in (.+))?$", + "captures": { + "1": { + "name": "string.python.traceback" + }, + "2": { + "name": "constant.numeric.python.traceback" + }, + "3": { + "name": "entity.name.function.python.traceback" + } + } + }, + { + "match": "^ (.+)$", + "captures": { + "1": { + "patterns": [ + { + "include": "source.python" + } + ] + } + } + }, + { + "match": "^([^\\s:]+):(?: (.+))?$", + "captures": { + "1": { + "name": "entity.name.type.class.python.traceback" + }, + "2": { + "name": "string.python.traceback" + } + } + } + ] +} diff --git a/run b/run index 28cca90..9be0893 100755 --- a/run +++ b/run @@ -80,6 +80,41 @@ fi if (( $(which $awkcmd composer parallel yarn | wc -l) < 4 )); then fail; fi case $1 in +init) + yarn install + mkdir -p "$cwd"/deps + rm -rf "$cwd"/deps/* + + cd "$cwd"/deps + printf "franzheidl/atom-applescript +atom/language-c +atom/language-coffee-script +atom/language-css +rmosolgo/language-graphql +atom/language-html +atom/language-java +atom/language-javascript +atom/language-json +burodepeper/language-markdown +Azganoth/language-lua-plus +atom/language-php +atom/language-python +atom/language-ruby +atom/language-shellscript +MaxGiting/atom-language-smarty +atom/language-sql +al3x/atom-language-textile +atom/language-typescript +atom/language-xml" | parallel "git clone https://github.com/{}.git" + cd "$cwd" + ;; + + +needed) + grep -Fxv -f <(cd "$cwd"/data && ls -1 *.json | sed -e 's/\.json$//g') <(cat "$cwd"/data/*.json | grep -E "\"include\"\s*:\s*\"[^#\$]+\"" | gawk '{ match($0, /"include": "(.+?)"/, arr); if(arr[1] != "") print arr[1] }' | sort -u) + ;; + + build | *) rm -rf "$cwd"/data/* @@ -87,25 +122,10 @@ build | *) ls -1 "$cwd"/deps/**/grammars/!(tree-sitter-*).cson | parallel "temp=\$(mktemp) && csonc --output=\$temp {} mv \$temp \"$cwd\"/data/\$(grep -m1 scopeName \$temp | - $awkcmd '{ match(\$0, /\s*:\s*\"(.+?)\"/, arr); if(arr[1] != \"\") print arr[1] }').json" - ;; - -init) - yarn install - mkdir -p "$cwd"/deps - - printf "css -html -javascript -php -shellscript -sql -typescript -xml" | parallel "git clone https://github.com/atom/language-{}.git \"$cwd\"/deps/{}" - ;; + $awkcmd '{ match(\$0, /\s*:\s*\"(.+?)\"/, arr); if(arr[1] != \"\") print arr[1] }').json" -needed) - cat "$cwd"/data/*.json | grep -E "\"include\"\s*:\s*\"[^#\$]+\"" | gawk '{ match($0, /"in -clude": "(.+?)"/, arr); if(arr[1] != "") print arr[1] }' | sort -u + # Some packages use JSON files, so just rename them to their scopes + ls -1 "$cwd"/deps/**/grammars/!(tree-sitter-*).json | parallel "cp {} \"$cwd\"/data/\$(grep -m1 scopeName {} | + $awkcmd '{ match(\$0, /\s*:\s*\"(.+?)\"/, arr); if(arr[1] != \"\") print arr[1] }').json" ;; esac \ No newline at end of file