mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-12 16:30:02 -04:00
Merge pull request #62 from theHamsta/c-locals
Some improvements to c/locals.scm
This commit is contained in:
commit
d1da10ce1c
1 changed files with 9 additions and 7 deletions
|
|
@ -1,25 +1,25 @@
|
||||||
;; Functions definitions
|
;; Functions definitions
|
||||||
(function_declarator
|
(function_declarator
|
||||||
declarator: (identifier) @definition.function) @scope
|
declarator: (identifier) @definition.function)
|
||||||
(preproc_function_def
|
(preproc_function_def
|
||||||
name: (identifier) @definition.macro) @scope
|
name: (identifier) @definition.macro) @scope
|
||||||
|
|
||||||
(preproc_def
|
(preproc_def
|
||||||
name: (identifier) @definition.macro)
|
name: (identifier) @definition.macro)
|
||||||
(pointer_declarator
|
(pointer_declarator
|
||||||
declarator: (identifier) @definition.variable)
|
declarator: (identifier) @definition.var)
|
||||||
(parameter_declaration
|
(parameter_declaration
|
||||||
declarator: (identifier) @definition.variable)
|
declarator: (identifier) @definition.var)
|
||||||
(init_declarator
|
(init_declarator
|
||||||
declarator: (identifier) @definition.variable)
|
declarator: (identifier) @definition.var)
|
||||||
(array_declarator
|
(array_declarator
|
||||||
declarator: (identifier) @definition.variable)
|
declarator: (identifier) @definition.var)
|
||||||
(declaration
|
(declaration
|
||||||
declarator: (identifier) @definition.variable)
|
declarator: (identifier) @definition.var)
|
||||||
(enum_specifier
|
(enum_specifier
|
||||||
name: (*) @definition.type
|
name: (*) @definition.type
|
||||||
(enumerator_list
|
(enumerator_list
|
||||||
(enumerator name: (identifier) @definition.variable)))
|
(enumerator name: (identifier) @definition.var)))
|
||||||
|
|
||||||
;; Type / Struct / Enum
|
;; Type / Struct / Enum
|
||||||
(field_declaration
|
(field_declaration
|
||||||
|
|
@ -34,3 +34,5 @@
|
||||||
(for_statement) @scope
|
(for_statement) @scope
|
||||||
(if_statement) @scope
|
(if_statement) @scope
|
||||||
(while_statement) @scope
|
(while_statement) @scope
|
||||||
|
(translation_unit) @scope
|
||||||
|
(function_definition) @scope
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue