summaryrefslogtreecommitdiff
path: root/queries
diff options
context:
space:
mode:
authorOmer Tuchfeld <otuchfel@redhat.com>2021-12-16 22:40:06 +0100
committerStephan Seitz <stephan.seitz@fau.de>2021-12-18 20:02:08 +0100
commit3b05ef44927cc245d2c68873d0a526592d3f93cd (patch)
treed732680a54cedbb52b19c1f74a00d37657628d9a /queries
parent4f2b4238ee09f6497586c8cfb6c74d09a0a8b4fd (diff)
Add support for new golang `go.work` files
The new golang 1.18 version (currently in beta) [introduced](https://github.com/golang/go/issues/45713) a new file type called `go.work`. This commit adds support for the syntax of that file using the https://github.com/omertuc/tree-sitter-go-work repository That repository is heavily based on previous work in the https://github.com/camdencheek/tree-sitter-go-mod repository, with a few minor changes to make it work on the very similar `go.work` files.
Diffstat (limited to 'queries')
-rw-r--r--queries/gomod/injections.scm1
-rw-r--r--queries/gowork/highlights.scm14
-rw-r--r--queries/gowork/injections.scm1
3 files changed, 16 insertions, 0 deletions
diff --git a/queries/gomod/injections.scm b/queries/gomod/injections.scm
new file mode 100644
index 00000000..4bb7d675
--- /dev/null
+++ b/queries/gomod/injections.scm
@@ -0,0 +1 @@
+(comment) @comment
diff --git a/queries/gowork/highlights.scm b/queries/gowork/highlights.scm
new file mode 100644
index 00000000..9c84bcc4
--- /dev/null
+++ b/queries/gowork/highlights.scm
@@ -0,0 +1,14 @@
+[
+ "replace"
+ "go"
+ "use"
+] @keyword
+
+"=>" @operator
+
+(comment) @comment
+
+[
+(version)
+(go_version)
+] @string
diff --git a/queries/gowork/injections.scm b/queries/gowork/injections.scm
new file mode 100644
index 00000000..4bb7d675
--- /dev/null
+++ b/queries/gowork/injections.scm
@@ -0,0 +1 @@
+(comment) @comment