mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-14 09:20:04 -04:00
highlights(go): modernize highlights.scm
This commit is contained in:
parent
33fb1e3a42
commit
2e073285dc
1 changed files with 106 additions and 67 deletions
|
|
@ -40,89 +40,128 @@
|
||||||
|
|
||||||
; Operators
|
; Operators
|
||||||
|
|
||||||
"--" @operator
|
[
|
||||||
"-" @operator
|
"--"
|
||||||
"-=" @operator
|
"-"
|
||||||
":=" @operator
|
"-="
|
||||||
"!" @operator
|
":="
|
||||||
"!=" @operator
|
"!"
|
||||||
"..." @operator
|
"!="
|
||||||
"*" @operator
|
"..."
|
||||||
"*" @operator
|
"*"
|
||||||
"*=" @operator
|
"*"
|
||||||
"/" @operator
|
"*="
|
||||||
"/=" @operator
|
"/"
|
||||||
"&" @operator
|
"/="
|
||||||
"&&" @operator
|
"&"
|
||||||
"&=" @operator
|
"&&"
|
||||||
"%" @operator
|
"&="
|
||||||
"%=" @operator
|
"%"
|
||||||
"^" @operator
|
"%="
|
||||||
"^=" @operator
|
"^"
|
||||||
"+" @operator
|
"^="
|
||||||
"++" @operator
|
"+"
|
||||||
"+=" @operator
|
"++"
|
||||||
"<-" @operator
|
"+="
|
||||||
"<" @operator
|
"<-"
|
||||||
"<<" @operator
|
"<"
|
||||||
"<<=" @operator
|
"<<"
|
||||||
"<=" @operator
|
"<<="
|
||||||
"=" @operator
|
"<="
|
||||||
"==" @operator
|
"="
|
||||||
">" @operator
|
"=="
|
||||||
">=" @operator
|
">"
|
||||||
">>" @operator
|
">="
|
||||||
">>=" @operator
|
">>"
|
||||||
"|" @operator
|
">>="
|
||||||
"|=" @operator
|
"|"
|
||||||
"||" @operator
|
"|="
|
||||||
|
"||"
|
||||||
|
] @operator
|
||||||
|
|
||||||
; Keywords
|
; Keywords
|
||||||
|
|
||||||
"break" @keyword
|
[
|
||||||
"case" @conditional
|
"break"
|
||||||
"chan" @keyword
|
"chan"
|
||||||
"const" @keyword
|
"const"
|
||||||
"continue" @keyword
|
"continue"
|
||||||
"default" @keyword
|
"default"
|
||||||
"defer" @keyword
|
"defer"
|
||||||
"else" @conditional
|
"func"
|
||||||
"fallthrough" @keyword
|
"go"
|
||||||
|
"goto"
|
||||||
|
"interface"
|
||||||
|
"map"
|
||||||
|
"range"
|
||||||
|
"return"
|
||||||
|
"select"
|
||||||
|
"struct"
|
||||||
|
"type"
|
||||||
|
"var"
|
||||||
|
"fallthrough"
|
||||||
|
] @keyword
|
||||||
|
|
||||||
"for" @repeat
|
"for" @repeat
|
||||||
"func" @keyword
|
|
||||||
"go" @keyword
|
[
|
||||||
"goto" @keyword
|
"import"
|
||||||
"if" @conditional
|
"package"
|
||||||
"import" @include
|
] @include
|
||||||
"interface" @keyword
|
|
||||||
"map" @keyword
|
[
|
||||||
"package" @include
|
"else"
|
||||||
"range" @keyword
|
"case"
|
||||||
"return" @keyword
|
"switch"
|
||||||
"select" @keyword
|
"if"
|
||||||
"struct" @keyword
|
] @conditional
|
||||||
"switch" @conditional
|
|
||||||
"type" @keyword
|
|
||||||
"var" @keyword
|
|
||||||
|
|
||||||
|
|
||||||
;; Builtin types
|
;; Builtin types
|
||||||
|
|
||||||
((type_identifier) @type.builtin
|
((type_identifier) @type.builtin
|
||||||
(#any-of? @type.builtin
|
(#any-of? @type.builtin
|
||||||
"bool" "byte" "complex128" "complex64" "error"
|
"bool"
|
||||||
"float32" "float64" "int" "int16" "int32" "int64"
|
"byte"
|
||||||
"int8" "rune" "string" "uint" "uint16" "uint32"
|
"complex128"
|
||||||
"uint64" "uint8" "uintptr"))
|
"complex64"
|
||||||
|
"error"
|
||||||
|
"float32"
|
||||||
|
"float64"
|
||||||
|
"int"
|
||||||
|
"int16"
|
||||||
|
"int32"
|
||||||
|
"int64"
|
||||||
|
"int8"
|
||||||
|
"rune"
|
||||||
|
"string"
|
||||||
|
"uint"
|
||||||
|
"uint16"
|
||||||
|
"uint32"
|
||||||
|
"uint64"
|
||||||
|
"uint8"
|
||||||
|
"uintptr"))
|
||||||
|
|
||||||
|
|
||||||
;; Builtin functions
|
;; Builtin functions
|
||||||
|
|
||||||
((identifier) @function.builtin
|
((identifier) @function.builtin
|
||||||
(#any-of? @function.builtin
|
(#any-of? @function.builtin
|
||||||
"append" "cap" "close" "complex" "copy"
|
"append"
|
||||||
"delete" "imag" "len" "make" "new" "panic"
|
"cap"
|
||||||
"print" "println" "real" "recover"))
|
"close"
|
||||||
|
"complex"
|
||||||
|
"copy"
|
||||||
|
"delete"
|
||||||
|
"imag"
|
||||||
|
"len"
|
||||||
|
"make"
|
||||||
|
"new"
|
||||||
|
"panic"
|
||||||
|
"print"
|
||||||
|
"println"
|
||||||
|
"real"
|
||||||
|
"recover"))
|
||||||
|
|
||||||
|
|
||||||
; Delimiters
|
; Delimiters
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue