Skip to content

Distinction between line comments and block/doc comments #1867

Answered by the-mikedavis
dssgabriel asked this question in Q&A
Discussion options

You must be logged in to vote

A good example for something similar is #1618. The theming you have looks good but the highlight queries for languages with block comments need to be captured in a way that can be themed like that. For example, this rust query line could be changed into

((line_comment) @comment.documentation
 (#match? @comment.documentation "^///"))
(line_comment) @comment.line
(block_comment) @comment.block

Themes that have a comment.block would style the block comments differently and themes without would fall back to whatever is defined for comment.

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by dssgabriel
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants