mirror of
https://github.com/helix-editor/helix
synced 2024-11-10 10:34:45 +01:00
feat: Add support for cylc configuration files (#11830)
Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
This commit is contained in:
parent
101a74bf6e
commit
38faf74feb
@ -29,6 +29,7 @@
|
||||
| crystal | ✓ | ✓ | | `crystalline` |
|
||||
| css | ✓ | | ✓ | `vscode-css-language-server` |
|
||||
| cue | ✓ | | | `cuelsp` |
|
||||
| cylc | ✓ | ✓ | ✓ | |
|
||||
| d | ✓ | ✓ | ✓ | `serve-d` |
|
||||
| dart | ✓ | ✓ | ✓ | `dart` |
|
||||
| dbml | ✓ | | | |
|
||||
|
@ -3845,7 +3845,18 @@ comment-tokens = ["#", "##"]
|
||||
indent = { tab-width = 2, unit = " " }
|
||||
language-servers = ["pylsp" ]
|
||||
|
||||
|
||||
[[grammar]]
|
||||
name = "snakemake"
|
||||
source = { git = "https://github.com/osthomas/tree-sitter-snakemake", rev = "e909815acdbe37e69440261ebb1091ed52e1dec6" }
|
||||
|
||||
[[language]]
|
||||
name = "cylc"
|
||||
scope = "source.cylc"
|
||||
injection-regex = "cylc"
|
||||
file-types = ["cylc", { glob = "suite.rc" }]
|
||||
comment-tokens = "#"
|
||||
indent = { tab-width = 4, unit = " " }
|
||||
|
||||
[[grammar]]
|
||||
name = "cylc"
|
||||
source = { git = "https://github.com/elliotfontaine/tree-sitter-cylc", rev = "30dd40d9bf23912e4aefa93eeb4c7090bda3d0f6" }
|
100
runtime/queries/cylc/highlights.scm
Normal file
100
runtime/queries/cylc/highlights.scm
Normal file
@ -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
|
19
runtime/queries/cylc/indents.scm
Normal file
19
runtime/queries/cylc/indents.scm
Normal file
@ -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
|
20
runtime/queries/cylc/injections.scm
Normal file
20
runtime/queries/cylc/injections.scm
Normal file
@ -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))
|
23
runtime/queries/cylc/textobjects.scm
Normal file
23
runtime/queries/cylc/textobjects.scm
Normal file
@ -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
Block a user