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
10
runtime/queries/kcl/folds.scm
Normal file
10
runtime/queries/kcl/folds.scm
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
[
|
||||
(protocol_stmt)
|
||||
(rule_stmt)
|
||||
(schema_stmt)
|
||||
(check_stmt)
|
||||
(if_stmt)
|
||||
(lambda_expr)
|
||||
(config_expr)
|
||||
(string)
|
||||
] @fold
|
||||
201
runtime/queries/kcl/highlights.scm
Normal file
201
runtime/queries/kcl/highlights.scm
Normal file
|
|
@ -0,0 +1,201 @@
|
|||
(identifier) @variable
|
||||
|
||||
(import_stmt
|
||||
(dotted_name
|
||||
(identifier) @module))
|
||||
|
||||
(import_stmt
|
||||
(dotted_name
|
||||
(identifier) @module)
|
||||
(identifier) @module)
|
||||
|
||||
(basic_type) @type.builtin
|
||||
|
||||
(schema_type
|
||||
(dotted_name
|
||||
(identifier) @type))
|
||||
|
||||
(schema_type
|
||||
(dotted_name
|
||||
(identifier) @module
|
||||
(identifier) @type))
|
||||
|
||||
(schema_expr
|
||||
(identifier) @type)
|
||||
|
||||
(protocol_stmt
|
||||
(identifier) @type)
|
||||
|
||||
(rule_stmt
|
||||
(identifier) @type)
|
||||
|
||||
(schema_stmt
|
||||
(identifier) @type)
|
||||
|
||||
(lambda_expr
|
||||
(typed_parameter
|
||||
(identifier) @variable.parameter))
|
||||
|
||||
(lambda_expr
|
||||
(identifier) @variable.parameter)
|
||||
|
||||
(selector_expr
|
||||
(select_suffix
|
||||
(identifier) @property))
|
||||
|
||||
(comment) @comment @spell
|
||||
|
||||
(string) @string
|
||||
|
||||
(escape_sequence) @string.escape
|
||||
|
||||
(schema_stmt
|
||||
body: (block
|
||||
.
|
||||
(string
|
||||
(string_content) @string.documentation)))
|
||||
|
||||
(decorator
|
||||
(identifier) @attribute)
|
||||
|
||||
(call_expr
|
||||
function: (identifier) @function)
|
||||
|
||||
(call_expr
|
||||
function: (selector_expr
|
||||
(select_suffix
|
||||
(identifier) @function)))
|
||||
|
||||
(integer) @number
|
||||
|
||||
(float) @number.float
|
||||
|
||||
[
|
||||
(true)
|
||||
(false)
|
||||
] @boolean
|
||||
|
||||
[
|
||||
(none)
|
||||
(undefined)
|
||||
] @constant.builtin
|
||||
|
||||
"for" @keyword.repeat
|
||||
|
||||
[
|
||||
"elif"
|
||||
"else"
|
||||
"if"
|
||||
] @keyword.conditional
|
||||
|
||||
"lambda" @keyword.function
|
||||
|
||||
(quant_op) @keyword.operator
|
||||
|
||||
[
|
||||
"protocol"
|
||||
"rule"
|
||||
"schema"
|
||||
"type"
|
||||
"mixin"
|
||||
] @keyword.type
|
||||
|
||||
"assert" @keyword.debug
|
||||
|
||||
[
|
||||
"as"
|
||||
"import"
|
||||
] @keyword.import
|
||||
|
||||
"check" @keyword
|
||||
|
||||
[
|
||||
"("
|
||||
")"
|
||||
"["
|
||||
"]"
|
||||
"{"
|
||||
"}"
|
||||
] @punctuation.bracket
|
||||
|
||||
[
|
||||
","
|
||||
":"
|
||||
"."
|
||||
"?."
|
||||
"?:"
|
||||
"?"
|
||||
] @punctuation.delimiter
|
||||
|
||||
(interpolation
|
||||
"${" @punctuation.special
|
||||
"}" @punctuation.special)
|
||||
|
||||
[
|
||||
"+"
|
||||
"-"
|
||||
"*"
|
||||
"**"
|
||||
"/"
|
||||
"//"
|
||||
"%"
|
||||
"<<"
|
||||
">>"
|
||||
"&"
|
||||
"|"
|
||||
"^"
|
||||
"<"
|
||||
">"
|
||||
"~"
|
||||
"<="
|
||||
">="
|
||||
"=="
|
||||
"!="
|
||||
"="
|
||||
"+="
|
||||
"-="
|
||||
"*="
|
||||
"**="
|
||||
"/="
|
||||
"//="
|
||||
"%="
|
||||
"<<="
|
||||
">>="
|
||||
"&="
|
||||
"^="
|
||||
"->"
|
||||
] @operator
|
||||
|
||||
"@" @attribute
|
||||
|
||||
[
|
||||
"and"
|
||||
"or"
|
||||
"not"
|
||||
"in"
|
||||
"is"
|
||||
] @keyword.operator
|
||||
|
||||
; second argument is a regex in all regex functions with at least two arguments
|
||||
(call_expr
|
||||
function: (selector_expr
|
||||
(identifier) @_regex)
|
||||
arguments: (argument_list
|
||||
(_)
|
||||
.
|
||||
(string
|
||||
(string_content) @string.regexp))
|
||||
(#eq? @_regex "regex"))
|
||||
|
||||
; first argument is a regex in 'regex.compile' function
|
||||
(call_expr
|
||||
function: (selector_expr
|
||||
(identifier) @_regex
|
||||
(select_suffix
|
||||
(identifier) @_fn
|
||||
(#eq? @_fn "compile")))
|
||||
arguments: (argument_list
|
||||
.
|
||||
(string
|
||||
(string_content) @string.regexp))
|
||||
(#eq? @_regex "regex"))
|
||||
26
runtime/queries/kcl/injections.scm
Normal file
26
runtime/queries/kcl/injections.scm
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
(call_expr
|
||||
function: (selector_expr
|
||||
(identifier) @_regex)
|
||||
arguments: (argument_list
|
||||
(_)
|
||||
.
|
||||
(string
|
||||
(string_content) @injection.content))
|
||||
(#eq? @_regex "regex")
|
||||
(#set! injection.language "regex"))
|
||||
|
||||
(call_expr
|
||||
function: (selector_expr
|
||||
(identifier) @_regex
|
||||
(select_suffix
|
||||
(identifier) @_fn
|
||||
(#eq? @_fn "compile")))
|
||||
arguments: (argument_list
|
||||
.
|
||||
(string
|
||||
(string_content) @injection.content))
|
||||
(#eq? @_regex "regex")
|
||||
(#set! injection.language "regex"))
|
||||
|
||||
((comment) @injection.content
|
||||
(#set! injection.language "comment"))
|
||||
Loading…
Add table
Add a link
Reference in a new issue