From 8f98f140a833af3415eff5a666566075e032ec5f Mon Sep 17 00:00:00 2001 From: Myriad-Dreamin Date: Thu, 4 Jan 2024 12:27:29 +0800 Subject: [PATCH 1/3] Create syntax folders and add tm grammar --- editors/vscode/package.json | 9 +- .../typst.language-configuration.json} | 0 editors/vscode/syntaxes/typst.tmLanguage.json | 577 ++++++++++++++++++ 3 files changed, 585 insertions(+), 1 deletion(-) rename editors/vscode/{language-configuration.json => syntaxes/typst.language-configuration.json} (100%) create mode 100644 editors/vscode/syntaxes/typst.tmLanguage.json diff --git a/editors/vscode/package.json b/editors/vscode/package.json index 7b52eced..ec09530f 100644 --- a/editors/vscode/package.json +++ b/editors/vscode/package.json @@ -105,7 +105,7 @@ "languages": [ { "id": "typst", - "configuration": "./language-configuration.json", + "configuration": "./syntaxes/typst.language-configuration.json", "extensions": [ ".typ" ], @@ -118,6 +118,13 @@ } } ], + "grammars": [ + { + "language": "typst", + "scopeName": "source.typst", + "path": "./syntaxes/typst.tmLanguage.json" + } + ], "semanticTokenTypes": [ { "id": "bool", diff --git a/editors/vscode/language-configuration.json b/editors/vscode/syntaxes/typst.language-configuration.json similarity index 100% rename from editors/vscode/language-configuration.json rename to editors/vscode/syntaxes/typst.language-configuration.json diff --git a/editors/vscode/syntaxes/typst.tmLanguage.json b/editors/vscode/syntaxes/typst.tmLanguage.json new file mode 100644 index 00000000..46c77b07 --- /dev/null +++ b/editors/vscode/syntaxes/typst.tmLanguage.json @@ -0,0 +1,577 @@ +{ + "$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json", + "name": "typst", + "patterns": [ + { + "include": "#markup" + } + ], + "repository": { + "comments": { + "patterns": [ + { + "name": "comment.block.typst", + "begin": "/\\*", + "end": "\\*/", + "captures": { + "0": { + "name": "punctuation.definition.comment.typst" + } + }, + "patterns": [ + { + "include": "#comments" + } + ] + }, + { + "name": "comment.line.double-slash.typst", + "begin": "(?", + "captures": { + "1": { + "name": "punctuation.definition.label.typst" + } + } + }, + { + "name": "entity.other.reference.typst", + "match": "(@)[[:alpha:]_][[:alnum:]_-]*", + "captures": { + "1": { + "name": "punctuation.definition.reference.typst" + } + } + }, + { + "begin": "(#)(let|set|show)\\b", + "end": "\n|(;)|(?=])", + "beginCaptures": { + "0": { + "name": "keyword.other.typst" + }, + "1": { + "name": "punctuation.definition.keyword.typst" + } + }, + "endCaptures": { + "1": { + "name": "punctuation.terminator.statement.typst" + } + }, + "patterns": [ + { + "include": "#code" + } + ] + }, + { + "name": "keyword.other.typst", + "match": "(#)(as|in)\\b", + "captures": { + "1": { + "name": "punctuation.definition.keyword.typst" + } + } + }, + { + "begin": "(?:(#)if|(?:}(?:\\s*)|](?:\\s*))else)\\b", + "end": "\n|(?=])|(?<=}|])", + "beginCaptures": { + "0": { + "name": "keyword.control.conditional.typst" + }, + "2": { + "name": "punctuation.definition.keyword.typst" + } + }, + "patterns": [ + { + "include": "#code" + } + ] + }, + { + "begin": "(#)(for|while)\\b", + "end": "\n|(?=])|(?<=}|])", + "beginCaptures": { + "0": { + "name": "keyword.control.loop.typst" + }, + "1": { + "name": "punctuation.definition.keyword.typst" + } + }, + "patterns": [ + { + "include": "#code" + } + ] + }, + { + "name": "keyword.control.loop.typst", + "match": "(#)(break|continue)\\b", + "captures": { + "1": { + "name": "punctuation.definition.keyword.typst" + } + } + }, + { + "begin": "(#)(import|include|export)\\b", + "end": "\n|(;)|(?=])", + "beginCaptures": { + "0": { + "name": "keyword.control.import.typst" + }, + "1": { + "name": "punctuation.definition.keyword.typst" + } + }, + "endCaptures": { + "1": { + "name": "punctuation.terminator.statement.typst" + } + }, + "patterns": [ + { + "include": "#code" + } + ] + }, + { + "name": "keyword.control.flow.typst", + "match": "(#)(return)\\b", + "captures": { + "1": { + "name": "punctuation.definition.keyword.typst" + } + } + }, + { + "comment": "Function name", + "name": "entity.name.function.typst", + "match": "((#)[[:alpha:]_][[:alnum:]_-]*!?)(?=\\[|\\()", + "captures": { + "2": { + "name": "punctuation.definition.function.typst" + } + } + }, + { + "comment": "Function arguments", + "begin": "(?:#)([[A-Za-z]_][[0-9]_-]*!?(?=\\())\\(", + "end": "\\)", + "captures": { + "0": { + "name": "punctuation.definition.group.typst" + } + }, + "patterns": [ + { + "include": "#arguments" + } + ] + }, + { + "name": "entity.other.interpolated.typst", + "match": "(#)[[:alpha:]_][.[:alnum:]_-]*", + "captures": { + "1": { + "name": "punctuation.definition.variable.typst" + } + } + }, + { + "name": "meta.block.content.typst", + "begin": "#", + "end": "\\s", + "patterns": [ + { + "include": "#code" + } + ] + } + ] + }, + "code": { + "patterns": [ + { + "include": "#common" + }, + { + "name": "meta.block.code.typst", + "begin": "{", + "end": "}", + "captures": { + "0": { + "name": "punctuation.definition.block.code.typst" + } + }, + "patterns": [ + { + "include": "#code" + } + ] + }, + { + "name": "meta.block.content.typst", + "begin": "\\[", + "end": "\\]", + "captures": { + "0": { + "name": "punctuation.definition.block.content.typst" + } + }, + "patterns": [ + { + "include": "#markup" + } + ] + }, + { + "name": "comment.line.double-slash.typst", + "begin": "//", + "end": "\n", + "beginCaptures": { + "0": { + "name": "punctuation.definition.comment.typst" + } + } + }, + { + "name": "punctuation.separator.colon.typst", + "match": ":" + }, + { + "name": "punctuation.separator.comma.typst", + "match": "," + }, + { + "name": "keyword.operator.typst", + "match": "=>|\\.\\." + }, + { + "name": "keyword.operator.relational.typst", + "match": "==|!=|<=|<|>=|>" + }, + { + "name": "keyword.operator.assignment.typst", + "match": "\\+=|-=|\\*=|/=|=" + }, + { + "name": "keyword.operator.arithmetic.typst", + "match": "\\+|\\|/|(? Date: Thu, 4 Jan 2024 12:50:51 +0800 Subject: [PATCH 2/3] add more lang config --- editors/vscode/syntaxes/typst.language-configuration.json | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/editors/vscode/syntaxes/typst.language-configuration.json b/editors/vscode/syntaxes/typst.language-configuration.json index c3db14bb..72388604 100644 --- a/editors/vscode/syntaxes/typst.language-configuration.json +++ b/editors/vscode/syntaxes/typst.language-configuration.json @@ -21,6 +21,7 @@ "open": "(", "close": ")" }, + { "open": "/*", "close": " */" }, { "open": "\"", "close": "\"", @@ -30,9 +31,14 @@ "open": "$", "close": "$", "notIn": ["string"] + }, + { + "open": "`", + "close": "`", + "notIn": ["string"] } ], - "autoCloseBefore": "$ \n\t", + "autoCloseBefore": ";:.,=}])>$ \n\t", "surroundingPairs": [ ["[", "]"], ["{", "}"], From c716115ded16a01510937d0801c0bf750f8a1c21 Mon Sep 17 00:00:00 2001 From: Myriad-Dreamin Date: Thu, 4 Jan 2024 14:22:01 +0800 Subject: [PATCH 3/3] Handle embedded languages in raw block --- editors/vscode/syntaxes/typst.tmLanguage.json | 2093 ++++++++++++++++- 1 file changed, 2083 insertions(+), 10 deletions(-) diff --git a/editors/vscode/syntaxes/typst.tmLanguage.json b/editors/vscode/syntaxes/typst.tmLanguage.json index 46c77b07..3a9743e1 100644 --- a/editors/vscode/syntaxes/typst.tmLanguage.json +++ b/editors/vscode/syntaxes/typst.tmLanguage.json @@ -45,6 +45,9 @@ "patterns": [ { "include": "#comments" + }, + { + "include": "#fenced_code_block" } ] }, @@ -119,16 +122,6 @@ "name": "markup.underline.link.typst", "match": "https?://[0-9a-zA-Z~/%#&=',;\\.\\+\\?]*" }, - { - "name": "markup.raw.block.typst", - "begin": "`{3,}", - "end": "\\0", - "captures": { - "0": { - "name": "punctuation.definition.raw.typst" - } - } - }, { "name": "markup.raw.inline.typst", "begin": "`", @@ -571,6 +564,2086 @@ "include": "#code" } ] + }, + "fenced_code_block_typst": { + "begin": "(^|\\G)(\\s*)(`{3,})\\s*(?i:(typ|typst)((\\s+|:|,|\\{|\\?)[^`]*)?$)", + "name": "markup.raw.block.typst", + "end": "(^|\\G)(\\2|\\s{0,3})(\\3)\\s*$", + "beginCaptures": { + "3": { + "name": "punctuation.definition.raw.typst" + }, + "4": { + "name": "fenced_code.block.language.typst" + }, + "5": { + "name": "fenced_code.block.language.attributes.typst" + } + }, + "endCaptures": { + "3": { + "name": "punctuation.definition.raw.typst" + } + }, + "patterns": [ + { + "begin": "(^|\\G)(\\s*)(.*)", + "while": "(^|\\G)(?!\\s*([`~]{3,})\\s*$)", + "contentName": "meta.embedded.block.typst", + "patterns": [ + { + "include": "source.typst" + } + ] + } + ] + }, + "fenced_code_block_css": { + "begin": "(^|\\G)(\\s*)(`{3,})\\s*(?i:(css|css.erb)((\\s+|:|,|\\{|\\?)[^`]*)?$)", + "name": "markup.raw.block.typst", + "end": "(^|\\G)(\\2|\\s{0,3})(\\3)\\s*$", + "beginCaptures": { + "3": { + "name": "punctuation.definition.raw.typst" + }, + "4": { + "name": "fenced_code.block.language.typst" + }, + "5": { + "name": "fenced_code.block.language.attributes.typst" + } + }, + "endCaptures": { + "3": { + "name": "punctuation.definition.raw.typst" + } + }, + "patterns": [ + { + "begin": "(^|\\G)(\\s*)(.*)", + "while": "(^|\\G)(?!\\s*([`~]{3,})\\s*$)", + "contentName": "meta.embedded.block.css", + "patterns": [ + { + "include": "source.css" + } + ] + } + ] + }, + "fenced_code_block_basic": { + "begin": "(^|\\G)(\\s*)(`{3,})\\s*(?i:(html|htm|shtml|xhtml|inc|tmpl|tpl)((\\s+|:|,|\\{|\\?)[^`]*)?$)", + "name": "markup.raw.block.typst", + "end": "(^|\\G)(\\2|\\s{0,3})(\\3)\\s*$", + "beginCaptures": { + "3": { + "name": "punctuation.definition.raw.typst" + }, + "4": { + "name": "fenced_code.block.language.typst" + }, + "5": { + "name": "fenced_code.block.language.attributes.typst" + } + }, + "endCaptures": { + "3": { + "name": "punctuation.definition.raw.typst" + } + }, + "patterns": [ + { + "begin": "(^|\\G)(\\s*)(.*)", + "while": "(^|\\G)(?!\\s*([`~]{3,})\\s*$)", + "contentName": "meta.embedded.block.html", + "patterns": [ + { + "include": "text.html.basic" + } + ] + } + ] + }, + "fenced_code_block_ini": { + "begin": "(^|\\G)(\\s*)(`{3,})\\s*(?i:(ini|conf)((\\s+|:|,|\\{|\\?)[^`]*)?$)", + "name": "markup.raw.block.typst", + "end": "(^|\\G)(\\2|\\s{0,3})(\\3)\\s*$", + "beginCaptures": { + "3": { + "name": "punctuation.definition.raw.typst" + }, + "4": { + "name": "fenced_code.block.language.typst" + }, + "5": { + "name": "fenced_code.block.language.attributes.typst" + } + }, + "endCaptures": { + "3": { + "name": "punctuation.definition.raw.typst" + } + }, + "patterns": [ + { + "begin": "(^|\\G)(\\s*)(.*)", + "while": "(^|\\G)(?!\\s*([`~]{3,})\\s*$)", + "contentName": "meta.embedded.block.ini", + "patterns": [ + { + "include": "source.ini" + } + ] + } + ] + }, + "fenced_code_block_java": { + "begin": "(^|\\G)(\\s*)(`{3,})\\s*(?i:(java|bsh)((\\s+|:|,|\\{|\\?)[^`]*)?$)", + "name": "markup.raw.block.typst", + "end": "(^|\\G)(\\2|\\s{0,3})(\\3)\\s*$", + "beginCaptures": { + "3": { + "name": "punctuation.definition.raw.typst" + }, + "4": { + "name": "fenced_code.block.language.typst" + }, + "5": { + "name": "fenced_code.block.language.attributes.typst" + } + }, + "endCaptures": { + "3": { + "name": "punctuation.definition.raw.typst" + } + }, + "patterns": [ + { + "begin": "(^|\\G)(\\s*)(.*)", + "while": "(^|\\G)(?!\\s*([`~]{3,})\\s*$)", + "contentName": "meta.embedded.block.java", + "patterns": [ + { + "include": "source.java" + } + ] + } + ] + }, + "fenced_code_block_lua": { + "begin": "(^|\\G)(\\s*)(`{3,})\\s*(?i:(lua)((\\s+|:|,|\\{|\\?)[^`]*)?$)", + "name": "markup.raw.block.typst", + "end": "(^|\\G)(\\2|\\s{0,3})(\\3)\\s*$", + "beginCaptures": { + "3": { + "name": "punctuation.definition.raw.typst" + }, + "4": { + "name": "fenced_code.block.language.typst" + }, + "5": { + "name": "fenced_code.block.language.attributes.typst" + } + }, + "endCaptures": { + "3": { + "name": "punctuation.definition.raw.typst" + } + }, + "patterns": [ + { + "begin": "(^|\\G)(\\s*)(.*)", + "while": "(^|\\G)(?!\\s*([`~]{3,})\\s*$)", + "contentName": "meta.embedded.block.lua", + "patterns": [ + { + "include": "source.lua" + } + ] + } + ] + }, + "fenced_code_block_makefile": { + "begin": "(^|\\G)(\\s*)(`{3,})\\s*(?i:(Makefile|makefile|GNUmakefile|OCamlMakefile)((\\s+|:|,|\\{|\\?)[^`]*)?$)", + "name": "markup.raw.block.typst", + "end": "(^|\\G)(\\2|\\s{0,3})(\\3)\\s*$", + "beginCaptures": { + "3": { + "name": "punctuation.definition.raw.typst" + }, + "4": { + "name": "fenced_code.block.language.typst" + }, + "5": { + "name": "fenced_code.block.language.attributes.typst" + } + }, + "endCaptures": { + "3": { + "name": "punctuation.definition.raw.typst" + } + }, + "patterns": [ + { + "begin": "(^|\\G)(\\s*)(.*)", + "while": "(^|\\G)(?!\\s*([`~]{3,})\\s*$)", + "contentName": "meta.embedded.block.makefile", + "patterns": [ + { + "include": "source.makefile" + } + ] + } + ] + }, + "fenced_code_block_perl": { + "begin": "(^|\\G)(\\s*)(`{3,})\\s*(?i:(perl|pl|pm|pod|t|PL|psgi|vcl)((\\s+|:|,|\\{|\\?)[^`]*)?$)", + "name": "markup.raw.block.typst", + "end": "(^|\\G)(\\2|\\s{0,3})(\\3)\\s*$", + "beginCaptures": { + "3": { + "name": "punctuation.definition.raw.typst" + }, + "4": { + "name": "fenced_code.block.language.typst" + }, + "5": { + "name": "fenced_code.block.language.attributes.typst" + } + }, + "endCaptures": { + "3": { + "name": "punctuation.definition.raw.typst" + } + }, + "patterns": [ + { + "begin": "(^|\\G)(\\s*)(.*)", + "while": "(^|\\G)(?!\\s*([`~]{3,})\\s*$)", + "contentName": "meta.embedded.block.perl", + "patterns": [ + { + "include": "source.perl" + } + ] + } + ] + }, + "fenced_code_block_r": { + "begin": "(^|\\G)(\\s*)(`{3,})\\s*(?i:(R|r|s|S|Rprofile|\\{\\.r.+?\\})((\\s+|:|,|\\{|\\?)[^`]*)?$)", + "name": "markup.raw.block.typst", + "end": "(^|\\G)(\\2|\\s{0,3})(\\3)\\s*$", + "beginCaptures": { + "3": { + "name": "punctuation.definition.raw.typst" + }, + "4": { + "name": "fenced_code.block.language.typst" + }, + "5": { + "name": "fenced_code.block.language.attributes.typst" + } + }, + "endCaptures": { + "3": { + "name": "punctuation.definition.raw.typst" + } + }, + "patterns": [ + { + "begin": "(^|\\G)(\\s*)(.*)", + "while": "(^|\\G)(?!\\s*([`~]{3,})\\s*$)", + "contentName": "meta.embedded.block.r", + "patterns": [ + { + "include": "source.r" + } + ] + } + ] + }, + "fenced_code_block_ruby": { + "begin": "(^|\\G)(\\s*)(`{3,})\\s*(?i:(ruby|rb|rbx|rjs|Rakefile|rake|cgi|fcgi|gemspec|irbrc|Capfile|ru|prawn|Cheffile|Gemfile|Guardfile|Hobofile|Vagrantfile|Appraisals|Rantfile|Berksfile|Berksfile.lock|Thorfile|Puppetfile)((\\s+|:|,|\\{|\\?)[^`]*)?$)", + "name": "markup.raw.block.typst", + "end": "(^|\\G)(\\2|\\s{0,3})(\\3)\\s*$", + "beginCaptures": { + "3": { + "name": "punctuation.definition.raw.typst" + }, + "4": { + "name": "fenced_code.block.language.typst" + }, + "5": { + "name": "fenced_code.block.language.attributes.typst" + } + }, + "endCaptures": { + "3": { + "name": "punctuation.definition.raw.typst" + } + }, + "patterns": [ + { + "begin": "(^|\\G)(\\s*)(.*)", + "while": "(^|\\G)(?!\\s*([`~]{3,})\\s*$)", + "contentName": "meta.embedded.block.ruby", + "patterns": [ + { + "include": "source.ruby" + } + ] + } + ] + }, + "fenced_code_block_php": { + "begin": "(^|\\G)(\\s*)(`{3,})\\s*(?i:(php|php3|php4|php5|phpt|phtml|aw|ctp)((\\s+|:|,|\\{|\\?)[^`]*)?$)", + "name": "markup.raw.block.typst", + "end": "(^|\\G)(\\2|\\s{0,3})(\\3)\\s*$", + "beginCaptures": { + "3": { + "name": "punctuation.definition.raw.typst" + }, + "4": { + "name": "fenced_code.block.language.typst" + }, + "5": { + "name": "fenced_code.block.language.attributes.typst" + } + }, + "endCaptures": { + "3": { + "name": "punctuation.definition.raw.typst" + } + }, + "patterns": [ + { + "begin": "(^|\\G)(\\s*)(.*)", + "while": "(^|\\G)(?!\\s*([`~]{3,})\\s*$)", + "contentName": "meta.embedded.block.php", + "patterns": [ + { + "include": "text.html.basic" + }, + { + "include": "source.php" + } + ] + } + ] + }, + "fenced_code_block_sql": { + "begin": "(^|\\G)(\\s*)(`{3,})\\s*(?i:(sql|ddl|dml)((\\s+|:|,|\\{|\\?)[^`]*)?$)", + "name": "markup.raw.block.typst", + "end": "(^|\\G)(\\2|\\s{0,3})(\\3)\\s*$", + "beginCaptures": { + "3": { + "name": "punctuation.definition.raw.typst" + }, + "4": { + "name": "fenced_code.block.language.typst" + }, + "5": { + "name": "fenced_code.block.language.attributes.typst" + } + }, + "endCaptures": { + "3": { + "name": "punctuation.definition.raw.typst" + } + }, + "patterns": [ + { + "begin": "(^|\\G)(\\s*)(.*)", + "while": "(^|\\G)(?!\\s*([`~]{3,})\\s*$)", + "contentName": "meta.embedded.block.sql", + "patterns": [ + { + "include": "source.sql" + } + ] + } + ] + }, + "fenced_code_block_vs_net": { + "begin": "(^|\\G)(\\s*)(`{3,})\\s*(?i:(vb)((\\s+|:|,|\\{|\\?)[^`]*)?$)", + "name": "markup.raw.block.typst", + "end": "(^|\\G)(\\2|\\s{0,3})(\\3)\\s*$", + "beginCaptures": { + "3": { + "name": "punctuation.definition.raw.typst" + }, + "4": { + "name": "fenced_code.block.language.typst" + }, + "5": { + "name": "fenced_code.block.language.attributes.typst" + } + }, + "endCaptures": { + "3": { + "name": "punctuation.definition.raw.typst" + } + }, + "patterns": [ + { + "begin": "(^|\\G)(\\s*)(.*)", + "while": "(^|\\G)(?!\\s*([`~]{3,})\\s*$)", + "contentName": "meta.embedded.block.vs_net", + "patterns": [ + { + "include": "source.asp.vb.net" + } + ] + } + ] + }, + "fenced_code_block_xml": { + "begin": "(^|\\G)(\\s*)(`{3,})\\s*(?i:(xml|xsd|tld|jsp|pt|cpt|dtml|rss|opml)((\\s+|:|,|\\{|\\?)[^`]*)?$)", + "name": "markup.raw.block.typst", + "end": "(^|\\G)(\\2|\\s{0,3})(\\3)\\s*$", + "beginCaptures": { + "3": { + "name": "punctuation.definition.raw.typst" + }, + "4": { + "name": "fenced_code.block.language.typst" + }, + "5": { + "name": "fenced_code.block.language.attributes.typst" + } + }, + "endCaptures": { + "3": { + "name": "punctuation.definition.raw.typst" + } + }, + "patterns": [ + { + "begin": "(^|\\G)(\\s*)(.*)", + "while": "(^|\\G)(?!\\s*([`~]{3,})\\s*$)", + "contentName": "meta.embedded.block.xml", + "patterns": [ + { + "include": "text.xml" + } + ] + } + ] + }, + "fenced_code_block_xsl": { + "begin": "(^|\\G)(\\s*)(`{3,})\\s*(?i:(xsl|xslt)((\\s+|:|,|\\{|\\?)[^`]*)?$)", + "name": "markup.raw.block.typst", + "end": "(^|\\G)(\\2|\\s{0,3})(\\3)\\s*$", + "beginCaptures": { + "3": { + "name": "punctuation.definition.raw.typst" + }, + "4": { + "name": "fenced_code.block.language.typst" + }, + "5": { + "name": "fenced_code.block.language.attributes.typst" + } + }, + "endCaptures": { + "3": { + "name": "punctuation.definition.raw.typst" + } + }, + "patterns": [ + { + "begin": "(^|\\G)(\\s*)(.*)", + "while": "(^|\\G)(?!\\s*([`~]{3,})\\s*$)", + "contentName": "meta.embedded.block.xsl", + "patterns": [ + { + "include": "text.xml.xsl" + } + ] + } + ] + }, + "fenced_code_block_yaml": { + "begin": "(^|\\G)(\\s*)(`{3,})\\s*(?i:(yaml|yml)((\\s+|:|,|\\{|\\?)[^`]*)?$)", + "name": "markup.raw.block.typst", + "end": "(^|\\G)(\\2|\\s{0,3})(\\3)\\s*$", + "beginCaptures": { + "3": { + "name": "punctuation.definition.raw.typst" + }, + "4": { + "name": "fenced_code.block.language.typst" + }, + "5": { + "name": "fenced_code.block.language.attributes.typst" + } + }, + "endCaptures": { + "3": { + "name": "punctuation.definition.raw.typst" + } + }, + "patterns": [ + { + "begin": "(^|\\G)(\\s*)(.*)", + "while": "(^|\\G)(?!\\s*([`~]{3,})\\s*$)", + "contentName": "meta.embedded.block.yaml", + "patterns": [ + { + "include": "source.yaml" + } + ] + } + ] + }, + "fenced_code_block_dosbatch": { + "begin": "(^|\\G)(\\s*)(`{3,})\\s*(?i:(bat|batch)((\\s+|:|,|\\{|\\?)[^`]*)?$)", + "name": "markup.raw.block.typst", + "end": "(^|\\G)(\\2|\\s{0,3})(\\3)\\s*$", + "beginCaptures": { + "3": { + "name": "punctuation.definition.raw.typst" + }, + "4": { + "name": "fenced_code.block.language.typst" + }, + "5": { + "name": "fenced_code.block.language.attributes.typst" + } + }, + "endCaptures": { + "3": { + "name": "punctuation.definition.raw.typst" + } + }, + "patterns": [ + { + "begin": "(^|\\G)(\\s*)(.*)", + "while": "(^|\\G)(?!\\s*([`~]{3,})\\s*$)", + "contentName": "meta.embedded.block.dosbatch", + "patterns": [ + { + "include": "source.batchfile" + } + ] + } + ] + }, + "fenced_code_block_clojure": { + "begin": "(^|\\G)(\\s*)(`{3,})\\s*(?i:(clj|cljs|clojure)((\\s+|:|,|\\{|\\?)[^`]*)?$)", + "name": "markup.raw.block.typst", + "end": "(^|\\G)(\\2|\\s{0,3})(\\3)\\s*$", + "beginCaptures": { + "3": { + "name": "punctuation.definition.raw.typst" + }, + "4": { + "name": "fenced_code.block.language.typst" + }, + "5": { + "name": "fenced_code.block.language.attributes.typst" + } + }, + "endCaptures": { + "3": { + "name": "punctuation.definition.raw.typst" + } + }, + "patterns": [ + { + "begin": "(^|\\G)(\\s*)(.*)", + "while": "(^|\\G)(?!\\s*([`~]{3,})\\s*$)", + "contentName": "meta.embedded.block.clojure", + "patterns": [ + { + "include": "source.clojure" + } + ] + } + ] + }, + "fenced_code_block_coffee": { + "begin": "(^|\\G)(\\s*)(`{3,})\\s*(?i:(coffee|Cakefile|coffee.erb)((\\s+|:|,|\\{|\\?)[^`]*)?$)", + "name": "markup.raw.block.typst", + "end": "(^|\\G)(\\2|\\s{0,3})(\\3)\\s*$", + "beginCaptures": { + "3": { + "name": "punctuation.definition.raw.typst" + }, + "4": { + "name": "fenced_code.block.language.typst" + }, + "5": { + "name": "fenced_code.block.language.attributes.typst" + } + }, + "endCaptures": { + "3": { + "name": "punctuation.definition.raw.typst" + } + }, + "patterns": [ + { + "begin": "(^|\\G)(\\s*)(.*)", + "while": "(^|\\G)(?!\\s*([`~]{3,})\\s*$)", + "contentName": "meta.embedded.block.coffee", + "patterns": [ + { + "include": "source.coffee" + } + ] + } + ] + }, + "fenced_code_block_c": { + "begin": "(^|\\G)(\\s*)(`{3,})\\s*(?i:(c|h)((\\s+|:|,|\\{|\\?)[^`]*)?$)", + "name": "markup.raw.block.typst", + "end": "(^|\\G)(\\2|\\s{0,3})(\\3)\\s*$", + "beginCaptures": { + "3": { + "name": "punctuation.definition.raw.typst" + }, + "4": { + "name": "fenced_code.block.language.typst" + }, + "5": { + "name": "fenced_code.block.language.attributes.typst" + } + }, + "endCaptures": { + "3": { + "name": "punctuation.definition.raw.typst" + } + }, + "patterns": [ + { + "begin": "(^|\\G)(\\s*)(.*)", + "while": "(^|\\G)(?!\\s*([`~]{3,})\\s*$)", + "contentName": "meta.embedded.block.c", + "patterns": [ + { + "include": "source.c" + } + ] + } + ] + }, + "fenced_code_block_cpp": { + "begin": "(^|\\G)(\\s*)(`{3,})\\s*(?i:(cpp|c\\+\\+|cxx)((\\s+|:|,|\\{|\\?)[^`]*)?$)", + "name": "markup.raw.block.typst", + "end": "(^|\\G)(\\2|\\s{0,3})(\\3)\\s*$", + "beginCaptures": { + "3": { + "name": "punctuation.definition.raw.typst" + }, + "4": { + "name": "fenced_code.block.language.typst" + }, + "5": { + "name": "fenced_code.block.language.attributes.typst" + } + }, + "endCaptures": { + "3": { + "name": "punctuation.definition.raw.typst" + } + }, + "patterns": [ + { + "begin": "(^|\\G)(\\s*)(.*)", + "while": "(^|\\G)(?!\\s*([`~]{3,})\\s*$)", + "contentName": "meta.embedded.block.cpp source.cpp", + "patterns": [ + { + "include": "source.cpp" + } + ] + } + ] + }, + "fenced_code_block_diff": { + "begin": "(^|\\G)(\\s*)(`{3,})\\s*(?i:(patch|diff|rej)((\\s+|:|,|\\{|\\?)[^`]*)?$)", + "name": "markup.raw.block.typst", + "end": "(^|\\G)(\\2|\\s{0,3})(\\3)\\s*$", + "beginCaptures": { + "3": { + "name": "punctuation.definition.raw.typst" + }, + "4": { + "name": "fenced_code.block.language.typst" + }, + "5": { + "name": "fenced_code.block.language.attributes.typst" + } + }, + "endCaptures": { + "3": { + "name": "punctuation.definition.raw.typst" + } + }, + "patterns": [ + { + "begin": "(^|\\G)(\\s*)(.*)", + "while": "(^|\\G)(?!\\s*([`~]{3,})\\s*$)", + "contentName": "meta.embedded.block.diff", + "patterns": [ + { + "include": "source.diff" + } + ] + } + ] + }, + "fenced_code_block_dockerfile": { + "begin": "(^|\\G)(\\s*)(`{3,})\\s*(?i:(dockerfile|Dockerfile)((\\s+|:|,|\\{|\\?)[^`]*)?$)", + "name": "markup.raw.block.typst", + "end": "(^|\\G)(\\2|\\s{0,3})(\\3)\\s*$", + "beginCaptures": { + "3": { + "name": "punctuation.definition.raw.typst" + }, + "4": { + "name": "fenced_code.block.language.typst" + }, + "5": { + "name": "fenced_code.block.language.attributes.typst" + } + }, + "endCaptures": { + "3": { + "name": "punctuation.definition.raw.typst" + } + }, + "patterns": [ + { + "begin": "(^|\\G)(\\s*)(.*)", + "while": "(^|\\G)(?!\\s*([`~]{3,})\\s*$)", + "contentName": "meta.embedded.block.dockerfile", + "patterns": [ + { + "include": "source.dockerfile" + } + ] + } + ] + }, + "fenced_code_block_git_commit": { + "begin": "(^|\\G)(\\s*)(`{3,})\\s*(?i:(COMMIT_EDITMSG|MERGE_MSG)((\\s+|:|,|\\{|\\?)[^`]*)?$)", + "name": "markup.raw.block.typst", + "end": "(^|\\G)(\\2|\\s{0,3})(\\3)\\s*$", + "beginCaptures": { + "3": { + "name": "punctuation.definition.raw.typst" + }, + "4": { + "name": "fenced_code.block.language.typst" + }, + "5": { + "name": "fenced_code.block.language.attributes.typst" + } + }, + "endCaptures": { + "3": { + "name": "punctuation.definition.raw.typst" + } + }, + "patterns": [ + { + "begin": "(^|\\G)(\\s*)(.*)", + "while": "(^|\\G)(?!\\s*([`~]{3,})\\s*$)", + "contentName": "meta.embedded.block.git_commit", + "patterns": [ + { + "include": "text.git-commit" + } + ] + } + ] + }, + "fenced_code_block_git_rebase": { + "begin": "(^|\\G)(\\s*)(`{3,})\\s*(?i:(git-rebase-todo)((\\s+|:|,|\\{|\\?)[^`]*)?$)", + "name": "markup.raw.block.typst", + "end": "(^|\\G)(\\2|\\s{0,3})(\\3)\\s*$", + "beginCaptures": { + "3": { + "name": "punctuation.definition.raw.typst" + }, + "4": { + "name": "fenced_code.block.language.typst" + }, + "5": { + "name": "fenced_code.block.language.attributes.typst" + } + }, + "endCaptures": { + "3": { + "name": "punctuation.definition.raw.typst" + } + }, + "patterns": [ + { + "begin": "(^|\\G)(\\s*)(.*)", + "while": "(^|\\G)(?!\\s*([`~]{3,})\\s*$)", + "contentName": "meta.embedded.block.git_rebase", + "patterns": [ + { + "include": "text.git-rebase" + } + ] + } + ] + }, + "fenced_code_block_go": { + "begin": "(^|\\G)(\\s*)(`{3,})\\s*(?i:(go|golang)((\\s+|:|,|\\{|\\?)[^`]*)?$)", + "name": "markup.raw.block.typst", + "end": "(^|\\G)(\\2|\\s{0,3})(\\3)\\s*$", + "beginCaptures": { + "3": { + "name": "punctuation.definition.raw.typst" + }, + "4": { + "name": "fenced_code.block.language.typst" + }, + "5": { + "name": "fenced_code.block.language.attributes.typst" + } + }, + "endCaptures": { + "3": { + "name": "punctuation.definition.raw.typst" + } + }, + "patterns": [ + { + "begin": "(^|\\G)(\\s*)(.*)", + "while": "(^|\\G)(?!\\s*([`~]{3,})\\s*$)", + "contentName": "meta.embedded.block.go", + "patterns": [ + { + "include": "source.go" + } + ] + } + ] + }, + "fenced_code_block_groovy": { + "begin": "(^|\\G)(\\s*)(`{3,})\\s*(?i:(groovy|gvy)((\\s+|:|,|\\{|\\?)[^`]*)?$)", + "name": "markup.raw.block.typst", + "end": "(^|\\G)(\\2|\\s{0,3})(\\3)\\s*$", + "beginCaptures": { + "3": { + "name": "punctuation.definition.raw.typst" + }, + "4": { + "name": "fenced_code.block.language.typst" + }, + "5": { + "name": "fenced_code.block.language.attributes.typst" + } + }, + "endCaptures": { + "3": { + "name": "punctuation.definition.raw.typst" + } + }, + "patterns": [ + { + "begin": "(^|\\G)(\\s*)(.*)", + "while": "(^|\\G)(?!\\s*([`~]{3,})\\s*$)", + "contentName": "meta.embedded.block.groovy", + "patterns": [ + { + "include": "source.groovy" + } + ] + } + ] + }, + "fenced_code_block_pug": { + "begin": "(^|\\G)(\\s*)(`{3,})\\s*(?i:(jade|pug)((\\s+|:|,|\\{|\\?)[^`]*)?$)", + "name": "markup.raw.block.typst", + "end": "(^|\\G)(\\2|\\s{0,3})(\\3)\\s*$", + "beginCaptures": { + "3": { + "name": "punctuation.definition.raw.typst" + }, + "4": { + "name": "fenced_code.block.language.typst" + }, + "5": { + "name": "fenced_code.block.language.attributes.typst" + } + }, + "endCaptures": { + "3": { + "name": "punctuation.definition.raw.typst" + } + }, + "patterns": [ + { + "begin": "(^|\\G)(\\s*)(.*)", + "while": "(^|\\G)(?!\\s*([`~]{3,})\\s*$)", + "contentName": "meta.embedded.block.pug", + "patterns": [ + { + "include": "text.pug" + } + ] + } + ] + }, + "fenced_code_block_js": { + "begin": "(^|\\G)(\\s*)(`{3,})\\s*(?i:(js|jsx|javascript|es6|mjs|cjs|dataviewjs|\\{\\.js.+?\\})((\\s+|:|,|\\{|\\?)[^`]*)?$)", + "name": "markup.raw.block.typst", + "end": "(^|\\G)(\\2|\\s{0,3})(\\3)\\s*$", + "beginCaptures": { + "3": { + "name": "punctuation.definition.raw.typst" + }, + "4": { + "name": "fenced_code.block.language.typst" + }, + "5": { + "name": "fenced_code.block.language.attributes.typst" + } + }, + "endCaptures": { + "3": { + "name": "punctuation.definition.raw.typst" + } + }, + "patterns": [ + { + "begin": "(^|\\G)(\\s*)(.*)", + "while": "(^|\\G)(?!\\s*([`~]{3,})\\s*$)", + "contentName": "meta.embedded.block.javascript", + "patterns": [ + { + "include": "source.js" + } + ] + } + ] + }, + "fenced_code_block_js_regexp": { + "begin": "(^|\\G)(\\s*)(`{3,})\\s*(?i:(regexp)((\\s+|:|,|\\{|\\?)[^`]*)?$)", + "name": "markup.raw.block.typst", + "end": "(^|\\G)(\\2|\\s{0,3})(\\3)\\s*$", + "beginCaptures": { + "3": { + "name": "punctuation.definition.raw.typst" + }, + "4": { + "name": "fenced_code.block.language.typst" + }, + "5": { + "name": "fenced_code.block.language.attributes.typst" + } + }, + "endCaptures": { + "3": { + "name": "punctuation.definition.raw.typst" + } + }, + "patterns": [ + { + "begin": "(^|\\G)(\\s*)(.*)", + "while": "(^|\\G)(?!\\s*([`~]{3,})\\s*$)", + "contentName": "meta.embedded.block.js_regexp", + "patterns": [ + { + "include": "source.js.regexp" + } + ] + } + ] + }, + "fenced_code_block_json": { + "begin": "(^|\\G)(\\s*)(`{3,})\\s*(?i:(json|json5|sublime-settings|sublime-menu|sublime-keymap|sublime-mousemap|sublime-theme|sublime-build|sublime-project|sublime-completions)((\\s+|:|,|\\{|\\?)[^`]*)?$)", + "name": "markup.raw.block.typst", + "end": "(^|\\G)(\\2|\\s{0,3})(\\3)\\s*$", + "beginCaptures": { + "3": { + "name": "punctuation.definition.raw.typst" + }, + "4": { + "name": "fenced_code.block.language.typst" + }, + "5": { + "name": "fenced_code.block.language.attributes.typst" + } + }, + "endCaptures": { + "3": { + "name": "punctuation.definition.raw.typst" + } + }, + "patterns": [ + { + "begin": "(^|\\G)(\\s*)(.*)", + "while": "(^|\\G)(?!\\s*([`~]{3,})\\s*$)", + "contentName": "meta.embedded.block.json", + "patterns": [ + { + "include": "source.json" + } + ] + } + ] + }, + "fenced_code_block_jsonc": { + "begin": "(^|\\G)(\\s*)(`{3,})\\s*(?i:(jsonc)((\\s+|:|,|\\{|\\?)[^`]*)?$)", + "name": "markup.raw.block.typst", + "end": "(^|\\G)(\\2|\\s{0,3})(\\3)\\s*$", + "beginCaptures": { + "3": { + "name": "punctuation.definition.raw.typst" + }, + "4": { + "name": "fenced_code.block.language.typst" + }, + "5": { + "name": "fenced_code.block.language.attributes.typst" + } + }, + "endCaptures": { + "3": { + "name": "punctuation.definition.raw.typst" + } + }, + "patterns": [ + { + "begin": "(^|\\G)(\\s*)(.*)", + "while": "(^|\\G)(?!\\s*([`~]{3,})\\s*$)", + "contentName": "meta.embedded.block.jsonc", + "patterns": [ + { + "include": "source.json.comments" + } + ] + } + ] + }, + "fenced_code_block_less": { + "begin": "(^|\\G)(\\s*)(`{3,})\\s*(?i:(less)((\\s+|:|,|\\{|\\?)[^`]*)?$)", + "name": "markup.raw.block.typst", + "end": "(^|\\G)(\\2|\\s{0,3})(\\3)\\s*$", + "beginCaptures": { + "3": { + "name": "punctuation.definition.raw.typst" + }, + "4": { + "name": "fenced_code.block.language.typst" + }, + "5": { + "name": "fenced_code.block.language.attributes.typst" + } + }, + "endCaptures": { + "3": { + "name": "punctuation.definition.raw.typst" + } + }, + "patterns": [ + { + "begin": "(^|\\G)(\\s*)(.*)", + "while": "(^|\\G)(?!\\s*([`~]{3,})\\s*$)", + "contentName": "meta.embedded.block.less", + "patterns": [ + { + "include": "source.css.less" + } + ] + } + ] + }, + "fenced_code_block_objc": { + "begin": "(^|\\G)(\\s*)(`{3,})\\s*(?i:(objectivec|objective-c|mm|objc|obj-c|m|h)((\\s+|:|,|\\{|\\?)[^`]*)?$)", + "name": "markup.raw.block.typst", + "end": "(^|\\G)(\\2|\\s{0,3})(\\3)\\s*$", + "beginCaptures": { + "3": { + "name": "punctuation.definition.raw.typst" + }, + "4": { + "name": "fenced_code.block.language.typst" + }, + "5": { + "name": "fenced_code.block.language.attributes.typst" + } + }, + "endCaptures": { + "3": { + "name": "punctuation.definition.raw.typst" + } + }, + "patterns": [ + { + "begin": "(^|\\G)(\\s*)(.*)", + "while": "(^|\\G)(?!\\s*([`~]{3,})\\s*$)", + "contentName": "meta.embedded.block.objc", + "patterns": [ + { + "include": "source.objc" + } + ] + } + ] + }, + "fenced_code_block_swift": { + "begin": "(^|\\G)(\\s*)(`{3,})\\s*(?i:(swift)((\\s+|:|,|\\{|\\?)[^`]*)?$)", + "name": "markup.raw.block.typst", + "end": "(^|\\G)(\\2|\\s{0,3})(\\3)\\s*$", + "beginCaptures": { + "3": { + "name": "punctuation.definition.raw.typst" + }, + "4": { + "name": "fenced_code.block.language.typst" + }, + "5": { + "name": "fenced_code.block.language.attributes.typst" + } + }, + "endCaptures": { + "3": { + "name": "punctuation.definition.raw.typst" + } + }, + "patterns": [ + { + "begin": "(^|\\G)(\\s*)(.*)", + "while": "(^|\\G)(?!\\s*([`~]{3,})\\s*$)", + "contentName": "meta.embedded.block.swift", + "patterns": [ + { + "include": "source.swift" + } + ] + } + ] + }, + "fenced_code_block_scss": { + "begin": "(^|\\G)(\\s*)(`{3,})\\s*(?i:(scss)((\\s+|:|,|\\{|\\?)[^`]*)?$)", + "name": "markup.raw.block.typst", + "end": "(^|\\G)(\\2|\\s{0,3})(\\3)\\s*$", + "beginCaptures": { + "3": { + "name": "punctuation.definition.raw.typst" + }, + "4": { + "name": "fenced_code.block.language.typst" + }, + "5": { + "name": "fenced_code.block.language.attributes.typst" + } + }, + "endCaptures": { + "3": { + "name": "punctuation.definition.raw.typst" + } + }, + "patterns": [ + { + "begin": "(^|\\G)(\\s*)(.*)", + "while": "(^|\\G)(?!\\s*([`~]{3,})\\s*$)", + "contentName": "meta.embedded.block.scss", + "patterns": [ + { + "include": "source.css.scss" + } + ] + } + ] + }, + "fenced_code_block_perl6": { + "begin": "(^|\\G)(\\s*)(`{3,})\\s*(?i:(perl6|p6|pl6|pm6|nqp)((\\s+|:|,|\\{|\\?)[^`]*)?$)", + "name": "markup.raw.block.typst", + "end": "(^|\\G)(\\2|\\s{0,3})(\\3)\\s*$", + "beginCaptures": { + "3": { + "name": "punctuation.definition.raw.typst" + }, + "4": { + "name": "fenced_code.block.language.typst" + }, + "5": { + "name": "fenced_code.block.language.attributes.typst" + } + }, + "endCaptures": { + "3": { + "name": "punctuation.definition.raw.typst" + } + }, + "patterns": [ + { + "begin": "(^|\\G)(\\s*)(.*)", + "while": "(^|\\G)(?!\\s*([`~]{3,})\\s*$)", + "contentName": "meta.embedded.block.perl6", + "patterns": [ + { + "include": "source.perl.6" + } + ] + } + ] + }, + "fenced_code_block_powershell": { + "begin": "(^|\\G)(\\s*)(`{3,})\\s*(?i:(powershell|ps1|psm1|psd1)((\\s+|:|,|\\{|\\?)[^`]*)?$)", + "name": "markup.raw.block.typst", + "end": "(^|\\G)(\\2|\\s{0,3})(\\3)\\s*$", + "beginCaptures": { + "3": { + "name": "punctuation.definition.raw.typst" + }, + "4": { + "name": "fenced_code.block.language.typst" + }, + "5": { + "name": "fenced_code.block.language.attributes.typst" + } + }, + "endCaptures": { + "3": { + "name": "punctuation.definition.raw.typst" + } + }, + "patterns": [ + { + "begin": "(^|\\G)(\\s*)(.*)", + "while": "(^|\\G)(?!\\s*([`~]{3,})\\s*$)", + "contentName": "meta.embedded.block.powershell", + "patterns": [ + { + "include": "source.powershell" + } + ] + } + ] + }, + "fenced_code_block_python": { + "begin": "(^|\\G)(\\s*)(`{3,})\\s*(?i:(python|py|py3|rpy|pyw|cpy|SConstruct|Sconstruct|sconstruct|SConscript|gyp|gypi|\\{\\.python.+?\\})((\\s+|:|,|\\{|\\?)[^`]*)?$)", + "name": "markup.raw.block.typst", + "end": "(^|\\G)(\\2|\\s{0,3})(\\3)\\s*$", + "beginCaptures": { + "3": { + "name": "punctuation.definition.raw.typst" + }, + "4": { + "name": "fenced_code.block.language.typst" + }, + "5": { + "name": "fenced_code.block.language.attributes.typst" + } + }, + "endCaptures": { + "3": { + "name": "punctuation.definition.raw.typst" + } + }, + "patterns": [ + { + "begin": "(^|\\G)(\\s*)(.*)", + "while": "(^|\\G)(?!\\s*([`~]{3,})\\s*$)", + "contentName": "meta.embedded.block.python", + "patterns": [ + { + "include": "source.python" + } + ] + } + ] + }, + "fenced_code_block_julia": { + "begin": "(^|\\G)(\\s*)(`{3,})\\s*(?i:(julia|\\{\\.julia.+?\\})((\\s+|:|,|\\{|\\?)[^`]*)?$)", + "name": "markup.raw.block.typst", + "end": "(^|\\G)(\\2|\\s{0,3})(\\3)\\s*$", + "beginCaptures": { + "3": { + "name": "punctuation.definition.raw.typst" + }, + "4": { + "name": "fenced_code.block.language.typst" + }, + "5": { + "name": "fenced_code.block.language.attributes.typst" + } + }, + "endCaptures": { + "3": { + "name": "punctuation.definition.raw.typst" + } + }, + "patterns": [ + { + "begin": "(^|\\G)(\\s*)(.*)", + "while": "(^|\\G)(?!\\s*([`~]{3,})\\s*$)", + "contentName": "meta.embedded.block.julia", + "patterns": [ + { + "include": "source.julia" + } + ] + } + ] + }, + "fenced_code_block_regexp_python": { + "begin": "(^|\\G)(\\s*)(`{3,})\\s*(?i:(re)((\\s+|:|,|\\{|\\?)[^`]*)?$)", + "name": "markup.raw.block.typst", + "end": "(^|\\G)(\\2|\\s{0,3})(\\3)\\s*$", + "beginCaptures": { + "3": { + "name": "punctuation.definition.raw.typst" + }, + "4": { + "name": "fenced_code.block.language.typst" + }, + "5": { + "name": "fenced_code.block.language.attributes.typst" + } + }, + "endCaptures": { + "3": { + "name": "punctuation.definition.raw.typst" + } + }, + "patterns": [ + { + "begin": "(^|\\G)(\\s*)(.*)", + "while": "(^|\\G)(?!\\s*([`~]{3,})\\s*$)", + "contentName": "meta.embedded.block.regexp_python", + "patterns": [ + { + "include": "source.regexp.python" + } + ] + } + ] + }, + "fenced_code_block_rust": { + "begin": "(^|\\G)(\\s*)(`{3,})\\s*(?i:(rust|rs|\\{\\.rust.+?\\})((\\s+|:|,|\\{|\\?)[^`]*)?$)", + "name": "markup.raw.block.typst", + "end": "(^|\\G)(\\2|\\s{0,3})(\\3)\\s*$", + "beginCaptures": { + "3": { + "name": "punctuation.definition.raw.typst" + }, + "4": { + "name": "fenced_code.block.language.typst" + }, + "5": { + "name": "fenced_code.block.language.attributes.typst" + } + }, + "endCaptures": { + "3": { + "name": "punctuation.definition.raw.typst" + } + }, + "patterns": [ + { + "begin": "(^|\\G)(\\s*)(.*)", + "while": "(^|\\G)(?!\\s*([`~]{3,})\\s*$)", + "contentName": "meta.embedded.block.rust", + "patterns": [ + { + "include": "source.rust" + } + ] + } + ] + }, + "fenced_code_block_scala": { + "begin": "(^|\\G)(\\s*)(`{3,})\\s*(?i:(scala|sbt)((\\s+|:|,|\\{|\\?)[^`]*)?$)", + "name": "markup.raw.block.typst", + "end": "(^|\\G)(\\2|\\s{0,3})(\\3)\\s*$", + "beginCaptures": { + "3": { + "name": "punctuation.definition.raw.typst" + }, + "4": { + "name": "fenced_code.block.language.typst" + }, + "5": { + "name": "fenced_code.block.language.attributes.typst" + } + }, + "endCaptures": { + "3": { + "name": "punctuation.definition.raw.typst" + } + }, + "patterns": [ + { + "begin": "(^|\\G)(\\s*)(.*)", + "while": "(^|\\G)(?!\\s*([`~]{3,})\\s*$)", + "contentName": "meta.embedded.block.scala", + "patterns": [ + { + "include": "source.scala" + } + ] + } + ] + }, + "fenced_code_block_shell": { + "begin": "(^|\\G)(\\s*)(`{3,})\\s*(?i:(shell|sh|bash|zsh|bashrc|bash_profile|bash_login|profile|bash_logout|.textmate_init|\\{\\.bash.+?\\})((\\s+|:|,|\\{|\\?)[^`]*)?$)", + "name": "markup.raw.block.typst", + "end": "(^|\\G)(\\2|\\s{0,3})(\\3)\\s*$", + "beginCaptures": { + "3": { + "name": "punctuation.definition.raw.typst" + }, + "4": { + "name": "fenced_code.block.language.typst" + }, + "5": { + "name": "fenced_code.block.language.attributes.typst" + } + }, + "endCaptures": { + "3": { + "name": "punctuation.definition.raw.typst" + } + }, + "patterns": [ + { + "begin": "(^|\\G)(\\s*)(.*)", + "while": "(^|\\G)(?!\\s*([`~]{3,})\\s*$)", + "contentName": "meta.embedded.block.shellscript", + "patterns": [ + { + "include": "source.shell" + } + ] + } + ] + }, + "fenced_code_block_ts": { + "begin": "(^|\\G)(\\s*)(`{3,})\\s*(?i:(typescript|ts)((\\s+|:|,|\\{|\\?)[^`]*)?$)", + "name": "markup.raw.block.typst", + "end": "(^|\\G)(\\2|\\s{0,3})(\\3)\\s*$", + "beginCaptures": { + "3": { + "name": "punctuation.definition.raw.typst" + }, + "4": { + "name": "fenced_code.block.language.typst" + }, + "5": { + "name": "fenced_code.block.language.attributes.typst" + } + }, + "endCaptures": { + "3": { + "name": "punctuation.definition.raw.typst" + } + }, + "patterns": [ + { + "begin": "(^|\\G)(\\s*)(.*)", + "while": "(^|\\G)(?!\\s*([`~]{3,})\\s*$)", + "contentName": "meta.embedded.block.typescript", + "patterns": [ + { + "include": "source.ts" + } + ] + } + ] + }, + "fenced_code_block_tsx": { + "begin": "(^|\\G)(\\s*)(`{3,})\\s*(?i:(tsx)((\\s+|:|,|\\{|\\?)[^`]*)?$)", + "name": "markup.raw.block.typst", + "end": "(^|\\G)(\\2|\\s{0,3})(\\3)\\s*$", + "beginCaptures": { + "3": { + "name": "punctuation.definition.raw.typst" + }, + "4": { + "name": "fenced_code.block.language.typst" + }, + "5": { + "name": "fenced_code.block.language.attributes.typst" + } + }, + "endCaptures": { + "3": { + "name": "punctuation.definition.raw.typst" + } + }, + "patterns": [ + { + "begin": "(^|\\G)(\\s*)(.*)", + "while": "(^|\\G)(?!\\s*([`~]{3,})\\s*$)", + "contentName": "meta.embedded.block.typescriptreact", + "patterns": [ + { + "include": "source.tsx" + } + ] + } + ] + }, + "fenced_code_block_csharp": { + "begin": "(^|\\G)(\\s*)(`{3,})\\s*(?i:(cs|csharp|c#)((\\s+|:|,|\\{|\\?)[^`]*)?$)", + "name": "markup.raw.block.typst", + "end": "(^|\\G)(\\2|\\s{0,3})(\\3)\\s*$", + "beginCaptures": { + "3": { + "name": "punctuation.definition.raw.typst" + }, + "4": { + "name": "fenced_code.block.language.typst" + }, + "5": { + "name": "fenced_code.block.language.attributes.typst" + } + }, + "endCaptures": { + "3": { + "name": "punctuation.definition.raw.typst" + } + }, + "patterns": [ + { + "begin": "(^|\\G)(\\s*)(.*)", + "while": "(^|\\G)(?!\\s*([`~]{3,})\\s*$)", + "contentName": "meta.embedded.block.csharp", + "patterns": [ + { + "include": "source.cs" + } + ] + } + ] + }, + "fenced_code_block_fsharp": { + "begin": "(^|\\G)(\\s*)(`{3,})\\s*(?i:(fs|fsharp|f#)((\\s+|:|,|\\{|\\?)[^`]*)?$)", + "name": "markup.raw.block.typst", + "end": "(^|\\G)(\\2|\\s{0,3})(\\3)\\s*$", + "beginCaptures": { + "3": { + "name": "punctuation.definition.raw.typst" + }, + "4": { + "name": "fenced_code.block.language.typst" + }, + "5": { + "name": "fenced_code.block.language.attributes.typst" + } + }, + "endCaptures": { + "3": { + "name": "punctuation.definition.raw.typst" + } + }, + "patterns": [ + { + "begin": "(^|\\G)(\\s*)(.*)", + "while": "(^|\\G)(?!\\s*([`~]{3,})\\s*$)", + "contentName": "meta.embedded.block.fsharp", + "patterns": [ + { + "include": "source.fsharp" + } + ] + } + ] + }, + "fenced_code_block_dart": { + "begin": "(^|\\G)(\\s*)(`{3,})\\s*(?i:(dart)((\\s+|:|,|\\{|\\?)[^`]*)?$)", + "name": "markup.raw.block.typst", + "end": "(^|\\G)(\\2|\\s{0,3})(\\3)\\s*$", + "beginCaptures": { + "3": { + "name": "punctuation.definition.raw.typst" + }, + "4": { + "name": "fenced_code.block.language.typst" + }, + "5": { + "name": "fenced_code.block.language.attributes.typst" + } + }, + "endCaptures": { + "3": { + "name": "punctuation.definition.raw.typst" + } + }, + "patterns": [ + { + "begin": "(^|\\G)(\\s*)(.*)", + "while": "(^|\\G)(?!\\s*([`~]{3,})\\s*$)", + "contentName": "meta.embedded.block.dart", + "patterns": [ + { + "include": "source.dart" + } + ] + } + ] + }, + "fenced_code_block_handlebars": { + "begin": "(^|\\G)(\\s*)(`{3,})\\s*(?i:(handlebars|hbs)((\\s+|:|,|\\{|\\?)[^`]*)?$)", + "name": "markup.raw.block.typst", + "end": "(^|\\G)(\\2|\\s{0,3})(\\3)\\s*$", + "beginCaptures": { + "3": { + "name": "punctuation.definition.raw.typst" + }, + "4": { + "name": "fenced_code.block.language.typst" + }, + "5": { + "name": "fenced_code.block.language.attributes.typst" + } + }, + "endCaptures": { + "3": { + "name": "punctuation.definition.raw.typst" + } + }, + "patterns": [ + { + "begin": "(^|\\G)(\\s*)(.*)", + "while": "(^|\\G)(?!\\s*([`~]{3,})\\s*$)", + "contentName": "meta.embedded.block.handlebars", + "patterns": [ + { + "include": "text.html.handlebars" + } + ] + } + ] + }, + "fenced_code_block_markdown": { + "begin": "(^|\\G)(\\s*)(`{3,})\\s*(?i:(markdown|md)((\\s+|:|,|\\{|\\?)[^`]*)?$)", + "name": "markup.raw.block.typst", + "end": "(^|\\G)(\\2|\\s{0,3})(\\3)\\s*$", + "beginCaptures": { + "3": { + "name": "punctuation.definition.raw.typst" + }, + "4": { + "name": "fenced_code.block.language.typst" + }, + "5": { + "name": "fenced_code.block.language.attributes.typst" + } + }, + "endCaptures": { + "3": { + "name": "punctuation.definition.raw.typst" + } + }, + "patterns": [ + { + "begin": "(^|\\G)(\\s*)(.*)", + "while": "(^|\\G)(?!\\s*([`~]{3,})\\s*$)", + "contentName": "meta.embedded.block.markdown", + "patterns": [ + { + "include": "text.html.markdown" + } + ] + } + ] + }, + "fenced_code_block_log": { + "begin": "(^|\\G)(\\s*)(`{3,})\\s*(?i:(log)((\\s+|:|,|\\{|\\?)[^`]*)?$)", + "name": "markup.raw.block.typst", + "end": "(^|\\G)(\\2|\\s{0,3})(\\3)\\s*$", + "beginCaptures": { + "3": { + "name": "punctuation.definition.raw.typst" + }, + "4": { + "name": "fenced_code.block.language.typst" + }, + "5": { + "name": "fenced_code.block.language.attributes.typst" + } + }, + "endCaptures": { + "3": { + "name": "punctuation.definition.raw.typst" + } + }, + "patterns": [ + { + "begin": "(^|\\G)(\\s*)(.*)", + "while": "(^|\\G)(?!\\s*([`~]{3,})\\s*$)", + "contentName": "meta.embedded.block.log", + "patterns": [ + { + "include": "text.log" + } + ] + } + ] + }, + "fenced_code_block_erlang": { + "begin": "(^|\\G)(\\s*)(`{3,})\\s*(?i:(erlang)((\\s+|:|,|\\{|\\?)[^`]*)?$)", + "name": "markup.raw.block.typst", + "end": "(^|\\G)(\\2|\\s{0,3})(\\3)\\s*$", + "beginCaptures": { + "3": { + "name": "punctuation.definition.raw.typst" + }, + "4": { + "name": "fenced_code.block.language.typst" + }, + "5": { + "name": "fenced_code.block.language.attributes.typst" + } + }, + "endCaptures": { + "3": { + "name": "punctuation.definition.raw.typst" + } + }, + "patterns": [ + { + "begin": "(^|\\G)(\\s*)(.*)", + "while": "(^|\\G)(?!\\s*([`~]{3,})\\s*$)", + "contentName": "meta.embedded.block.erlang", + "patterns": [ + { + "include": "source.erlang" + } + ] + } + ] + }, + "fenced_code_block_elixir": { + "begin": "(^|\\G)(\\s*)(`{3,})\\s*(?i:(elixir)((\\s+|:|,|\\{|\\?)[^`]*)?$)", + "name": "markup.raw.block.typst", + "end": "(^|\\G)(\\2|\\s{0,3})(\\3)\\s*$", + "beginCaptures": { + "3": { + "name": "punctuation.definition.raw.typst" + }, + "4": { + "name": "fenced_code.block.language.typst" + }, + "5": { + "name": "fenced_code.block.language.attributes.typst" + } + }, + "endCaptures": { + "3": { + "name": "punctuation.definition.raw.typst" + } + }, + "patterns": [ + { + "begin": "(^|\\G)(\\s*)(.*)", + "while": "(^|\\G)(?!\\s*([`~]{3,})\\s*$)", + "contentName": "meta.embedded.block.elixir", + "patterns": [ + { + "include": "source.elixir" + } + ] + } + ] + }, + "fenced_code_block_latex": { + "begin": "(^|\\G)(\\s*)(`{3,})\\s*(?i:(latex|tex)((\\s+|:|,|\\{|\\?)[^`]*)?$)", + "name": "markup.raw.block.typst", + "end": "(^|\\G)(\\2|\\s{0,3})(\\3)\\s*$", + "beginCaptures": { + "3": { + "name": "punctuation.definition.raw.typst" + }, + "4": { + "name": "fenced_code.block.language.typst" + }, + "5": { + "name": "fenced_code.block.language.attributes.typst" + } + }, + "endCaptures": { + "3": { + "name": "punctuation.definition.raw.typst" + } + }, + "patterns": [ + { + "begin": "(^|\\G)(\\s*)(.*)", + "while": "(^|\\G)(?!\\s*([`~]{3,})\\s*$)", + "contentName": "meta.embedded.block.latex", + "patterns": [ + { + "include": "text.tex.latex" + } + ] + } + ] + }, + "fenced_code_block_bibtex": { + "begin": "(^|\\G)(\\s*)(`{3,})\\s*(?i:(bibtex)((\\s+|:|,|\\{|\\?)[^`]*)?$)", + "name": "markup.raw.block.typst", + "end": "(^|\\G)(\\2|\\s{0,3})(\\3)\\s*$", + "beginCaptures": { + "3": { + "name": "punctuation.definition.raw.typst" + }, + "4": { + "name": "fenced_code.block.language.typst" + }, + "5": { + "name": "fenced_code.block.language.attributes.typst" + } + }, + "endCaptures": { + "3": { + "name": "punctuation.definition.raw.typst" + } + }, + "patterns": [ + { + "begin": "(^|\\G)(\\s*)(.*)", + "while": "(^|\\G)(?!\\s*([`~]{3,})\\s*$)", + "contentName": "meta.embedded.block.bibtex", + "patterns": [ + { + "include": "text.bibtex" + } + ] + } + ] + }, + "fenced_code_block_twig": { + "begin": "(^|\\G)(\\s*)(`{3,})\\s*(?i:(twig)((\\s+|:|,|\\{|\\?)[^`]*)?$)", + "name": "markup.raw.block.typst", + "end": "(^|\\G)(\\2|\\s{0,3})(\\3)\\s*$", + "beginCaptures": { + "3": { + "name": "punctuation.definition.raw.typst" + }, + "4": { + "name": "fenced_code.block.language.typst" + }, + "5": { + "name": "fenced_code.block.language.attributes.typst" + } + }, + "endCaptures": { + "3": { + "name": "punctuation.definition.raw.typst" + } + }, + "patterns": [ + { + "begin": "(^|\\G)(\\s*)(.*)", + "while": "(^|\\G)(?!\\s*([`~]{3,})\\s*$)", + "contentName": "meta.embedded.block.twig", + "patterns": [ + { + "include": "source.twig" + } + ] + } + ] + }, + "fenced_code_block": { + "patterns": [ + { + "include": "#fenced_code_block_typst" + }, + { + "include": "#fenced_code_block_css" + }, + { + "include": "#fenced_code_block_basic" + }, + { + "include": "#fenced_code_block_ini" + }, + { + "include": "#fenced_code_block_java" + }, + { + "include": "#fenced_code_block_lua" + }, + { + "include": "#fenced_code_block_makefile" + }, + { + "include": "#fenced_code_block_perl" + }, + { + "include": "#fenced_code_block_r" + }, + { + "include": "#fenced_code_block_ruby" + }, + { + "include": "#fenced_code_block_php" + }, + { + "include": "#fenced_code_block_sql" + }, + { + "include": "#fenced_code_block_vs_net" + }, + { + "include": "#fenced_code_block_xml" + }, + { + "include": "#fenced_code_block_xsl" + }, + { + "include": "#fenced_code_block_yaml" + }, + { + "include": "#fenced_code_block_dosbatch" + }, + { + "include": "#fenced_code_block_clojure" + }, + { + "include": "#fenced_code_block_coffee" + }, + { + "include": "#fenced_code_block_c" + }, + { + "include": "#fenced_code_block_cpp" + }, + { + "include": "#fenced_code_block_diff" + }, + { + "include": "#fenced_code_block_dockerfile" + }, + { + "include": "#fenced_code_block_git_commit" + }, + { + "include": "#fenced_code_block_git_rebase" + }, + { + "include": "#fenced_code_block_go" + }, + { + "include": "#fenced_code_block_groovy" + }, + { + "include": "#fenced_code_block_pug" + }, + { + "include": "#fenced_code_block_js" + }, + { + "include": "#fenced_code_block_js_regexp" + }, + { + "include": "#fenced_code_block_json" + }, + { + "include": "#fenced_code_block_jsonc" + }, + { + "include": "#fenced_code_block_less" + }, + { + "include": "#fenced_code_block_objc" + }, + { + "include": "#fenced_code_block_swift" + }, + { + "include": "#fenced_code_block_scss" + }, + { + "include": "#fenced_code_block_perl6" + }, + { + "include": "#fenced_code_block_powershell" + }, + { + "include": "#fenced_code_block_python" + }, + { + "include": "#fenced_code_block_julia" + }, + { + "include": "#fenced_code_block_regexp_python" + }, + { + "include": "#fenced_code_block_rust" + }, + { + "include": "#fenced_code_block_scala" + }, + { + "include": "#fenced_code_block_shell" + }, + { + "include": "#fenced_code_block_ts" + }, + { + "include": "#fenced_code_block_tsx" + }, + { + "include": "#fenced_code_block_csharp" + }, + { + "include": "#fenced_code_block_fsharp" + }, + { + "include": "#fenced_code_block_dart" + }, + { + "include": "#fenced_code_block_handlebars" + }, + { + "include": "#fenced_code_block_markdown" + }, + { + "include": "#fenced_code_block_log" + }, + { + "include": "#fenced_code_block_erlang" + }, + { + "include": "#fenced_code_block_elixir" + }, + { + "include": "#fenced_code_block_latex" + }, + { + "include": "#fenced_code_block_bibtex" + }, + { + "include": "#fenced_code_block_twig" + }, + { + "include": "#fenced_code_block_unknown" + } + ] + }, + "fenced_code_block_unknown": { + "begin": "(^|\\G)(\\s*)(`{3,})\\s*(?=([^`]*)?$)", + "beginCaptures": { + "3": { + "name": "punctuation.definition.raw.typst" + }, + "4": { + "name": "fenced_code.block.language" + } + }, + "end": "(^|\\G)(\\2|\\s{0,3})(\\3)\\s*$", + "endCaptures": { + "3": { + "name": "punctuation.definition.raw.typst" + } + }, + "name": "markup.raw.block.typst" } }, "scopeName": "source.typst"