summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/syntax/highlight.rs2
-rw-r--r--tools/support/typst.tmLanguage.json77
2 files changed, 46 insertions, 33 deletions
diff --git a/src/syntax/highlight.rs b/src/syntax/highlight.rs
index de7c70a2..4a453480 100644
--- a/src/syntax/highlight.rs
+++ b/src/syntax/highlight.rs
@@ -389,7 +389,7 @@ impl Category {
Self::Math => "string.other.math.typst",
Self::Heading => "markup.heading.typst",
Self::List => "markup.list.typst",
- Self::Term => "markup.bold.typst",
+ Self::Term => "markup.list.term.typst",
Self::Label => "entity.name.label.typst",
Self::Ref => "markup.other.reference.typst",
Self::Keyword => "keyword.typst",
diff --git a/tools/support/typst.tmLanguage.json b/tools/support/typst.tmLanguage.json
index f493cc5b..7a1c8458 100644
--- a/tools/support/typst.tmLanguage.json
+++ b/tools/support/typst.tmLanguage.json
@@ -49,22 +49,16 @@
"match": "\\\\([\\\\/\\[\\]{}#*_=~`$-.]|u\\{[0-9a-zA-Z]*\\}?)"
},
{
- "name": "markup.bold.typst",
- "begin": "(^\\*|\\*$|((?<=\\W|_)\\*)|(\\*(?=\\W|_)))",
- "end": "(^\\*|\\*$|((?<=\\W|_)\\*)|(\\*(?=\\W|_)))|\n|(?=\\])",
- "captures": { "0": { "name": "punctuation.definition.bold.typst" } },
- "patterns": [{ "include": "#markup" }]
+ "name": "punctuation.definition.linebreak.typst",
+ "match": "\\\\"
},
{
- "name": "markup.italic.typst",
- "begin": "(^_|_$|((?<=\\W|_)_)|(_(?=\\W|_)))",
- "end": "(^_|_$|((?<=\\W|_)_)|(_(?=\\W|_)))|\n|(?=\\])",
- "captures": { "0": { "name": "punctuation.definition.italic.typst" } },
- "patterns": [{ "include": "#markup" }]
+ "name": "punctuation.definition.nonbreaking-space.typst",
+ "match": "~"
},
{
- "name": "punctuation.definition.linebreak.typst",
- "match": "\\\\"
+ "name": "punctuation.definition.shy.typst",
+ "match": "-\\?"
},
{
"name": "punctuation.definition.em-dash.typst",
@@ -75,24 +69,26 @@
"match": "--"
},
{
- "name": "punctuation.definition.nonbreaking-space.typst",
- "match": "~"
+ "name": "punctuation.definition.ellipsis.typst",
+ "match": "\\.\\.\\."
},
{
- "name": "markup.heading.typst",
- "contentName": "entity.name.section.typst",
- "begin": "^\\s*=+\\s+",
- "end": "\n|(?=<)",
- "beginCaptures": { "0": { "name": "punctuation.definition.heading.typst" } },
+ "name": "markup.bold.typst",
+ "begin": "(^\\*|\\*$|((?<=\\W|_)\\*)|(\\*(?=\\W|_)))",
+ "end": "(^\\*|\\*$|((?<=\\W|_)\\*)|(\\*(?=\\W|_)))|\n|(?=\\])",
+ "captures": { "0": { "name": "punctuation.definition.bold.typst" } },
"patterns": [{ "include": "#markup" }]
},
{
- "name": "punctuation.definition.list.unnumbered.typst",
- "match": "^\\s*-\\s+"
+ "name": "markup.italic.typst",
+ "begin": "(^_|_$|((?<=\\W|_)_)|(_(?=\\W|_)))",
+ "end": "(^_|_$|((?<=\\W|_)_)|(_(?=\\W|_)))|\n|(?=\\])",
+ "captures": { "0": { "name": "punctuation.definition.italic.typst" } },
+ "patterns": [{ "include": "#markup" }]
},
{
- "name": "punctuation.definition.list.numbered.typst",
- "match": "^\\s*[0-9]*\\.\\s+"
+ "name": "markup.underline.link.typst",
+ "match": "https?://[0-9a-zA-Z~/%#&=',;\\.\\+\\?]*"
},
{
"name": "markup.raw.block.typst",
@@ -107,21 +103,33 @@
"captures": { "0": { "name": "punctuation.definition.raw.typst" } }
},
{
- "name": "string.other.math.block.typst",
- "begin": "\\$\\[",
- "end": "\\]\\$",
- "captures": { "0": { "name": "punctuation.defintion.string.math.typst" } }
- },
- {
"name": "string.other.math.typst",
"begin": "\\$",
"end": "\\$",
"captures": { "0": { "name": "punctuation.defintion.string.math.typst" } }
},
{
- "name": "entity.other.reference.typst",
- "match": "(@)[[:alpha:]_][[:alnum:]_-]*",
- "captures": { "1": { "name": "punctuation.definition.reference.typst" } }
+ "name": "markup.heading.typst",
+ "contentName": "entity.name.section.typst",
+ "begin": "^\\s*=+\\s+",
+ "end": "\n|(?=<)",
+ "beginCaptures": { "0": { "name": "punctuation.definition.heading.typst" } },
+ "patterns": [{ "include": "#markup" }]
+ },
+ {
+ "name": "punctuation.definition.list.unnumbered.typst",
+ "match": "^\\s*-\\s+"
+ },
+ {
+ "name": "punctuation.definition.list.numbered.typst",
+ "match": "^\\s*([0-9]*\\.|\\+)\\s+"
+ },
+ {
+ "match": "^\\s*(/)\\s+([^:]*:)",
+ "captures": {
+ "1": { "name": "punctuation.definition.list.description.typst" },
+ "2": { "name": "markup.list.term.typst" }
+ }
},
{
"name": "entity.other.label.typst",
@@ -129,6 +137,11 @@
"captures": { "1": { "name": "punctuation.definition.label.typst" } }
},
{
+ "name": "entity.other.reference.typst",
+ "match": "(@)[[:alpha:]_][[:alnum:]_-]*",
+ "captures": { "1": { "name": "punctuation.definition.reference.typst" } }
+ },
+ {
"begin": "(#)(pub|let|set|show|wrap)\\b",
"end": "\n|(;)|(?=])",
"beginCaptures": {