mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-05 04:50:03 -04:00
feat(locals)!: switch to upstream captures
This commit is contained in:
parent
306367a7f4
commit
8fb218dbfd
95 changed files with 1154 additions and 1154 deletions
|
|
@ -1,88 +1,88 @@
|
|||
; Imports
|
||||
(extern_crate_declaration
|
||||
name: (identifier) @definition.import)
|
||||
name: (identifier) @local.definition.import)
|
||||
|
||||
(use_declaration
|
||||
argument: (scoped_identifier
|
||||
name: (identifier) @definition.import))
|
||||
name: (identifier) @local.definition.import))
|
||||
|
||||
(use_as_clause
|
||||
alias: (identifier) @definition.import)
|
||||
alias: (identifier) @local.definition.import)
|
||||
|
||||
(use_list
|
||||
(identifier) @definition.import) ; use std::process::{Child, Command, Stdio};
|
||||
(identifier) @local.definition.import) ; use std::process::{Child, Command, Stdio};
|
||||
|
||||
; Functions
|
||||
(function_item
|
||||
name: (identifier) @definition.function)
|
||||
name: (identifier) @local.definition.function)
|
||||
|
||||
(function_item
|
||||
name: (identifier) @definition.method
|
||||
name: (identifier) @local.definition.method
|
||||
parameters: (parameters
|
||||
(self_parameter)))
|
||||
|
||||
; Variables
|
||||
(parameter
|
||||
pattern: (identifier) @definition.var)
|
||||
pattern: (identifier) @local.definition.var)
|
||||
|
||||
(let_declaration
|
||||
pattern: (identifier) @definition.var)
|
||||
pattern: (identifier) @local.definition.var)
|
||||
|
||||
(const_item
|
||||
name: (identifier) @definition.var)
|
||||
name: (identifier) @local.definition.var)
|
||||
|
||||
(tuple_pattern
|
||||
(identifier) @definition.var)
|
||||
(identifier) @local.definition.var)
|
||||
|
||||
(let_condition
|
||||
pattern: (_
|
||||
(identifier) @definition.var))
|
||||
(identifier) @local.definition.var))
|
||||
|
||||
(tuple_struct_pattern
|
||||
(identifier) @definition.var)
|
||||
(identifier) @local.definition.var)
|
||||
|
||||
(closure_parameters
|
||||
(identifier) @definition.var)
|
||||
(identifier) @local.definition.var)
|
||||
|
||||
(self_parameter
|
||||
(self) @definition.var)
|
||||
(self) @local.definition.var)
|
||||
|
||||
(for_expression
|
||||
pattern: (identifier) @definition.var)
|
||||
pattern: (identifier) @local.definition.var)
|
||||
|
||||
; Types
|
||||
(struct_item
|
||||
name: (type_identifier) @definition.type)
|
||||
name: (type_identifier) @local.definition.type)
|
||||
|
||||
(constrained_type_parameter
|
||||
left: (type_identifier) @definition.type) ; the P in remove_file<P: AsRef<Path>>(path: P)
|
||||
left: (type_identifier) @local.definition.type) ; the P in remove_file<P: AsRef<Path>>(path: P)
|
||||
|
||||
(enum_item
|
||||
name: (type_identifier) @definition.type)
|
||||
name: (type_identifier) @local.definition.type)
|
||||
|
||||
|
||||
; Fields
|
||||
(field_declaration
|
||||
name: (field_identifier) @definition.field)
|
||||
name: (field_identifier) @local.definition.field)
|
||||
|
||||
(enum_variant
|
||||
name: (identifier) @definition.field)
|
||||
name: (identifier) @local.definition.field)
|
||||
|
||||
; References
|
||||
(identifier) @reference
|
||||
((type_identifier) @reference
|
||||
(identifier) @local.reference
|
||||
((type_identifier) @local.reference
|
||||
(#set! reference.kind "type"))
|
||||
((field_identifier) @reference
|
||||
((field_identifier) @local.reference
|
||||
(#set! reference.kind "field"))
|
||||
|
||||
|
||||
; Macros
|
||||
(macro_definition
|
||||
name: (identifier) @definition.macro)
|
||||
name: (identifier) @local.definition.macro)
|
||||
|
||||
; Module
|
||||
(mod_item
|
||||
name: (identifier) @definition.namespace)
|
||||
name: (identifier) @local.definition.namespace)
|
||||
|
||||
; Scopes
|
||||
[
|
||||
|
|
@ -99,5 +99,5 @@
|
|||
(struct_item)
|
||||
(enum_item)
|
||||
(impl_item)
|
||||
] @scope
|
||||
] @local.scope
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue