mirror of https://github.com/helix-editor/helix
queries: Highlight mutable variables in Rust
parent
e610e7dd80
commit
a2f219968a
|
@ -179,6 +179,7 @@ We use a similar set of scopes as
|
|||
- `variable` - Variables
|
||||
- `builtin` - Reserved language variables (`self`, `this`, `super`, etc.)
|
||||
- `parameter` - Function parameters
|
||||
- `mutable` - Mutable variables (e.g. marked with `mut` in Rust)
|
||||
- `other`
|
||||
- `member` - Fields of composite data types (e.g. structs, unions)
|
||||
- `private` - Private fields that use a unique syntax (currently just ECMAScript-based languages)
|
||||
|
|
|
@ -289,8 +289,6 @@
|
|||
"dyn"
|
||||
] @keyword.storage.modifier
|
||||
|
||||
; TODO: variable.mut to highlight mutable identifiers via locals.scm
|
||||
|
||||
; ---
|
||||
; Remaining Paths
|
||||
; ---
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
(block)
|
||||
] @local.scope
|
||||
|
||||
; Definitions
|
||||
; Parameters
|
||||
|
||||
(parameter
|
||||
pattern: [
|
||||
|
@ -39,5 +39,19 @@
|
|||
)
|
||||
])
|
||||
|
||||
; Mutable variables
|
||||
|
||||
[
|
||||
(let_declaration
|
||||
(mutable_specifier)
|
||||
pattern: (identifier) @local.definition.variable.mutable @variable.mutable)
|
||||
(parameter
|
||||
(mutable_specifier)
|
||||
pattern: (identifier) @local.definition.variable.mutable @variable.mutable)
|
||||
(mut_pattern
|
||||
(mutable_specifier)
|
||||
(identifier) @local.definition.variable.mutable @variable.mutable)
|
||||
]
|
||||
|
||||
; References
|
||||
(identifier) @local.reference
|
||||
|
|
Loading…
Reference in New Issue