mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-11 16:00:02 -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
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