mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-19 11:50:09 -04:00
chore: query formatting
This commit is contained in:
parent
79975d6557
commit
57a8acf0c4
674 changed files with 18466 additions and 12648 deletions
|
|
@ -1,53 +1,67 @@
|
|||
;; Functions definitions
|
||||
; Functions definitions
|
||||
(function_declarator
|
||||
declarator: (identifier) @local.definition.function)
|
||||
|
||||
(preproc_function_def
|
||||
name: (identifier) @local.definition.macro) @local.scope
|
||||
|
||||
(preproc_def
|
||||
name: (identifier) @local.definition.macro)
|
||||
|
||||
(pointer_declarator
|
||||
declarator: (identifier) @local.definition.var)
|
||||
|
||||
(parameter_declaration
|
||||
declarator: (identifier) @local.definition.parameter)
|
||||
|
||||
(init_declarator
|
||||
declarator: (identifier) @local.definition.var)
|
||||
|
||||
(array_declarator
|
||||
declarator: (identifier) @local.definition.var)
|
||||
|
||||
(declaration
|
||||
declarator: (identifier) @local.definition.var)
|
||||
|
||||
(enum_specifier
|
||||
name: (_) @local.definition.type
|
||||
(enumerator_list
|
||||
(enumerator name: (identifier) @local.definition.var)))
|
||||
(enumerator
|
||||
name: (identifier) @local.definition.var)))
|
||||
|
||||
;; Type / Struct / Enum
|
||||
; Type / Struct / Enum
|
||||
(field_declaration
|
||||
declarator: (field_identifier) @local.definition.field)
|
||||
|
||||
(type_definition
|
||||
declarator: (type_identifier) @local.definition.type)
|
||||
|
||||
(struct_specifier
|
||||
name: (type_identifier) @local.definition.type)
|
||||
|
||||
;; goto
|
||||
(labeled_statement (statement_identifier) @local.definition)
|
||||
; goto
|
||||
(labeled_statement
|
||||
(statement_identifier) @local.definition)
|
||||
|
||||
;; References
|
||||
; References
|
||||
(identifier) @local.reference
|
||||
|
||||
((field_identifier) @local.reference
|
||||
(#set! reference.kind "field"))
|
||||
(#set! reference.kind "field"))
|
||||
|
||||
((type_identifier) @local.reference
|
||||
(#set! reference.kind "type"))
|
||||
(#set! reference.kind "type"))
|
||||
|
||||
(goto_statement (statement_identifier) @local.reference)
|
||||
(goto_statement
|
||||
(statement_identifier) @local.reference)
|
||||
|
||||
;; Scope
|
||||
; Scope
|
||||
[
|
||||
(for_statement)
|
||||
(if_statement)
|
||||
(while_statement)
|
||||
(translation_unit)
|
||||
(function_definition)
|
||||
(compound_statement) ; a block in curly braces
|
||||
(struct_specifier)
|
||||
(for_statement)
|
||||
(if_statement)
|
||||
(while_statement)
|
||||
(translation_unit)
|
||||
(function_definition)
|
||||
(compound_statement) ; a block in curly braces
|
||||
(struct_specifier)
|
||||
] @local.scope
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue