From 73c10c8bb8a7c479d4e1ffe127f6064776689b81 Mon Sep 17 00:00:00 2001 From: Yuan Fu Date: Wed, 8 May 2024 20:27:12 -0700 Subject: [PATCH] Fontify doc comment in c-ts-mode with doc-face * lisp/progmodes/c-ts-mode.el (c-ts-mode--font-lock-settings): Add rule for /** comments. (cherry picked from commit 03d4b96da62fbb7abfb7fa8fcfc963313e394f22) --- lisp/progmodes/c-ts-mode.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lisp/progmodes/c-ts-mode.el b/lisp/progmodes/c-ts-mode.el index ce2deb8f6a6..a81b9e09091 100644 --- a/lisp/progmodes/c-ts-mode.el +++ b/lisp/progmodes/c-ts-mode.el @@ -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 -- 2.39.5