mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-01 19:17:02 -04:00
feat!: drop modules, general refactor and cleanup
This commit is contained in:
parent
310f0925ec
commit
692b051b09
1247 changed files with 6096 additions and 9074 deletions
11
runtime/queries/typst/folds.scm
Normal file
11
runtime/queries/typst/folds.scm
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
[
|
||||
(set)
|
||||
(let)
|
||||
(show)
|
||||
(call)
|
||||
(section)
|
||||
(for)
|
||||
(branch)
|
||||
(content)
|
||||
(raw_blck)
|
||||
] @fold
|
||||
131
runtime/queries/typst/highlights.scm
Normal file
131
runtime/queries/typst/highlights.scm
Normal file
|
|
@ -0,0 +1,131 @@
|
|||
; punctuation
|
||||
"#" @punctuation.special
|
||||
|
||||
[
|
||||
":"
|
||||
";"
|
||||
","
|
||||
] @punctuation.delimiter
|
||||
|
||||
; TODO: context blocks for "[" "]"?
|
||||
[
|
||||
"("
|
||||
")"
|
||||
"{"
|
||||
"}"
|
||||
"["
|
||||
"]"
|
||||
] @punctuation.bracket
|
||||
|
||||
; operators
|
||||
[
|
||||
"-"
|
||||
"+"
|
||||
"*"
|
||||
"/"
|
||||
"=="
|
||||
"!="
|
||||
"<"
|
||||
"<="
|
||||
">"
|
||||
">="
|
||||
"="
|
||||
"in"
|
||||
"and"
|
||||
"or"
|
||||
"not"
|
||||
] @operator
|
||||
|
||||
; keywords
|
||||
[
|
||||
"import"
|
||||
"include"
|
||||
] @keyword.import
|
||||
|
||||
[
|
||||
"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
|
||||
(number) @number
|
||||
|
||||
(string) @string
|
||||
|
||||
(bool) @boolean
|
||||
|
||||
(ident) @constant
|
||||
|
||||
; name-value pairs
|
||||
(tagged
|
||||
field: (ident) @variable.member)
|
||||
|
||||
(call
|
||||
item: (ident) @function.call)
|
||||
|
||||
; text
|
||||
(text) @spell
|
||||
|
||||
(heading
|
||||
"=" @markup.heading.1) @markup.heading.1
|
||||
|
||||
(heading
|
||||
"==" @markup.heading.2) @markup.heading.2
|
||||
|
||||
(heading
|
||||
"===" @markup.heading.3) @markup.heading.3
|
||||
|
||||
(heading
|
||||
"====" @markup.heading.4) @markup.heading.4
|
||||
|
||||
(heading
|
||||
"=====" @markup.heading.5) @markup.heading.5
|
||||
|
||||
(heading
|
||||
"======" @markup.heading.6) @markup.heading.6
|
||||
|
||||
(strong) @markup.strong
|
||||
|
||||
(emph) @markup.italic
|
||||
|
||||
(url) @markup.link.url
|
||||
|
||||
; code blocks
|
||||
(raw_span) @markup.raw
|
||||
|
||||
(raw_blck) @markup.raw
|
||||
|
||||
(raw_blck
|
||||
lang: (ident) @label)
|
||||
|
||||
(raw_blck
|
||||
(blob) @markup.raw.block)
|
||||
|
||||
; refs and labels
|
||||
(label) @markup.link.label
|
||||
|
||||
(ref) @markup.link
|
||||
|
||||
; math
|
||||
(math) @markup.math
|
||||
|
||||
; comments
|
||||
(comment) @comment @spell
|
||||
12
runtime/queries/typst/indents.scm
Normal file
12
runtime/queries/typst/indents.scm
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
[
|
||||
(set)
|
||||
(let)
|
||||
(show)
|
||||
(call)
|
||||
] @indent.begin
|
||||
|
||||
[
|
||||
"]"
|
||||
"}"
|
||||
")"
|
||||
] @indent.branch @indent.end
|
||||
2
runtime/queries/typst/injections.scm
Normal file
2
runtime/queries/typst/injections.scm
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
((comment) @injection.content
|
||||
(#set! injection.language "comment"))
|
||||
Loading…
Add table
Add a link
Reference in a new issue