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
|
- `variable` - Variables
|
||||||
- `builtin` - Reserved language variables (`self`, `this`, `super`, etc.)
|
- `builtin` - Reserved language variables (`self`, `this`, `super`, etc.)
|
||||||
- `parameter` - Function parameters
|
- `parameter` - Function parameters
|
||||||
|
- `mutable` - Mutable variables (e.g. marked with `mut` in Rust)
|
||||||
- `other`
|
- `other`
|
||||||
- `member` - Fields of composite data types (e.g. structs, unions)
|
- `member` - Fields of composite data types (e.g. structs, unions)
|
||||||
- `private` - Private fields that use a unique syntax (currently just ECMAScript-based languages)
|
- `private` - Private fields that use a unique syntax (currently just ECMAScript-based languages)
|
||||||
|
|
|
@ -289,8 +289,6 @@
|
||||||
"dyn"
|
"dyn"
|
||||||
] @keyword.storage.modifier
|
] @keyword.storage.modifier
|
||||||
|
|
||||||
; TODO: variable.mut to highlight mutable identifiers via locals.scm
|
|
||||||
|
|
||||||
; ---
|
; ---
|
||||||
; Remaining Paths
|
; Remaining Paths
|
||||||
; ---
|
; ---
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
(block)
|
(block)
|
||||||
] @local.scope
|
] @local.scope
|
||||||
|
|
||||||
; Definitions
|
; Parameters
|
||||||
|
|
||||||
(parameter
|
(parameter
|
||||||
pattern: [
|
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
|
; References
|
||||||
(identifier) @local.reference
|
(identifier) @local.reference
|
||||||
|
|
Loading…
Reference in New Issue