aboutsummaryrefslogtreecommitdiffstats
path: root/runtime/queries/cylc
diff options
context:
space:
mode:
authorChristian Clason <c.clason@uni-graz.at>2023-06-12 09:54:30 -0600
committerChristian Clason <c.clason@uni-graz.at>2025-05-12 18:43:40 +0200
commit692b051b09935653befdb8f7ba8afdb640adf17b (patch)
tree167162b6b129ae04f68c5735078521a72917c742 /runtime/queries/cylc
parentfeat(c-family): inherit injections (diff)
downloadnvim-treesitter-692b051b09935653befdb8f7ba8afdb640adf17b.tar
nvim-treesitter-692b051b09935653befdb8f7ba8afdb640adf17b.tar.gz
nvim-treesitter-692b051b09935653befdb8f7ba8afdb640adf17b.tar.bz2
nvim-treesitter-692b051b09935653befdb8f7ba8afdb640adf17b.tar.lz
nvim-treesitter-692b051b09935653befdb8f7ba8afdb640adf17b.tar.xz
nvim-treesitter-692b051b09935653befdb8f7ba8afdb640adf17b.tar.zst
nvim-treesitter-692b051b09935653befdb8f7ba8afdb640adf17b.zip
feat!: drop modules, general refactor and cleanup
Diffstat (limited to 'runtime/queries/cylc')
-rw-r--r--runtime/queries/cylc/folds.scm10
-rw-r--r--runtime/queries/cylc/highlights.scm72
-rw-r--r--runtime/queries/cylc/indents.scm16
-rw-r--r--runtime/queries/cylc/injections.scm11
4 files changed, 109 insertions, 0 deletions
diff --git a/runtime/queries/cylc/folds.scm b/runtime/queries/cylc/folds.scm
new file mode 100644
index 000000000..c8bd40703
--- /dev/null
+++ b/runtime/queries/cylc/folds.scm
@@ -0,0 +1,10 @@
+[
+ (multiline_string)
+ (multiline_graph_string)
+ (top_section)
+ (sub_section_1)
+ (sub_section_2)
+ (runtime_section)
+ (task_section)
+ (graph_section)
+] @fold
diff --git a/runtime/queries/cylc/highlights.scm b/runtime/queries/cylc/highlights.scm
new file mode 100644
index 000000000..a744caa52
--- /dev/null
+++ b/runtime/queries/cylc/highlights.scm
@@ -0,0 +1,72 @@
+(comment) @comment @spell
+
+(key) @property
+
+(boolean) @boolean
+
+(datetime) @string.special
+
+(task_name) @function
+
+(include_directive) @keyword.import
+
+[
+ (section_name)
+ (namespace)
+] @markup.heading
+
+[
+ (integer)
+ (recurrence)
+] @number
+
+[
+ "["
+ "]"
+ "[["
+ "]]"
+ "[[["
+ "]]]"
+ "<"
+ ">"
+ (graph_parenthesis)
+] @punctuation.bracket
+
+[
+ "\""
+ "\"\"\""
+ (unquoted_string)
+ (quoted_string)
+ (multiline_string)
+] @string
+
+[
+ (xtrigger_annotation)
+ (suicide_annotation)
+] @attribute
+
+[
+ "="
+ (assignment_operator)
+ (graph_logical)
+ (graph_arrow)
+] @operator
+
+(include_statement
+ path: (_)? @string.special.path)
+
+(task_parameter
+ name: (_)? @variable.parameter
+ selection: (_)? @variable.parameter)
+
+(task_output
+ ":" @tag
+ (nametag) @variable.builtin
+ "?"? @tag)
+
+[
+ (jinja2_expression)
+ (jinja2_statement)
+ (jinja2_comment)
+ (jinja2_shebang)
+] @keyword.directive
diff --git a/runtime/queries/cylc/indents.scm b/runtime/queries/cylc/indents.scm
new file mode 100644
index 000000000..0457e4580
--- /dev/null
+++ b/runtime/queries/cylc/indents.scm
@@ -0,0 +1,16 @@
+[
+ (top_section)
+ (sub_section_1)
+ (sub_section_2)
+ (graph_section)
+ (runtime_section)
+ (task_section)
+] @indent.begin
+
+(multiline_string
+ quotes_close: _ @indent.end) @indent.begin
+
+(multiline_graph_string
+ quotes_close: _ @indent.end) @indent.begin
+
+(line_continuation) @indent.zero
diff --git a/runtime/queries/cylc/injections.scm b/runtime/queries/cylc/injections.scm
new file mode 100644
index 000000000..41becd699
--- /dev/null
+++ b/runtime/queries/cylc/injections.scm
@@ -0,0 +1,11 @@
+((comment) @injection.content
+ (#set! injection.language "comment"))
+
+; https://cylc.github.io/cylc-doc/latest/html/user-guide/task-implementation/job-scripts.html#jobscripts
+((setting
+ key: (key) @_key
+ (#any-of? @_key
+ "script" "init-script" "env-script" "pre-script" "post-script" "err-script" "exit-script")
+ value: (_
+ (string_content) @injection.content))
+ (#set! injection.language "bash"))