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
17
runtime/queries/wing/folds.scm
Normal file
17
runtime/queries/wing/folds.scm
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
[
|
||||
(class_definition)
|
||||
(class_implementation)
|
||||
(interface_definition)
|
||||
(interface_implementation)
|
||||
(for_in_loop)
|
||||
(while_statement)
|
||||
(if_statement)
|
||||
(if_let_statement)
|
||||
(else_if_block)
|
||||
(struct_definition)
|
||||
(enum_definition)
|
||||
(try_catch_statement)
|
||||
(method_definition)
|
||||
(import_statement)+
|
||||
(initializer)
|
||||
] @fold
|
||||
179
runtime/queries/wing/highlights.scm
Normal file
179
runtime/queries/wing/highlights.scm
Normal file
|
|
@ -0,0 +1,179 @@
|
|||
(identifier) @variable
|
||||
|
||||
(reference_identifier) @variable
|
||||
|
||||
(member_identifier) @variable.member
|
||||
|
||||
; Classes
|
||||
(custom_type) @type
|
||||
|
||||
(class_field
|
||||
name: (identifier) @property)
|
||||
|
||||
(struct_field
|
||||
name: (identifier) @property)
|
||||
|
||||
(class_definition
|
||||
name: (identifier) @type)
|
||||
|
||||
(struct_definition
|
||||
name: (identifier) @type)
|
||||
|
||||
(interface_definition
|
||||
name: (identifier) @type)
|
||||
|
||||
(method_definition
|
||||
name: (identifier) @function.method)
|
||||
|
||||
(json_literal_member
|
||||
(identifier) @property)
|
||||
|
||||
; Functions
|
||||
(keyword_argument_key) @variable.parameter
|
||||
|
||||
(parameter_definition
|
||||
name: (identifier) @variable.parameter)
|
||||
|
||||
(variadic) @variable.parameter.builtin
|
||||
|
||||
(call
|
||||
caller: (reference
|
||||
(nested_identifier
|
||||
property: (member_identifier) @function.method.call)))
|
||||
|
||||
(call
|
||||
caller: (reference
|
||||
(reference_identifier) @function.method.call))
|
||||
|
||||
; Primitives
|
||||
(number) @number
|
||||
|
||||
(duration) @constant
|
||||
|
||||
(string) @string
|
||||
|
||||
(bool) @boolean
|
||||
|
||||
[
|
||||
(builtin_type)
|
||||
"MutSet"
|
||||
"MutMap"
|
||||
"MutArray"
|
||||
"Json"
|
||||
"Set"
|
||||
"Map"
|
||||
"Array"
|
||||
"MutJson"
|
||||
] @type.builtin
|
||||
|
||||
(json_container_type) @type.builtin
|
||||
|
||||
; Special
|
||||
(comment) @comment @spell
|
||||
|
||||
[
|
||||
"-"
|
||||
"-="
|
||||
"+"
|
||||
"+="
|
||||
"*"
|
||||
"**"
|
||||
"/"
|
||||
"%"
|
||||
"<"
|
||||
"<="
|
||||
"="
|
||||
"=="
|
||||
"!"
|
||||
"!="
|
||||
">"
|
||||
">="
|
||||
"&&"
|
||||
"??"
|
||||
"||"
|
||||
"?"
|
||||
] @operator
|
||||
|
||||
[
|
||||
"("
|
||||
")"
|
||||
"{"
|
||||
"}"
|
||||
"["
|
||||
"]"
|
||||
] @punctuation.bracket
|
||||
|
||||
(mutable_container_type
|
||||
[
|
||||
"<"
|
||||
">"
|
||||
] @punctuation.bracket)
|
||||
|
||||
(immutable_container_type
|
||||
[
|
||||
"<"
|
||||
">"
|
||||
] @punctuation.bracket)
|
||||
|
||||
[
|
||||
";"
|
||||
"."
|
||||
","
|
||||
":"
|
||||
"=>"
|
||||
] @punctuation.delimiter
|
||||
|
||||
[
|
||||
"as"
|
||||
"let"
|
||||
"new"
|
||||
(phase_specifier)
|
||||
"impl"
|
||||
"test"
|
||||
] @keyword
|
||||
|
||||
"bring" @keyword.import
|
||||
|
||||
[
|
||||
"class"
|
||||
"struct"
|
||||
"interface"
|
||||
] @keyword.type
|
||||
|
||||
[
|
||||
"for"
|
||||
"in"
|
||||
] @keyword.repeat
|
||||
|
||||
[
|
||||
"if"
|
||||
"else"
|
||||
] @keyword.conditional
|
||||
|
||||
[
|
||||
"pub"
|
||||
"protected"
|
||||
"internal"
|
||||
"extern"
|
||||
(static)
|
||||
] @keyword.modifier
|
||||
|
||||
"return" @keyword.return
|
||||
|
||||
(import_statement
|
||||
module_name: (identifier) @module)
|
||||
|
||||
(import_statement
|
||||
alias: (identifier) @module)
|
||||
|
||||
(call
|
||||
(reference
|
||||
(nested_identifier
|
||||
object: (reference) @_ref
|
||||
property: (member_identifier) @_ident))
|
||||
(argument_list
|
||||
(positional_argument
|
||||
(string) @string.regexp))
|
||||
(#eq? @_ref "regex")
|
||||
(#eq? @_ident "compile")
|
||||
(#offset! @string.regexp 0 1 0 -1))
|
||||
15
runtime/queries/wing/injections.scm
Normal file
15
runtime/queries/wing/injections.scm
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
((comment) @injection.content
|
||||
(#set! injection.language "comment"))
|
||||
|
||||
(call
|
||||
(reference
|
||||
(nested_identifier
|
||||
object: (reference) @_ref
|
||||
property: (member_identifier) @_ident))
|
||||
(argument_list
|
||||
(positional_argument
|
||||
(string) @injection.content))
|
||||
(#eq? @_ref "regex")
|
||||
(#eq? @_ident "compile")
|
||||
(#offset! @injection.content 0 1 0 -1)
|
||||
(#set! injection.language "regex"))
|
||||
6
runtime/queries/wing/locals.scm
Normal file
6
runtime/queries/wing/locals.scm
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
(block) @local.scope
|
||||
|
||||
(variable_definition_statement
|
||||
name: (identifier) @local.definition)
|
||||
|
||||
; TODO: Missing "@local.reference" usage tuned for each relevant identifier location
|
||||
Loading…
Add table
Add a link
Reference in a new issue