mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-01 19:17:02 -04:00
style(typst): format queries
This commit is contained in:
parent
06d575ead4
commit
f85b205e83
2 changed files with 77 additions and 62 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -1,4 +1,2 @@
|
|||
([
|
||||
(comment)
|
||||
] @injection.content
|
||||
((comment) @injection.content
|
||||
(#set! injection.language "comment"))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue