mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-16 18:30:06 -04:00
fix: make comment doc highlighting work for any doc tag
This commit is contained in:
parent
2c2d4d89fd
commit
fdcd0edf24
1 changed files with 14 additions and 11 deletions
|
|
@ -180,13 +180,6 @@
|
||||||
] operator: "/" right: (integer) @operator)
|
] operator: "/" right: (integer) @operator)
|
||||||
])
|
])
|
||||||
|
|
||||||
; Module attributes
|
|
||||||
(unary_operator
|
|
||||||
operator: "@" @constant
|
|
||||||
operand: [
|
|
||||||
(identifier) @constant
|
|
||||||
(call target: (identifier) @constant)])
|
|
||||||
|
|
||||||
; Sigils
|
; Sigils
|
||||||
(sigil
|
(sigil
|
||||||
"~" @string.special
|
"~" @string.special
|
||||||
|
|
@ -205,10 +198,20 @@
|
||||||
((sigil_modifiers) @string)?
|
((sigil_modifiers) @string)?
|
||||||
(#any-of? @_sigil_name "s" "S"))
|
(#any-of? @_sigil_name "s" "S"))
|
||||||
|
|
||||||
|
; Module attributes
|
||||||
|
(unary_operator
|
||||||
|
operator: "@"
|
||||||
|
operand: [
|
||||||
|
(identifier)
|
||||||
|
(call target: (identifier) @constant)]) @constant
|
||||||
|
|
||||||
; Documentation
|
; Documentation
|
||||||
(unary_operator
|
(unary_operator
|
||||||
operator: "@" @comment
|
operator: "@"
|
||||||
operand: (call
|
operand: (call
|
||||||
target: ((identifier) @_identifier)
|
target: ((identifier) @_identifier (#match? @_identifier "doc$")) @comment
|
||||||
_) @comment
|
(arguments [
|
||||||
(#any-of? @_identifier "moduledoc" "typedoc" "shortdoc" "doc"))
|
(string)
|
||||||
|
(boolean)
|
||||||
|
(charlist)
|
||||||
|
] @comment))) @comment
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue