From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Vincenzo Pupillo Newsgroups: gmane.emacs.bugs Subject: bug#71776: 31.0.50; [PATCH] js-ts-mode: conforming use of font lock faces in jsdoc. Date: Tue, 25 Jun 2024 16:16:21 +0200 Message-ID: <2796980.fDdHjke4Dd@3-191.divsi.unimi.it> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="nextPart2788866.vYhyI6sBWr" Content-Transfer-Encoding: 7Bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="14909"; mail-complaints-to="usenet@ciao.gmane.io" To: 71776@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Jun 25 16:17:10 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1sM6ys-0003kd-4T for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 25 Jun 2024 16:17:10 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sM6yl-0001dy-Er; Tue, 25 Jun 2024 10:17:03 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sM6yj-0001de-JY for bug-gnu-emacs@gnu.org; Tue, 25 Jun 2024 10:17:01 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sM6yj-0003sJ-B5 for bug-gnu-emacs@gnu.org; Tue, 25 Jun 2024 10:17:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sM6yk-0005Tu-LT for bug-gnu-emacs@gnu.org; Tue, 25 Jun 2024 10:17:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Vincenzo Pupillo Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 25 Jun 2024 14:17:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 71776 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.171932499521031 (code B ref -1); Tue, 25 Jun 2024 14:17:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 25 Jun 2024 14:16:35 +0000 Original-Received: from localhost ([127.0.0.1]:37515 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sM6yJ-0005T9-8b for submit@debbugs.gnu.org; Tue, 25 Jun 2024 10:16:35 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:37240) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sM6yD-0005Sw-TO for submit@debbugs.gnu.org; Tue, 25 Jun 2024 10:16:33 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sM6yB-0001E1-V4 for bug-gnu-emacs@gnu.org; Tue, 25 Jun 2024 10:16:27 -0400 Original-Received: from mail-ej1-x62d.google.com ([2a00:1450:4864:20::62d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sM6yA-0003ih-6i for bug-gnu-emacs@gnu.org; Tue, 25 Jun 2024 10:16:27 -0400 Original-Received: by mail-ej1-x62d.google.com with SMTP id a640c23a62f3a-a72477a6096so324784766b.1 for ; Tue, 25 Jun 2024 07:16:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719324983; x=1719929783; darn=gnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=TWDenCdXRZfHQkPOJqI8pikbWEaAhIFv6OxBU9nRBNk=; b=gFQKoUREOHZRaSVaBHJ9zPBPk+XyBlxgn/ePcR4CLEmLIUEQgca4i0Ys95vTgdLdM6 wRQWl/YnRobDOuivTKcgJ8v0pSavPM3whyEhLKNwTK49uBz5u05LvtkVocyVxjsP3hPz Cxf4G5Ei0erwheTp6wPAxX3lCpM5LUSJlTrHRq8FObtlhzmk9E7fW3iLDlCKJSg/0Vcx ZRFGEZzorXm8AotFb8YMArqR7x7z0ZwMWsc89aaFYfLfWHsT3x8ookz+qmuY2Uv4Ed1H eZ7+E6mrAzFR+oLhqp0ngeBr/tu8x4noSVZ+jEYBFKc5FH/iM2BijG3q6TC9VJVDpVH/ sECw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719324983; x=1719929783; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=TWDenCdXRZfHQkPOJqI8pikbWEaAhIFv6OxBU9nRBNk=; b=VtVvio8g0DbJDPgirkseOgrtgnxV+J6o1DC1DMmzAlliGXMovGYh4E6B23cHWpsF8D 6pRNLiLEmg8OqgW3gG3OBAa657pMdUia+Du2TyVyVIPjj+T4UMFSrv8rMxkibxwYrAR6 HxKsgO8z8aHy1iSqfv7Od3N0fjMakVawP/HzGOXlyoZO7TxLjVvJMnVQkOdp8gY2CJVe 2pK1gM/6t1RXmgUGFKOX7Tlbg+34/EfU+3gOOHRHPn0L2twD5mXDdoQ4j3FzOJYNHI3Q hVKjwqRRJJapZoNjj43+ly4VT1vZIyevgoMCsizziv8CimkStCozeueEWMPwt/jB2ebk AihA== X-Gm-Message-State: AOJu0YyNoLcHEc8/OA3zAZ0f9dYqy+yNUDCeIKpBdJ2ZzWXK6tXd5QSO z3HogDcgbrji1eu1mcMmmPSJYmBNn/VAZFLLLW+YJwzyz/4l5ChPeV66Vw== X-Google-Smtp-Source: AGHT+IFZYdBfpXar3aje8ItjWDdbKTHwYNeJ0MDeeIs0j7Hj7yH9u3wLuJp07l4qnPwHkDGHl2GxAQ== X-Received: by 2002:a17:906:37cf:b0:a70:3a15:110d with SMTP id a640c23a62f3a-a7245c642damr427181266b.69.1719324983083; Tue, 25 Jun 2024 07:16:23 -0700 (PDT) Original-Received: from 3-191.divsi.unimi.it (3-191.divsi.unimi.it. [159.149.3.191]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a6fe4eeb106sm394521166b.167.2024.06.25.07.16.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Jun 2024 07:16:22 -0700 (PDT) Received-SPF: pass client-ip=2a00:1450:4864:20::62d; envelope-from=v.pupillo@gmail.com; helo=mail-ej1-x62d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:287895 Archived-At: This is a multi-part message in MIME format. --nextPart2788866.vYhyI6sBWr Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="utf-8" 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 --nextPart2788866.vYhyI6sBWr Content-Disposition: attachment; filename="0001-Conforming-use-of-font-lock-faces-in-jsdoc.patch" Content-Transfer-Encoding: 7Bit Content-Type: text/x-patch; charset="x-UTF_8J"; name="0001-Conforming-use-of-font-lock-faces-in-jsdoc.patch" >From a81051ab74bd8bb29843206beaf481cf8270b4aa Mon Sep 17 00:00:00 2001 From: Vincenzo Pupillo 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 --nextPart2788866.vYhyI6sBWr--