mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-18 11:20:07 -04:00
feat!: drop modules, general refactor and cleanup
This commit is contained in:
parent
310f0925ec
commit
692b051b09
1247 changed files with 6096 additions and 9074 deletions
66
runtime/queries/cairo/locals.scm
Normal file
66
runtime/queries/cairo/locals.scm
Normal file
|
|
@ -0,0 +1,66 @@
|
|||
; References
|
||||
(identifier) @local.reference
|
||||
|
||||
((type_identifier) @local.reference
|
||||
(#set! reference.kind "type"))
|
||||
|
||||
((field_identifier) @local.reference
|
||||
(#set! reference.kind "field"))
|
||||
|
||||
; Scopes
|
||||
[
|
||||
(program)
|
||||
(block)
|
||||
(function_definition)
|
||||
(loop_expression)
|
||||
(if_expression)
|
||||
(match_expression)
|
||||
(match_arm)
|
||||
(struct_item)
|
||||
(enum_item)
|
||||
(impl_item)
|
||||
] @local.scope
|
||||
|
||||
(use_declaration
|
||||
argument: (scoped_identifier
|
||||
name: (identifier) @local.definition.import))
|
||||
|
||||
(use_as_clause
|
||||
alias: (identifier) @local.definition.import)
|
||||
|
||||
(use_list
|
||||
(identifier) @local.definition.import) ; use std::process::{Child, Command, Stdio};
|
||||
|
||||
; Functions
|
||||
(function_definition
|
||||
(identifier) @local.definition.function)
|
||||
|
||||
(function_definition
|
||||
(identifier) @local.definition.method
|
||||
(parameter
|
||||
(self)))
|
||||
|
||||
; Function with parameters, defines parameters
|
||||
(parameter
|
||||
[
|
||||
(identifier)
|
||||
(self)
|
||||
] @local.definition.parameter)
|
||||
|
||||
; Types
|
||||
(struct_item
|
||||
name: (type_identifier) @local.definition.type)
|
||||
|
||||
(constrained_type_parameter
|
||||
left: (type_identifier) @local.definition.type) ; the P in remove_file<P: AsRef<Path>>(path: P)
|
||||
|
||||
(enum_item
|
||||
name: (type_identifier) @local.definition.type)
|
||||
|
||||
; Module
|
||||
(mod_item
|
||||
name: (identifier) @local.definition.namespace)
|
||||
|
||||
; Variables
|
||||
(assignment_expression
|
||||
left: (identifier) @local.definition.var)
|
||||
Loading…
Add table
Add a link
Reference in a new issue