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)
|
(template_function
|
||||||
|
name: (identifier) @local.definition) @local.scope
|
||||||
|
|
||||||
|
[
|
||||||
|
(foreach_statement)
|
||||||
|
(template_declaration)
|
||||||
|
(unmasked_statement)
|
||||||
|
] @local.scope
|
||||||
|
|
||||||
|
; Definitions
|
||||||
|
(reference_declarator
|
||||||
|
(identifier) @local.definition)
|
||||||
(type_parameter_declaration
|
(type_parameter_declaration
|
||||||
(type_identifier) @definition.type)
|
(type_identifier) @local.definition)
|
||||||
(template_declaration) @scope
|
|
||||||
|
|
||||||
(template_function
|
(foreach_statement
|
||||||
name: (identifier) @definition.function) @scope
|
range_start: (assignment_expression
|
||||||
|
left: (identifier) @local.definition))
|
||||||
|
(foreach_instance_statement
|
||||||
|
initializer: (identifier) @local.definition)
|
||||||
|
|
||||||
[
|
; References
|
||||||
(foreach_statement)
|
(type_identifier) @local.reference
|
||||||
(foreach_instance_statement)
|
|
||||||
(unmasked_statement)
|
|
||||||
] @scope
|
|
||||||
|
Loading…
Reference in New Issue