mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-01 19:17:02 -04:00
There are a couple cases where the comment highlights will match things that aren't necessary a tag. For example in Rust, when commenting a block that deals with generics (generics are declared as `T: Type`), this may be distracting. So, instead of highlighting all tags, we can restrict to highlighting the explicit keywords. Ref https://github.com/stsewd/tree-sitter-comment/issues/14
45 lines
1.1 KiB
Scheme
45 lines
1.1 KiB
Scheme
(_) @spell
|
|
|
|
((tag
|
|
(name) @text.todo
|
|
("(" @punctuation.bracket (user) @constant ")" @punctuation.bracket)?
|
|
":" @punctuation.delimiter)
|
|
(#eq? @text.todo "TODO"))
|
|
|
|
("text" @text.todo
|
|
(#eq? @text.todo "TODO"))
|
|
|
|
((tag
|
|
(name) @text.note
|
|
("(" @punctuation.bracket (user) @constant ")" @punctuation.bracket)?
|
|
":" @punctuation.delimiter)
|
|
(#any-of? @text.note "NOTE" "XXX"))
|
|
|
|
("text" @text.note
|
|
(#any-of? @text.note "NOTE" "XXX"))
|
|
|
|
((tag
|
|
(name) @text.warning
|
|
("(" @punctuation.bracket (user) @constant ")" @punctuation.bracket)?
|
|
":" @punctuation.delimiter)
|
|
(#any-of? @text.warning "HACK" "WARNING"))
|
|
|
|
("text" @text.warning
|
|
(#any-of? @text.warning "HACK" "WARNING"))
|
|
|
|
((tag
|
|
(name) @text.danger
|
|
("(" @punctuation.bracket (user) @constant ")" @punctuation.bracket)?
|
|
":" @punctuation.delimiter)
|
|
(#any-of? @text.danger "FIXME" "BUG"))
|
|
|
|
("text" @text.danger
|
|
(#any-of? @text.danger "FIXME" "BUG"))
|
|
|
|
; Issue number (#123)
|
|
("text" @number
|
|
(#lua-match? @number "^#[0-9]+$"))
|
|
|
|
; User mention (@user)
|
|
("text" @constant
|
|
(#lua-match? @constant "^[@][a-zA-Z0-9_-]+$"))
|