Subject: bug#71776: closed (Re: bug#71776: 31.0.50; [PATCH] js-ts-mode: conforming use of font lock faces in jsdoc.)

From: [email-masked] (GNU bug Tracking System)
Date: Sat, 06 Jul 2024 10:58:02 +0000

Your bug report

#71776: 31.0.50; [PATCH] js-ts-mode: conforming use of font lock faces in jsdoc.

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
71776: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=71776
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#71776: 31.0.50; [PATCH] js-ts-mode: conforming use of font lock faces in jsdoc.
From: Eli Zaretskii <[email-masked]>
To: Damien Cassou <[email-masked]>
Cc: [email-masked], [email-masked], [email-masked]
Date: Sat, 06 Jul 2024 13:57:11 +0300
List-Id: <debbugs-submit.debbugs.gnu.org>

> From: Damien Cassou <[email-masked]>
> Cc: [email-masked], [email-masked]
> Date: Sat, 06 Jul 2024 10:51:53 +0200
> 
> Hi Eli,
> 
> Eli Zaretskii <[email-masked]> writes:
> > Ping! Damien, would you please chime in and comment on the patch?
> 
> I did that privately last week, sorry :-). The patch looks good to me.
> 
> Thank you everyone for your work.

Thanks, installed on the emacs-3w0 release branch, and closing the
bug.

Subject: 31.0.50; [PATCH] js-ts-mode: conforming use of font lock faces in jsdoc.
From: Vincenzo Pupillo <[email-masked]>
To: [email-masked]
Date: Tue, 25 Jun 2024 16:16:21 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

Hi,
The use of font lock faces by jsdoc in js-ts-mode is different from that done in 
other major-modes such as java-mode or c++-mode. This patch makes them more similar.

Thanks.
Vincenzo

>From a81051ab74bd8bb29843206beaf481cf8270b4aa Mon Sep 17 00:00:00 2001
From: Vincenzo Pupillo <[email-masked]>
Date: Tue, 25 Jun 2024 15:54:17 +0200
Subject: [PATCH] Conforming use of font lock faces in jsdoc

* lisp/progmodes/js.el (js--treesit-font-lock-settings):
Use 'font-lock-doc-face' for 'document' node type,
font-lock-constant-face for 'tag_name' and 'font-lock-type' face
for 'type'.

* lisp/progmodes/js.el (js-ts-mode): Add 'document' to
'treesit-font-lock-feature-list'.
---
 lisp/progmodes/js.el | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/lisp/progmodes/js.el b/lisp/progmodes/js.el
index 529b31669ed..e9962c36a46 100644
--- a/lisp/progmodes/js.el
+++ b/lisp/progmodes/js.el
@@ -3636,10 +3636,16 @@ js--treesit-font-lock-settings
    :override t
    '((escape_sequence) @font-lock-escape-face)
 
+   ;; "document" should be first, to avoid overlap.
+   :language 'jsdoc
+   :override t
+   :feature 'document
+   '((document) @font-lock-doc-face)
+
    :language 'jsdoc
    :override t
    :feature 'keyword
-   '((tag_name) @font-lock-keyword-face)
+   '((tag_name) @font-lock-constant-face)
 
    :language 'jsdoc
    :override t
@@ -3649,17 +3655,12 @@ js--treesit-font-lock-settings
    :language 'jsdoc
    :override t
    :feature 'property
-   '((type) @font-lock-variable-use-face)
+   '((type) @font-lock-type-face)
 
    :language 'jsdoc
    :override t
    :feature 'definition
-   '((identifier) @font-lock-variable-name-face)
-
-   :language 'jsdoc
-   :override t
-   :feature 'comment
-   '((description) @font-lock-comment-face))
+   '((identifier) @font-lock-variable-name-face))
   "Tree-sitter font-lock settings.")
 
 (defun js--fontify-template-string (node override start end &rest _)
@@ -3933,7 +3934,7 @@ js-ts-mode
     ;; Fontification.
     (setq-local treesit-font-lock-settings js--treesit-font-lock-settings)
     (setq-local treesit-font-lock-feature-list
-                '(( comment definition)
+                '(( comment document definition)
                   ( keyword string)
                   ( assignment constant escape-sequence jsx number
                     pattern string-interpolation)
-- 
2.45.2