mirror of https://github.com/helix-editor/helix
ispc: Improve custom highlight, indent and local scopes
parent
b352f180ab
commit
d8141a3df0
@ -1,7 +1,11 @@
|
|||||||
; inherits: c
|
; inherits: c
|
||||||
|
|
||||||
((foreach_statement body: (_) @_body) @indent.begin
|
(foreach_statement
|
||||||
(#not-has-type? @_body compound_statement))
|
body: (_) @indent
|
||||||
|
(#not-kind-eq? @indent "compound_statement")
|
||||||
|
(#set! "scope" "all"))
|
||||||
|
|
||||||
((foreach_instance_statement body: (_) @_body) @indent.begin
|
(foreach_instance_statement
|
||||||
(#not-has-type? @_body compound_statement))
|
body: (_) @indent
|
||||||
|
(#not-kind-eq? @indent "compound_statement")
|
||||||
|
(#set! "scope" "all"))
|
||||||
|
@ -1,17 +1,26 @@
|
|||||||
; inherits: c
|
; inherits: c
|
||||||
|
|
||||||
(reference_declarator
|
; Scopes
|
||||||
(identifier) @definition.var)
|
|
||||||
|
|
||||||
(type_parameter_declaration
|
|
||||||
(type_identifier) @definition.type)
|
|
||||||
(template_declaration) @scope
|
|
||||||
|
|
||||||
(template_function
|
(template_function
|
||||||
name: (identifier) @definition.function) @scope
|
name: (identifier) @local.definition) @local.scope
|
||||||
|
|
||||||
[
|
[
|
||||||
(foreach_statement)
|
(foreach_statement)
|
||||||
(foreach_instance_statement)
|
(template_declaration)
|
||||||
(unmasked_statement)
|
(unmasked_statement)
|
||||||
] @scope
|
] @local.scope
|
||||||
|
|
||||||
|
; Definitions
|
||||||
|
(reference_declarator
|
||||||
|
(identifier) @local.definition)
|
||||||
|
(type_parameter_declaration
|
||||||
|
(type_identifier) @local.definition)
|
||||||
|
|
||||||
|
(foreach_statement
|
||||||
|
range_start: (assignment_expression
|
||||||
|
left: (identifier) @local.definition))
|
||||||
|
(foreach_instance_statement
|
||||||
|
initializer: (identifier) @local.definition)
|
||||||
|
|
||||||
|
; References
|
||||||
|
(type_identifier) @local.reference
|
||||||
|
Loading…
Reference in New Issue