mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-16 18:30:06 -04:00
feat: add goctl parser and queries
This commit is contained in:
parent
ad43c7f19e
commit
f9aa4f060e
6 changed files with 105 additions and 0 deletions
|
|
@ -254,6 +254,7 @@ We are looking for maintainers to add more parsers and to write query files for
|
||||||
- [x] [GN (Generate Ninja)](https://github.com/amaanq/tree-sitter-gn) (maintained by @amaanq)
|
- [x] [GN (Generate Ninja)](https://github.com/amaanq/tree-sitter-gn) (maintained by @amaanq)
|
||||||
- [x] [gnuplot](https://github.com/dpezto/tree-sitter-gnuplot) (maintained by @dpezto)
|
- [x] [gnuplot](https://github.com/dpezto/tree-sitter-gnuplot) (maintained by @dpezto)
|
||||||
- [x] [go](https://github.com/tree-sitter/tree-sitter-go) (maintained by @theHamsta, @WinWisely268)
|
- [x] [go](https://github.com/tree-sitter/tree-sitter-go) (maintained by @theHamsta, @WinWisely268)
|
||||||
|
- [x] [goctl](https://github.com/chaozwn/tree-sitter-goctl) (maintained by @chaozwn)
|
||||||
- [x] [Godot Resources (gdresource)](https://github.com/PrestonKnopp/tree-sitter-godot-resource) (maintained by @pierpo)
|
- [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] [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] [gosum](https://github.com/amaanq/tree-sitter-go-sum) (maintained by @amaanq)
|
||||||
|
|
|
||||||
|
|
@ -242,6 +242,9 @@
|
||||||
"go": {
|
"go": {
|
||||||
"revision": "7ee8d928db5202f6831a78f8112fd693bf69f98b"
|
"revision": "7ee8d928db5202f6831a78f8112fd693bf69f98b"
|
||||||
},
|
},
|
||||||
|
"goctl": {
|
||||||
|
"revision": "f107937259c7ec4bb05f7e3d2c24b89ac36d4cc3"
|
||||||
|
},
|
||||||
"godot_resource": {
|
"godot_resource": {
|
||||||
"revision": "2ffb90de47417018651fc3b970e5f6b67214dc9d"
|
"revision": "2ffb90de47417018651fc3b970e5f6b67214dc9d"
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -757,6 +757,14 @@ list.go = {
|
||||||
maintainers = { "@theHamsta", "@WinWisely268" },
|
maintainers = { "@theHamsta", "@WinWisely268" },
|
||||||
}
|
}
|
||||||
|
|
||||||
|
list.goctl = {
|
||||||
|
install_info = {
|
||||||
|
url = "https://github.com/chaozwn/tree-sitter-goctl.git",
|
||||||
|
files = { "src/parser.c" },
|
||||||
|
},
|
||||||
|
maintainers = { "@chaozwn" },
|
||||||
|
}
|
||||||
|
|
||||||
list.godot_resource = {
|
list.godot_resource = {
|
||||||
install_info = {
|
install_info = {
|
||||||
url = "https://github.com/PrestonKnopp/tree-sitter-godot-resource",
|
url = "https://github.com/PrestonKnopp/tree-sitter-godot-resource",
|
||||||
|
|
|
||||||
11
queries/goctl/folds.scm
Normal file
11
queries/goctl/folds.scm
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
[
|
||||||
|
(typeGroupSpec)
|
||||||
|
(typeSingleSpec)
|
||||||
|
(typeStruct)
|
||||||
|
(serviceSpec)
|
||||||
|
(serviceBody)
|
||||||
|
(importStatement)
|
||||||
|
(serviceServerSpec)
|
||||||
|
(infoStatement)
|
||||||
|
(structType)
|
||||||
|
] @fold
|
||||||
79
queries/goctl/highlights.scm
Normal file
79
queries/goctl/highlights.scm
Normal file
|
|
@ -0,0 +1,79 @@
|
||||||
|
; Key Symbol
|
||||||
|
"=" @operator
|
||||||
|
|
||||||
|
[
|
||||||
|
"."
|
||||||
|
","
|
||||||
|
":"
|
||||||
|
";"
|
||||||
|
] @punctuation.delimiter
|
||||||
|
|
||||||
|
[
|
||||||
|
"("
|
||||||
|
")"
|
||||||
|
"{"
|
||||||
|
"}"
|
||||||
|
"["
|
||||||
|
"]"
|
||||||
|
] @punctuation.bracket
|
||||||
|
|
||||||
|
; Keywords
|
||||||
|
[
|
||||||
|
"syntax"
|
||||||
|
"info"
|
||||||
|
"service"
|
||||||
|
] @keyword
|
||||||
|
|
||||||
|
"import" @keyword.import
|
||||||
|
|
||||||
|
"returns" @keyword.return
|
||||||
|
|
||||||
|
[
|
||||||
|
"type"
|
||||||
|
"struct"
|
||||||
|
] @keyword.type
|
||||||
|
|
||||||
|
[
|
||||||
|
"@doc"
|
||||||
|
"@handler"
|
||||||
|
"@server"
|
||||||
|
] @attribute
|
||||||
|
|
||||||
|
; Service
|
||||||
|
(serviceName) @type
|
||||||
|
|
||||||
|
; Httpmethod
|
||||||
|
(HTTPMETHOD) @keyword.operator
|
||||||
|
|
||||||
|
; Field
|
||||||
|
(fieldType) @type.builtin
|
||||||
|
|
||||||
|
(fieldName) @variable.member
|
||||||
|
|
||||||
|
(anonymousField) @variable.member
|
||||||
|
|
||||||
|
; Functions
|
||||||
|
(handlerValue) @function.method
|
||||||
|
|
||||||
|
; Strings
|
||||||
|
(VALUE) @string
|
||||||
|
|
||||||
|
(tag) @string.documentation
|
||||||
|
|
||||||
|
(PATH) @string.special.path
|
||||||
|
|
||||||
|
; Comments
|
||||||
|
(comment) @comment @spell
|
||||||
|
|
||||||
|
(key) @variable.member
|
||||||
|
|
||||||
|
(identValue) @string
|
||||||
|
|
||||||
|
(DURATION) @number
|
||||||
|
|
||||||
|
(NUMBER) @number
|
||||||
|
|
||||||
|
; Struct
|
||||||
|
(structNameId) @type
|
||||||
|
|
||||||
|
(body) @type
|
||||||
3
queries/goctl/injections.scm
Normal file
3
queries/goctl/injections.scm
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
; Inject comment language for goctl
|
||||||
|
((comment) @injection.content
|
||||||
|
(#set! injection.language "comment"))
|
||||||
Loading…
Add table
Add a link
Reference in a new issue