mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-01 19:17:02 -04:00
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.
This commit is contained in:
parent
4f2b4238ee
commit
3b05ef4492
7 changed files with 31 additions and 0 deletions
|
|
@ -186,6 +186,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] [gowork](https://github.com/omertuc/tree-sitter-go-work) (maintained by @omertuc)
|
||||
- [x] [graphql](https://github.com/bkegley/tree-sitter-graphql) (maintained by @bkegley)
|
||||
- [ ] [haskell](https://github.com/tree-sitter/tree-sitter-haskell)
|
||||
- [x] [hcl](https://github.com/MichaHoffmann/tree-sitter-hcl) (maintained by @MichaHoffmann)
|
||||
|
|
|
|||
1
ftdetect/gowork.vim
Normal file
1
ftdetect/gowork.vim
Normal file
|
|
@ -0,0 +1 @@
|
|||
au BufRead,BufNewFile go.work set filetype=gowork
|
||||
|
|
@ -89,6 +89,9 @@
|
|||
"gomod": {
|
||||
"revision": "3cbcb572109ea0bc476a292208722c326c9e6c3a"
|
||||
},
|
||||
"gowork": {
|
||||
"revision": "aafab008b4c855f20871cb978e41cf3b94466c70"
|
||||
},
|
||||
"graphql": {
|
||||
"revision": "5e66e961eee421786bdda8495ed1db045e06b5fe"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -184,6 +184,16 @@ list.gomod = {
|
|||
filetype = "gomod",
|
||||
}
|
||||
|
||||
list.gowork = {
|
||||
install_info = {
|
||||
url = "https://github.com/omertuc/tree-sitter-go-work",
|
||||
branch = "main",
|
||||
files = { "src/parser.c" },
|
||||
},
|
||||
maintainers = { "@omertuc" },
|
||||
filetype = "gowork",
|
||||
}
|
||||
|
||||
list.graphql = {
|
||||
install_info = {
|
||||
url = "https://github.com/bkegley/tree-sitter-graphql",
|
||||
|
|
|
|||
1
queries/gomod/injections.scm
Normal file
1
queries/gomod/injections.scm
Normal file
|
|
@ -0,0 +1 @@
|
|||
(comment) @comment
|
||||
14
queries/gowork/highlights.scm
Normal file
14
queries/gowork/highlights.scm
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
[
|
||||
"replace"
|
||||
"go"
|
||||
"use"
|
||||
] @keyword
|
||||
|
||||
"=>" @operator
|
||||
|
||||
(comment) @comment
|
||||
|
||||
[
|
||||
(version)
|
||||
(go_version)
|
||||
] @string
|
||||
1
queries/gowork/injections.scm
Normal file
1
queries/gowork/injections.scm
Normal file
|
|
@ -0,0 +1 @@
|
|||
(comment) @comment
|
||||
Loading…
Add table
Add a link
Reference in a new issue