Fontify doc comment in c-ts-mode with doc-face
authorYuan Fu <casouri@gmail.com>
Thu, 9 May 2024 03:27:12 +0000 (20:27 -0700)
committerYuan Fu <casouri@gmail.com>
Thu, 9 May 2024 03:36:36 +0000 (20:36 -0700)
* lisp/progmodes/c-ts-mode.el (c-ts-mode--font-lock-settings): Add
rule for /** comments.

lisp/progmodes/c-ts-mode.el

index a1b2b1f500c0f09831142757b5b3bf301570e62c..2d431d75d2168367a7db7e20bbff62f75044e988 100644 (file)
@@ -597,8 +597,9 @@ MODE is either `c' or `cpp'."
   (treesit-font-lock-rules
    :language mode
    :feature 'comment
-   `((comment) @font-lock-comment-face
-     (comment) @contextual)
+   `(((comment) @font-lock-doc-face
+      (:match ,(rx bos "/**") @font-lock-doc-face))
+     (comment) @font-lock-comment-face)
 
    :language mode
    :feature 'preprocessor