mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-17 19:00:02 -04:00
feat: add kos parser and queries (#8389)
This commit is contained in:
parent
300b906a95
commit
31fc7e10cd
7 changed files with 365 additions and 0 deletions
41
runtime/queries/kos/locals.scm
Normal file
41
runtime/queries/kos/locals.scm
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
; Scopes
|
||||
;-------
|
||||
(compound_statement) @local.scope
|
||||
|
||||
(for_statement) @local.scope
|
||||
|
||||
(function_decl) @local.scope
|
||||
|
||||
(constructor_literal) @local.scope
|
||||
|
||||
(function_literal) @local.scope
|
||||
|
||||
(with_statement) @local.scope
|
||||
|
||||
(catch_clause) @local.scope
|
||||
|
||||
; Definitions
|
||||
;------------
|
||||
(variable_decl
|
||||
variable: (identifier) @local.definition.var)
|
||||
|
||||
(parameter
|
||||
parameter: (identifier) @local.definition.parameter)
|
||||
|
||||
(import
|
||||
module: (identifier) @local.definition.import)
|
||||
|
||||
(import
|
||||
symbol: (identifier) @local.definition.import)
|
||||
|
||||
(function_decl
|
||||
name: (identifier) @local.definition.function
|
||||
(#set! definition.var.scope parent))
|
||||
|
||||
(class_decl
|
||||
name: (identifier) @local.definition.type
|
||||
(#set! definition.var.scope parent))
|
||||
|
||||
; References
|
||||
;------------
|
||||
(identifier) @local.reference
|
||||
Loading…
Add table
Add a link
Reference in a new issue