aboutsummaryrefslogtreecommitdiffstats
path: root/runtime/queries/gn
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/gn
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/gn')
-rw-r--r--runtime/queries/gn/folds.scm6
-rw-r--r--runtime/queries/gn/highlights.scm78
-rw-r--r--runtime/queries/gn/indents.scm12
-rw-r--r--runtime/queries/gn/injections.scm2
-rw-r--r--runtime/queries/gn/locals.scm6
5 files changed, 104 insertions, 0 deletions
diff --git a/runtime/queries/gn/folds.scm b/runtime/queries/gn/folds.scm
new file mode 100644
index 000000000..352b0f0ec
--- /dev/null
+++ b/runtime/queries/gn/folds.scm
@@ -0,0 +1,6 @@
+[
+ (list)
+ (block)
+ (if_statement)
+ (else_statement)
+] @fold
diff --git a/runtime/queries/gn/highlights.scm b/runtime/queries/gn/highlights.scm
new file mode 100644
index 000000000..7bd97ff38
--- /dev/null
+++ b/runtime/queries/gn/highlights.scm
@@ -0,0 +1,78 @@
+; Includes
+"import" @keyword.import
+
+; Conditionals
+[
+ "if"
+ "else"
+] @keyword.conditional
+
+; Repeats
+"foreach" @keyword.repeat
+
+; Operators
+[
+ "="
+ "+="
+ "-="
+ "!"
+ "+"
+ "-"
+ "<"
+ "<="
+ ">"
+ ">="
+ "=="
+ "!="
+ "&&"
+ "||"
+] @operator
+
+; Variables
+(identifier) @variable
+
+; Functions
+(call_expression
+ function: (identifier) @function.call)
+
+; Fields
+(scope_access
+ field: (identifier) @variable.member)
+
+; Literals
+(string) @string
+
+(escape_sequence) @string.escape
+
+(expansion) @none
+
+(integer) @number
+
+(hex) @string.special
+
+(boolean) @boolean
+
+; Punctuation
+[
+ "{"
+ "}"
+ "["
+ "]"
+ "("
+ ")"
+] @punctuation.bracket
+
+[
+ "."
+ ","
+] @punctuation.delimiter
+
+(expansion
+ [
+ "$"
+ "${"
+ "}"
+ ] @punctuation.special)
+
+; Comments
+(comment) @comment
diff --git a/runtime/queries/gn/indents.scm b/runtime/queries/gn/indents.scm
new file mode 100644
index 000000000..82f44711d
--- /dev/null
+++ b/runtime/queries/gn/indents.scm
@@ -0,0 +1,12 @@
+[
+ (block)
+ (parenthesized_expression)
+] @indent.begin
+
+[
+ "}"
+ ")"
+ "]"
+] @indent.end @indent.branch
+
+(comment) @indent.auto
diff --git a/runtime/queries/gn/injections.scm b/runtime/queries/gn/injections.scm
new file mode 100644
index 000000000..2f0e58eb6
--- /dev/null
+++ b/runtime/queries/gn/injections.scm
@@ -0,0 +1,2 @@
+((comment) @injection.content
+ (#set! injection.language "comment"))
diff --git a/runtime/queries/gn/locals.scm b/runtime/queries/gn/locals.scm
new file mode 100644
index 000000000..eecb3426a
--- /dev/null
+++ b/runtime/queries/gn/locals.scm
@@ -0,0 +1,6 @@
+[
+ (source_file)
+ (block)
+] @local.scope
+
+(identifier) @local.reference