mirror of
https://github.com/l0ng-ai/openidea.git
synced 2026-11-06 16:08:05 +00:00
28 lines
727 B
Scheme
28 lines
727 B
Scheme
; Adapted from nvim-treesitter queries/bash/locals.scm (Apache-2.0). Plain
|
|
; assignments and loop variables are global in Bash, so only `local` /
|
|
; `declare` / `typeset` / `readonly` inside a function declare a local.
|
|
|
|
; Scopes
|
|
(function_definition) @local.scope
|
|
|
|
; Definitions
|
|
(function_definition
|
|
(compound_statement
|
|
(declaration_command
|
|
(variable_assignment
|
|
name: (variable_name) @local.definition.var))))
|
|
|
|
(function_definition
|
|
(compound_statement
|
|
(declaration_command
|
|
(variable_name) @local.definition.var)))
|
|
|
|
(function_definition
|
|
name: (word) @local.definition.function
|
|
(#set! definition.function.scope "parent"))
|
|
|
|
; References
|
|
(variable_name) @local.reference
|
|
|
|
(word) @local.reference
|