style(typst): format queries

This commit is contained in:
Raafat Turki 2024-02-16 22:30:48 +03:00 committed by Amaan Qureshi
parent 06d575ead4
commit f85b205e83
2 changed files with 77 additions and 62 deletions

View file

@ -1,114 +1,131 @@
;; comments
; comments
(comment) @comment @spell
;; punctuation
; punctuation
"#" @punctuation.special
[
"#"
] @punctuation.special
":"
";"
","
] @punctuation.delimiter
[
":"
";"
","
] @punctuation.delimiter
[
"(" ")"
"{" "}"
] @punctuation.bracket
"("
")"
"{"
"}"
] @punctuation.bracket
; TODO: context blocks?
[
"["
"]"
] @punctuation.bracket
"["
"]"
] @punctuation.bracket
;; operators
; operators
[
"-"
"+"
"*"
"/"
"-"
"+"
"*"
"/"
"=="
"!="
"<"
"<="
">"
">="
"="
"in"
"and"
"or"
"not"
] @operator
"=="
"!="
"<"
"<="
">"
">="
"="
"in"
"and"
"or"
"not"
] @operator
;; keywords
; keywords
[
"import"
"include"
] @keyword.import
[
"let"
"set"
"show"
] @keyword
"import"
"include"
] @keyword.import
;; control flow
[
"let"
"set"
"show"
] @keyword
; control flow
[
"for"
"while"
"break"
"continue"
] @keyword.repeat
[
"if"
"else"
] @keyword.conditional
; special case: #for (ident) in (expr)
(for "in" @keyword.repeat)
;; type literals
; special case: #for (ident) in (expr)
(for
"in" @keyword.repeat)
; type literals
(number) @number
(string) @string
(bool) @boolean
;; identifiers
; identifiers
(builtin) @module.builtin
(ident) @constant
;; name-value pairs
; name-value pairs
(tagged
field: (ident)) @variable.member
;; function definitions, calls, etc.
;; TODO: support for functions such as #calc.cos, tree view appears as
;; (call)
;; item: (field)
;; (builtin)
; function definitions, calls, etc.
; TODO: support for functions such as #calc.cos, tree view appears as
; (call)
; item: (field)
; (builtin)
; field: (ident)
(call
item: (builtin) @function.builtin)
(call
item: (ident) @function.call)
;; text
; text
(text) @spell
; TODO: use multi level headings
(heading) @markup.heading
(strong) @markup.strong
(emph) @markup.italic
(url) @markup.link.url
;; code blocks
; code blocks
(raw_span) @markup.raw
(raw_span
(blob)) @markup.raw
(raw_blck) @markup.raw
(raw_blck
(blob)) @markup.raw.block
;; refs and labels
; refs and labels
(label) @markup.link.label
(ref) @markup.link
;; math
; math
(math) @markup.math

View file

@ -1,4 +1,2 @@
([
(comment)
] @injection.content
((comment) @injection.content
(#set! injection.language "comment"))