Subject: [PATCH] Add font-locking for shebangs in js-ts-mode and typescript-ts-mode
From: Noah Peart <[email-masked]>
To: [email-masked]
Date: Sat, 9 Dec 2023 11:44:19 -0800
List-Id: <debbugs-submit.debbugs.gnu.org>

Tags: patch

* Bug: `js-ts-mode` and `typescript-ts-mode` are missing font-locking
rules for hashbang lines.

Recipe to reproduce:
Open a buffer and insert

    #!/usr/bin/env node

Run `M-x js-ts-mode` and `M-x typescript-ts-mode` to see no font-locking
is applied to the hash bang line.
From 1b15ed1c8657f84f55f57411682eb34d39848533 Mon Sep 17 00:00:00 2001
From: nverno <[email-masked]>
Date: Sat, 9 Dec 2023 11:28:15 -0800
Subject: [PATCH] Add font-locking for hash-bang lines in js-ts-mode

* lisp/progmodes/js.el(js--treesit-font-lock-settings): Add font-lock for hash bang
line.
---
 lisp/progmodes/js.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/progmodes/js.el b/lisp/progmodes/js.el
index b3a0f5a7c04..44eda03f7ce 100644
--- a/lisp/progmodes/js.el
+++ b/lisp/progmodes/js.el
@@ -3497,7 +3497,7 @@ js--treesit-font-lock-settings
 
    :language 'javascript
    :feature 'comment
-   '((comment) @font-lock-comment-face)
+   '([(comment) (hash_bang_line)] @font-lock-comment-face)
 
    :language 'javascript
    :feature 'constant
-- 
2.34.1

From 619e548dc81512d239ce4f73b6d38a38120539ea Mon Sep 17 00:00:00 2001
From: nverno <[email-masked]>
Date: Sat, 9 Dec 2023 11:35:44 -0800
Subject: [PATCH] Add font-locking for hash-bang lines in typescript-ts-mode.

* lisp/progmodes/typescript-ts-mode.el(typescript-ts-mode--font-lock-settings): Add
font-lock for hash bang line.
---
 lisp/progmodes/typescript-ts-mode.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/progmodes/typescript-ts-mode.el b/lisp/progmodes/typescript-ts-mode.el
index 7998b3740b6..7f0b7236301 100644
--- a/lisp/progmodes/typescript-ts-mode.el
+++ b/lisp/progmodes/typescript-ts-mode.el
@@ -205,7 +205,7 @@ typescript-ts-mode--font-lock-settings
   (treesit-font-lock-rules
    :language language
    :feature 'comment
-   `((comment) @font-lock-comment-face)
+   `([(comment) (hash_bang_line)] @font-lock-comment-face)
 
    :language language
    :feature 'constant
-- 
2.34.1