nvim-treesitter/queries/typst/highlights.scm

114 lines
1.1 KiB
Scheme
Raw Normal View History

2024-02-16 22:30:48 +03:00
; punctuation
"#" @punctuation.special
2024-02-16 22:03:00 +03:00
[
2024-02-16 22:30:48 +03:00
":"
";"
","
] @punctuation.delimiter
; TODO: context blocks for "[" "]"?
2024-02-16 22:03:00 +03:00
[
2024-02-16 22:30:48 +03:00
"("
")"
"{"
"}"
"["
"]"
] @punctuation.bracket
2024-02-16 22:03:00 +03:00
2024-02-16 22:30:48 +03:00
; operators
2024-02-16 21:07:55 +03:00
[
2024-02-16 22:30:48 +03:00
"-"
"+"
"*"
"/"
"=="
"!="
"<"
"<="
">"
">="
"="
"in"
"and"
"or"
"not"
] @operator
; keywords
2024-02-16 22:03:00 +03:00
[
2024-02-16 22:30:48 +03:00
"import"
"include"
] @keyword.import
2024-02-16 22:03:00 +03:00
[
2024-02-16 22:30:48 +03:00
"let"
"set"
"show"
] @keyword
2024-02-16 22:03:00 +03:00
2024-02-16 22:30:48 +03:00
; control flow
2024-02-16 22:03:00 +03:00
[
"for"
"while"
"break"
"continue"
] @keyword.repeat
2024-02-16 22:30:48 +03:00
2024-02-16 22:03:00 +03:00
[
"if"
"else"
] @keyword.conditional
2024-02-16 22:30:48 +03:00
2024-02-16 22:03:00 +03:00
; special case: #for (ident) in (expr)
2024-02-16 22:30:48 +03:00
(for
"in" @keyword.repeat)
2024-02-16 22:03:00 +03:00
2024-02-16 22:30:48 +03:00
; type literals
2024-02-16 21:07:55 +03:00
(number) @number
2024-02-16 22:30:48 +03:00
2024-02-16 21:07:55 +03:00
(string) @string
2024-02-16 22:30:48 +03:00
2024-02-16 21:07:55 +03:00
(bool) @boolean
2024-02-16 22:03:00 +03:00
(ident) @constant
2024-02-16 22:30:48 +03:00
; name-value pairs
2024-02-16 21:07:55 +03:00
(tagged
field: (ident) @variable.member)
2024-02-16 22:30:48 +03:00
2024-02-16 21:07:55 +03:00
(call
item: (ident) @function.call)
2024-02-16 21:07:55 +03:00
2024-02-16 22:30:48 +03:00
; text
2024-02-16 22:03:00 +03:00
(text) @spell
2024-02-16 22:30:48 +03:00
2024-02-16 22:03:00 +03:00
; TODO: use multi level headings
(heading) @markup.heading
2024-02-16 22:30:48 +03:00
2024-02-16 22:03:00 +03:00
(strong) @markup.strong
2024-02-16 22:30:48 +03:00
2024-02-16 22:03:00 +03:00
(emph) @markup.italic
2024-02-16 22:30:48 +03:00
2024-02-16 22:03:00 +03:00
(url) @markup.link.url
2024-02-16 22:30:48 +03:00
; code blocks
2024-02-16 22:03:00 +03:00
(raw_span) @markup.raw
2024-02-16 22:30:48 +03:00
2024-02-16 22:03:00 +03:00
(raw_blck) @markup.raw
2024-02-16 22:30:48 +03:00
2024-02-16 21:07:55 +03:00
(raw_blck
(blob) @markup.raw.block)
2024-02-16 22:03:00 +03:00
2024-02-16 22:30:48 +03:00
; refs and labels
2024-02-16 22:03:00 +03:00
(label) @markup.link.label
2024-02-16 22:30:48 +03:00
2024-02-16 22:03:00 +03:00
(ref) @markup.link
2024-02-16 21:07:55 +03:00
2024-02-16 22:30:48 +03:00
; math
2024-02-16 22:03:00 +03:00
(math) @markup.math
; comments
(comment) @comment @spell