feat(highlight): migrate to tree-house with Helix queries
Replace tree-sitter-highlight dep with tree-house crate from Helix editor. Add ropey dependency required by tree-house. Reorganize query files from Helix's runtime/queries/ for all 14 supported languages: - bash, c, css, go, html, javascript, json, markdown, nix, python, rust, toml, typescript, yaml - Include ecma, _javascript, _typescript base dirs for JS/TS inheritance - Copy highlights.scm, injections.scm, locals.scm where available This commit establishes the foundation; highlight.rs implementation will follow in subsequent commits.
This commit is contained in:
50
queries/python/locals.scm
Normal file
50
queries/python/locals.scm
Normal file
@@ -0,0 +1,50 @@
|
||||
;; Scopes
|
||||
|
||||
[
|
||||
(module)
|
||||
(function_definition)
|
||||
(lambda)
|
||||
] @local.scope
|
||||
|
||||
;; Definitions
|
||||
|
||||
; Parameters
|
||||
(parameters
|
||||
(identifier) @local.definition.variable.parameter)
|
||||
(parameters
|
||||
(typed_parameter
|
||||
(identifier) @local.definition.variable.parameter))
|
||||
(parameters
|
||||
(default_parameter
|
||||
name: (identifier) @local.definition.variable.parameter))
|
||||
(parameters
|
||||
(typed_default_parameter
|
||||
name: (identifier) @local.definition.variable.parameter))
|
||||
(parameters
|
||||
(list_splat_pattern ; *args
|
||||
(identifier) @local.definition.variable.parameter))
|
||||
(parameters
|
||||
(dictionary_splat_pattern ; **kwargs
|
||||
(identifier) @local.definition.variable.parameter))
|
||||
(parameters
|
||||
(identifier) @local.definition.variable.builtin
|
||||
(#any-of? @local.definition.variable.builtin "self" "cls")) ; label self/cls as builtin
|
||||
|
||||
(lambda_parameters
|
||||
(identifier) @local.definition.variable.parameter)
|
||||
|
||||
; Imports
|
||||
(import_statement
|
||||
name: (dotted_name
|
||||
(identifier) @local.definition.namespace))
|
||||
|
||||
(aliased_import
|
||||
alias: (identifier) @local.definition.namespace)
|
||||
|
||||
;; References
|
||||
|
||||
(identifier) @local.reference
|
||||
|
||||
; don't make the name of kwargs locals
|
||||
(keyword_argument
|
||||
name: (identifier) @variable.parameter)
|
||||
Reference in New Issue
Block a user