mirror of
https://github.com/helix-editor/helix
synced 2026-08-05 02:33:01 +02:00
With tree-house v0.4, locals now correctly have their own precedence and act independently. This removes the need to hack around the precedence of highlights versus locals as we were doing. So this change mainly updates captures which were highlights to be discards instead.
51 lines
1.2 KiB
Scheme
51 lines
1.2 KiB
Scheme
;; 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) @_)
|