From 98a52ce300d2f8ba3bf7838e08396d829aaef078 Mon Sep 17 00:00:00 2001 From: Amaan Qureshi Date: Fri, 3 Feb 2023 10:14:13 -0500 Subject: feat: add gosum --- README.md | 1 + lockfile.json | 3 +++ lua/nvim-treesitter/parsers.lua | 9 +++++++++ queries/gosum/highlights.scm | 33 +++++++++++++++++++++++++++++++++ 4 files changed, 46 insertions(+) create mode 100644 queries/gosum/highlights.scm diff --git a/README.md b/README.md index 14312e53a..a4c39ba53 100644 --- a/README.md +++ b/README.md @@ -224,6 +224,7 @@ We are looking for maintainers to add more parsers and to write query files for - [x] [go](https://github.com/tree-sitter/tree-sitter-go) (maintained by @theHamsta, @WinWisely268) - [x] [Godot Resources (gdresource)](https://github.com/PrestonKnopp/tree-sitter-godot-resource) (maintained by @pierpo) - [x] [gomod](https://github.com/camdencheek/tree-sitter-go-mod) (maintained by @camdencheek) +- [x] [gosum](https://github.com/amaanq/tree-sitter-go-sum) (maintained by @amaanq) - [x] [gowork](https://github.com/omertuc/tree-sitter-go-work) (maintained by @omertuc) - [x] [graphql](https://github.com/bkegley/tree-sitter-graphql) (maintained by @bkegley) - [ ] [hack](https://github.com/slackhq/tree-sitter-hack) diff --git a/lockfile.json b/lockfile.json index f30f58862..8a533d83b 100644 --- a/lockfile.json +++ b/lockfile.json @@ -155,6 +155,9 @@ "gomod": { "revision": "4a65743dbc2bb3094114dd2b43da03c820aa5234" }, + "gosum": { + "revision": "68974b63c19dc6e27214a5c76b6e26c0c40fe5b7" + }, "gowork": { "revision": "949a8a470559543857a62102c84700d291fc984c" }, diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua index f5eab6a58..fdae248d8 100644 --- a/lua/nvim-treesitter/parsers.lua +++ b/lua/nvim-treesitter/parsers.lua @@ -534,6 +534,15 @@ list.gomod = { filetype = "gomod", } +list.gosum = { + install_info = { + url = "https://github.com/amaanq/tree-sitter-go-sum", + files = { "src/parser.c" }, + }, + maintainers = { "@amaanq" }, + filetype = "gosum", +} + list.gowork = { install_info = { url = "https://github.com/omertuc/tree-sitter-go-work", diff --git a/queries/gosum/highlights.scm b/queries/gosum/highlights.scm new file mode 100644 index 000000000..d19dde45a --- /dev/null +++ b/queries/gosum/highlights.scm @@ -0,0 +1,33 @@ +[ + "alpha" + "beta" + "dev" + "pre" + "rc" + "+incompatible" +] @keyword + +[ + (module_path) + (hash) +] @string + +(base_version) @string.special + +(hash_version) @symbol + +[ + (number) + (number_with_decimal) + (hex_number) +] @number + +(checksum + "go.mod" @string) + +[ + ":" + "." + "-" + "/" +] @punctuation.delimiter -- cgit v1.2.3-70-g09d2