mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-02 11:36:54 -04:00
40 lines
982 B
Scheme
40 lines
982 B
Scheme
;;; DECLARATIONS AND SCOPES
|
|
|
|
;; Variable and field declarations
|
|
((variable_declarator
|
|
(identifier) @definition.var))
|
|
|
|
((variable_declarator
|
|
(field_expression object:(*) @definition.associated (property_identifier) @definition.var)))
|
|
|
|
;; Parameters
|
|
(parameters (identifier) @definition.parameter)
|
|
|
|
;; Loops
|
|
((loop_expression
|
|
(identifier) @definition.var))
|
|
|
|
;; Function definitions
|
|
;; Functions definitions creates both a definition and a new scope
|
|
((function
|
|
(function_name
|
|
(function_name_field
|
|
(identifier) @definition.associated
|
|
(property_identifier) @definition.method))) @scope)
|
|
|
|
((function
|
|
(function_name (identifier) @definition.function)) @scope)
|
|
|
|
((local_function
|
|
(identifier) @definition.function) @scope)
|
|
(function_definition) @scope
|
|
|
|
(program) @scope
|
|
((if_statement) @scope)
|
|
((for_in_statement) @scope)
|
|
((repeat_statement) @scope)
|
|
((while_statement) @scope)
|
|
|
|
;;; REFERENCES
|
|
((identifier) @reference)
|
|
((property_identifier) @reference)
|