mirror of https://github.com/helix-editor/helix
syntax: Add go & rust locals, improve tree-sitter error message
parent
2bef245b7a
commit
4ac29434cb
@ -0,0 +1,30 @@
|
|||||||
|
; Scopes
|
||||||
|
|
||||||
|
(block) @local.scope
|
||||||
|
|
||||||
|
; Definitions
|
||||||
|
|
||||||
|
(parameter_declaration (identifier) @local.definition)
|
||||||
|
(variadic_parameter_declaration (identifier) @local.definition)
|
||||||
|
|
||||||
|
(short_var_declaration
|
||||||
|
left: (expression_list
|
||||||
|
(identifier) @local.definition))
|
||||||
|
|
||||||
|
(var_spec
|
||||||
|
name: (identifier) @local.definition)
|
||||||
|
|
||||||
|
(for_statement
|
||||||
|
(range_clause
|
||||||
|
left: (expression_list
|
||||||
|
(identifier) @local.definition)))
|
||||||
|
|
||||||
|
(const_declaration
|
||||||
|
(const_spec
|
||||||
|
name: (identifier) @local.definition))
|
||||||
|
|
||||||
|
; References
|
||||||
|
|
||||||
|
(identifier) @local.reference
|
||||||
|
(field_identifier) @local.reference
|
||||||
|
|
@ -0,0 +1,17 @@
|
|||||||
|
; Scopes
|
||||||
|
|
||||||
|
(block) @local.scope
|
||||||
|
|
||||||
|
; Definitions
|
||||||
|
|
||||||
|
(parameter
|
||||||
|
(identifier) @local.definition)
|
||||||
|
|
||||||
|
(let_declaration
|
||||||
|
pattern: (identifier) @local.definition)
|
||||||
|
|
||||||
|
(closure_parameters (identifier)) @local.definition
|
||||||
|
|
||||||
|
; References
|
||||||
|
(identifier) @local.reference
|
||||||
|
|
Loading…
Reference in New Issue