mirror of https://github.com/helix-editor/helix
queries: highlight more patterns in parameters
parent
6ddadd3fa7
commit
db15411f63
|
@ -206,11 +206,6 @@
|
|||
value: (identifier)? @variable
|
||||
field: (field_identifier) @variable.other.member))
|
||||
|
||||
(parameter
|
||||
pattern: (identifier) @variable.parameter)
|
||||
(closure_parameters
|
||||
(identifier) @variable.parameter)
|
||||
|
||||
; -------
|
||||
; Keywords
|
||||
; -------
|
||||
|
|
|
@ -15,9 +15,29 @@
|
|||
; Definitions
|
||||
|
||||
(parameter
|
||||
pattern: (identifier) @local.definition.variable.parameter)
|
||||
|
||||
(closure_parameters (identifier) @local.definition.variable.parameter)
|
||||
pattern: [
|
||||
; `foo` in `fn x(foo: !) {}`
|
||||
(identifier) @local.definition.variable.parameter @variable.parameter
|
||||
; `foo` and `bar` in `fn x((foo, bar): !) {}`
|
||||
(tuple_pattern (identifier)* (identifier) @local.definition.variable.parameter @variable.parameter)
|
||||
; `foo` and `bar` in `fn x(Struct { foo, bar }: !) {}`
|
||||
(struct_pattern
|
||||
(field_pattern)*
|
||||
(field_pattern
|
||||
name: (shorthand_field_identifier) @local.definition.variable.parameter @variable.parameter)
|
||||
)
|
||||
; `foo` and `bar` in `fn x(TupleStruct(foo, bar): !) {}`
|
||||
(tuple_struct_pattern
|
||||
type: _
|
||||
(identifier)*
|
||||
(identifier) @local.definition.variable.parameter @variable.parameter
|
||||
)
|
||||
; `foo` and `bar` in `fn x([foo, bar]: !) {}`
|
||||
(slice_pattern
|
||||
(identifier)*
|
||||
(identifier) @local.definition.variable.parameter @variable.parameter
|
||||
)
|
||||
])
|
||||
|
||||
; References
|
||||
(identifier) @local.reference
|
||||
|
|
Loading…
Reference in New Issue