aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCamden Cheek <camden@ccheek.com>2021-04-27 15:17:42 -0600
committerThomas Vigouroux <tomvig38@gmail.com>2021-04-28 17:37:33 +0200
commit07fc8cc20e2140d90146f9dcf9c3c776bf1c1e99 (patch)
tree9fb36f5d4d1f15e6962fa513a782f1c7a2fc80ba
parentlocals(js,ts): Add parameters again (#1231) (diff)
downloadnvim-treesitter-07fc8cc20e2140d90146f9dcf9c3c776bf1c1e99.tar
nvim-treesitter-07fc8cc20e2140d90146f9dcf9c3c776bf1c1e99.tar.gz
nvim-treesitter-07fc8cc20e2140d90146f9dcf9c3c776bf1c1e99.tar.bz2
nvim-treesitter-07fc8cc20e2140d90146f9dcf9c3c776bf1c1e99.tar.lz
nvim-treesitter-07fc8cc20e2140d90146f9dcf9c3c776bf1c1e99.tar.xz
nvim-treesitter-07fc8cc20e2140d90146f9dcf9c3c776bf1c1e99.tar.zst
nvim-treesitter-07fc8cc20e2140d90146f9dcf9c3c776bf1c1e99.zip
Add go-mod tree-sitter config
Adds a tree-sitter config for go.mod files as well as highlighting queries.
-rw-r--r--lua/nvim-treesitter/parsers.lua10
-rw-r--r--queries/gomod/highlights.scm17
2 files changed, 27 insertions, 0 deletions
diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua
index 833e5a918..5b4ece1b9 100644
--- a/lua/nvim-treesitter/parsers.lua
+++ b/lua/nvim-treesitter/parsers.lua
@@ -104,6 +104,16 @@ list.go = {
maintainers = {"@theHamsta", "@WinWisely268"},
}
+list.gomod = {
+ install_info = {
+ url = "https://github.com/camdencheek/tree-sitter-go-mod",
+ branch = "main",
+ files = { "src/parser.c" },
+ },
+ maintainers = {"@camdencheek"},
+ filetype = "gomod",
+}
+
list.graphql = {
install_info = {
url = "https://github.com/bkegley/tree-sitter-graphql",
diff --git a/queries/gomod/highlights.scm b/queries/gomod/highlights.scm
new file mode 100644
index 000000000..63e1f0128
--- /dev/null
+++ b/queries/gomod/highlights.scm
@@ -0,0 +1,17 @@
+[
+ "require"
+ "replace"
+ "go"
+ "exclude"
+ "retract"
+ "module"
+] @keyword
+
+"=>" @operator
+
+(comment) @comment
+
+[
+(version)
+(go_version)
+] @string