aboutsummaryrefslogtreecommitdiffstats
path: root/runtime/queries/meson
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/meson
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/meson')
-rw-r--r--runtime/queries/meson/folds.scm9
-rw-r--r--runtime/queries/meson/highlights.scm77
-rw-r--r--runtime/queries/meson/indents.scm25
-rw-r--r--runtime/queries/meson/injections.scm2
4 files changed, 113 insertions, 0 deletions
diff --git a/runtime/queries/meson/folds.scm b/runtime/queries/meson/folds.scm
new file mode 100644
index 000000000..386d4d306
--- /dev/null
+++ b/runtime/queries/meson/folds.scm
@@ -0,0 +1,9 @@
+[
+ (normal_command)
+ (if_condition)
+ (if_command)
+ (else_command)
+ (elseif_command)
+ (foreach_command)
+ (list)
+] @fold
diff --git a/runtime/queries/meson/highlights.scm b/runtime/queries/meson/highlights.scm
new file mode 100644
index 000000000..b00c3399b
--- /dev/null
+++ b/runtime/queries/meson/highlights.scm
@@ -0,0 +1,77 @@
+(comment) @comment @spell
+
+(number) @number
+
+(bool) @boolean
+
+(identifier) @variable
+
+[
+ "("
+ ")"
+ "{"
+ "}"
+ "["
+ "]"
+] @punctuation.bracket
+
+[
+ ":"
+ ","
+ "."
+] @punctuation.delimiter
+
+[
+ "and"
+ "not"
+ "or"
+ "in"
+] @keyword.operator
+
+[
+ "="
+ "=="
+ "!="
+ "+"
+ "/"
+ "/="
+ "+="
+ "-="
+ ">"
+ ">="
+] @operator
+
+(ternaryoperator
+ [
+ "?"
+ ":"
+ ] @keyword.conditional.ternary)
+
+[
+ "if"
+ "elif"
+ "else"
+ "endif"
+] @keyword.conditional
+
+[
+ "foreach"
+ "endforeach"
+ (keyword_break)
+ (keyword_continue)
+] @keyword.repeat
+
+(string) @string
+
+"@" @punctuation.special
+
+(normal_command
+ command: (identifier) @function)
+
+(pair
+ key: (identifier) @property)
+
+(escape_sequence) @string.escape
+
+((identifier) @variable.builtin
+ (#any-of? @variable.builtin "meson" "host_machine" "build_machine" "target_machine"))
diff --git a/runtime/queries/meson/indents.scm b/runtime/queries/meson/indents.scm
new file mode 100644
index 000000000..3e27d9200
--- /dev/null
+++ b/runtime/queries/meson/indents.scm
@@ -0,0 +1,25 @@
+[
+ (list)
+ (dictionaries)
+ (normal_command)
+ (if_condition)
+ (foreach_command)
+ (ternaryoperator)
+ (ERROR
+ "?") ; support partial ternary
+] @indent.begin
+
+[
+ ")"
+ "]"
+ "}"
+ (elseif_command)
+ (else_command)
+ "endif"
+ "endforeach"
+] @indent.branch @indent.end
+
+(expression_statement
+ object: (_)) @indent.begin
+
+(comment) @indent.auto
diff --git a/runtime/queries/meson/injections.scm b/runtime/queries/meson/injections.scm
new file mode 100644
index 000000000..2f0e58eb6
--- /dev/null
+++ b/runtime/queries/meson/injections.scm
@@ -0,0 +1,2 @@
+((comment) @injection.content
+ (#set! injection.language "comment"))