mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-13 08:50:11 -04:00
highlights(vlang): add attribute_declaration and specialize some keywords
This commit is contained in:
parent
ad77a80813
commit
4da1d0702a
1 changed files with 31 additions and 18 deletions
|
|
@ -33,6 +33,7 @@
|
||||||
((identifier) @variable.builtin
|
((identifier) @variable.builtin
|
||||||
(#match? @variable.builtin "^(err|macos|linux|windows)$"))
|
(#match? @variable.builtin "^(err|macos|linux|windows)$"))
|
||||||
|
|
||||||
|
(attribute_declaration) @attribute
|
||||||
;; C: TODO: fixme make `C`.exten highlighted as variable.builtin
|
;; C: TODO: fixme make `C`.exten highlighted as variable.builtin
|
||||||
; ((binded_identifier) @content
|
; ((binded_identifier) @content
|
||||||
; (#offset! @content 0 3 0 -1)
|
; (#offset! @content 0 3 0 -1)
|
||||||
|
|
@ -66,38 +67,51 @@
|
||||||
|
|
||||||
;; Keywords
|
;; Keywords
|
||||||
|
|
||||||
|
[
|
||||||
|
"import"
|
||||||
|
"module"
|
||||||
|
] @include
|
||||||
|
|
||||||
|
[
|
||||||
|
"match"
|
||||||
|
"if"
|
||||||
|
"$if"
|
||||||
|
"else"
|
||||||
|
"$else"
|
||||||
|
] @conditional
|
||||||
|
|
||||||
|
[
|
||||||
|
"for" @repeat
|
||||||
|
"$for"
|
||||||
|
] @repeat
|
||||||
|
|
||||||
[
|
[
|
||||||
"as"
|
"as"
|
||||||
|
"in"
|
||||||
|
"!in"
|
||||||
|
"or"
|
||||||
|
"is"
|
||||||
|
"!is"
|
||||||
|
] @keyword.operator
|
||||||
|
|
||||||
|
[
|
||||||
"asm"
|
"asm"
|
||||||
"assert"
|
"assert"
|
||||||
"const"
|
"const"
|
||||||
"defer"
|
"defer"
|
||||||
"else"
|
|
||||||
"$else"
|
|
||||||
"enum"
|
"enum"
|
||||||
"$for"
|
|
||||||
"go"
|
"go"
|
||||||
"goto"
|
"goto"
|
||||||
"if"
|
|
||||||
"$if"
|
|
||||||
"import"
|
|
||||||
"in"
|
|
||||||
"!in"
|
|
||||||
"interface"
|
"interface"
|
||||||
"is"
|
|
||||||
"!is"
|
|
||||||
"lock"
|
"lock"
|
||||||
"match"
|
|
||||||
"module"
|
|
||||||
"mut"
|
"mut"
|
||||||
"or"
|
|
||||||
"pub"
|
"pub"
|
||||||
"rlock"
|
"rlock"
|
||||||
"select"
|
|
||||||
"struct"
|
"struct"
|
||||||
"type"
|
"type"
|
||||||
"unsafe"]
|
"unsafe"
|
||||||
;; Either not supported or will be droped
|
]
|
||||||
|
;; Either not supported or will be dropped
|
||||||
;"atomic"
|
;"atomic"
|
||||||
;"break"
|
;"break"
|
||||||
; "continue"
|
; "continue"
|
||||||
|
|
@ -108,11 +122,10 @@
|
||||||
|
|
||||||
"fn" @keyword.function
|
"fn" @keyword.function
|
||||||
"return" @keyword.return
|
"return" @keyword.return
|
||||||
"for" @repeat
|
|
||||||
|
|
||||||
; "import" @include ;; note: comment out b/c of import_path @namespace
|
; "import" @include ;; note: comment out b/c of import_path @namespace
|
||||||
|
|
||||||
[ (true) (false)] @boolean
|
[ (true) (false) ] @boolean
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue