mirror of https://github.com/helix-editor/helix
feat: Add support for cylc configuration files (#11830)
Co-authored-by: Michael Davis <mcarsondavis@gmail.com>pull/11936/head^2
parent
101a74bf6e
commit
38faf74feb
@ -0,0 +1,100 @@
|
|||||||
|
(ERROR) @markup.bold
|
||||||
|
|
||||||
|
[
|
||||||
|
(jinja2_expression)
|
||||||
|
(jinja2_statement)
|
||||||
|
(jinja2_comment)
|
||||||
|
(jinja2_shebang)
|
||||||
|
] @special
|
||||||
|
|
||||||
|
(include_statement
|
||||||
|
directive: _ @keyword.directive
|
||||||
|
path: _ @string.special.path)
|
||||||
|
|
||||||
|
(comment) @comment.line
|
||||||
|
|
||||||
|
(graph_section
|
||||||
|
name: _? @label)
|
||||||
|
|
||||||
|
(task_section
|
||||||
|
name: (_
|
||||||
|
(task_name) @namespace))
|
||||||
|
|
||||||
|
(top_section
|
||||||
|
brackets_open: _ @punctuation.bracket
|
||||||
|
name: _? @label
|
||||||
|
brackets_close: _ @punctuation.bracket)
|
||||||
|
|
||||||
|
(sub_section_1
|
||||||
|
brackets_open: _ @punctuation.bracket
|
||||||
|
name: _? @label
|
||||||
|
brackets_close: _ @punctuation.bracket)
|
||||||
|
|
||||||
|
(sub_section_2
|
||||||
|
brackets_open: _ @punctuation.bracket
|
||||||
|
name: _? @label
|
||||||
|
brackets_close: _ @punctuation.bracket)
|
||||||
|
|
||||||
|
(runtime_section
|
||||||
|
brackets_open: _ @punctuation.bracket
|
||||||
|
name: _? @label
|
||||||
|
brackets_close: _ @punctuation.bracket)
|
||||||
|
|
||||||
|
(graph_setting
|
||||||
|
key: (_) @constant.numeric.integer
|
||||||
|
operator: (_)? @operator)
|
||||||
|
|
||||||
|
(quoted_graph_string
|
||||||
|
quotes_open: _ @string
|
||||||
|
quotes_close: _ @string)
|
||||||
|
|
||||||
|
(multiline_graph_string
|
||||||
|
quotes_open: _ @string
|
||||||
|
quotes_close: _ @string)
|
||||||
|
|
||||||
|
[
|
||||||
|
(graph_logical)
|
||||||
|
(graph_arrow)
|
||||||
|
(graph_parenthesis)
|
||||||
|
] @operator
|
||||||
|
|
||||||
|
(intercycle_annotation
|
||||||
|
(recurrence) @constant.numeric.integer)
|
||||||
|
|
||||||
|
(graph_task
|
||||||
|
xtrigger: _? @operator
|
||||||
|
suicide: _? @operator
|
||||||
|
name: _ @namespace)
|
||||||
|
|
||||||
|
(task_parameter
|
||||||
|
"<" @tag
|
||||||
|
name: (_)? @special
|
||||||
|
","? @tag
|
||||||
|
"="? @tag
|
||||||
|
selection: (_)? @special
|
||||||
|
">" @tag)
|
||||||
|
|
||||||
|
(intercycle_annotation
|
||||||
|
"[" @tag
|
||||||
|
(recurrence)? @constant.numeric.integer
|
||||||
|
"]" @tag)
|
||||||
|
|
||||||
|
(task_output
|
||||||
|
":" @tag
|
||||||
|
(nametag) @variable.other)
|
||||||
|
|
||||||
|
(task_output
|
||||||
|
"?"? @tag)
|
||||||
|
|
||||||
|
(setting
|
||||||
|
key: (key) @variable
|
||||||
|
operator: (_)? @operator
|
||||||
|
value: [
|
||||||
|
(unquoted_string) @string
|
||||||
|
(quoted_string) @string
|
||||||
|
(multiline_string) @string
|
||||||
|
(boolean) @constant.builtin.boolean
|
||||||
|
(integer) @constant.numeric.integer
|
||||||
|
]?)
|
||||||
|
|
||||||
|
(datetime) @constant.numeric.float
|
@ -0,0 +1,19 @@
|
|||||||
|
[
|
||||||
|
(top_section)
|
||||||
|
(sub_section_1)
|
||||||
|
(sub_section_2)
|
||||||
|
(graph_section)
|
||||||
|
(runtime_section)
|
||||||
|
(task_section)
|
||||||
|
] @indent
|
||||||
|
|
||||||
|
[
|
||||||
|
(top_section)
|
||||||
|
(sub_section_1)
|
||||||
|
(sub_section_2)
|
||||||
|
(graph_section)
|
||||||
|
(runtime_section)
|
||||||
|
(task_section)
|
||||||
|
] @extend
|
||||||
|
|
||||||
|
(line_continuation) @indent.always
|
@ -0,0 +1,20 @@
|
|||||||
|
((setting
|
||||||
|
key: (key) @key
|
||||||
|
(#match? @key "^script$|-script$|^script-")
|
||||||
|
value: (_
|
||||||
|
(string_content) @injection.content))
|
||||||
|
(#set! "injection.language" "bash"))
|
||||||
|
|
||||||
|
; Requires no spacing around "=" in environment settings for proper highlighting.
|
||||||
|
; Could be improved if Tree-sitter allowed to specify the target node of the injected
|
||||||
|
; language, instead of always using the root node.
|
||||||
|
; See this proposal:
|
||||||
|
; https://github.com/tree-sitter/tree-sitter/issues/3625
|
||||||
|
((task_section
|
||||||
|
(sub_section_2
|
||||||
|
name: (_) @section_name
|
||||||
|
(#eq? @section_name "environment")
|
||||||
|
(setting) @injection.content))
|
||||||
|
(#set! "injection.language" "bash")
|
||||||
|
(#set! injection.combined)
|
||||||
|
(#set! injection.include-children))
|
@ -0,0 +1,23 @@
|
|||||||
|
(comment) @comment.inside
|
||||||
|
|
||||||
|
(comment)+ @comment.around
|
||||||
|
|
||||||
|
(_
|
||||||
|
brackets_open: _
|
||||||
|
name: _?
|
||||||
|
brackets_close: _
|
||||||
|
_* @class.inside) @class.around
|
||||||
|
|
||||||
|
(setting
|
||||||
|
value: _? @function.inside) @function.around
|
||||||
|
|
||||||
|
(graph_setting
|
||||||
|
value: _? @function.inside) @function.around
|
||||||
|
|
||||||
|
(graph_string_content
|
||||||
|
(graph_task) @entry.inside)
|
||||||
|
|
||||||
|
(task_parameter
|
||||||
|
((_) @parameter.inside
|
||||||
|
.
|
||||||
|
","? @parameter.around) @parameter.around)
|
Loading…
Reference in New Issue