all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Jostein Kjønigsen" <jostein@secure.kjonigsen.net>
To: 60500@debbugs.gnu.org, Yuan Fu <casouri@gmail.com>,
	Theodor Thornhill <theo@thornhill.no>
Subject: bug#60500: Acknowledgement (29.0.60; typescript-ts-mode and tsx-ts-mode has inconsistent features/fontification wrt other ts major-modes)
Date: Mon, 2 Jan 2023 21:12:35 +0100	[thread overview]
Message-ID: <47f99096-9938-4a69-02ea-6caaea3f5b3f@secure.kjonigsen.net> (raw)
In-Reply-To: <handler.60500.B.167268995730474.ack@debbugs.gnu.org>

[-- Attachment #1: Type: text/plain, Size: 168 bytes --]

Previous patch was incomplete and only introduced the new feature on one 
of the major-modes.

This latest patch introduces it on both and should be good.

--
Jostein


[-- Attachment #2: 0002-lisp-progmodes-typescript-ts-mode.el-fontification-i.patch --]
[-- Type: text/x-patch, Size: 3318 bytes --]

From 6a713726a5f00e49f2fb9e87443a304b85dabf50 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jostein=20Kj=C3=B8nigsen?= <jostein@kjonigsen.net>
Date: Mon, 2 Jan 2023 20:56:41 +0100
Subject: [PATCH 2/2] lisp/progmodes/typescript-ts-mode.el: fontification
 improvements.

- highlight method-definitins in interfaces.
- only highlight variable-declarations, not variables
  everywhere (consistency with other modes).
- move highlighting of method invocations to level 4
---
 lisp/progmodes/typescript-ts-mode.el | 22 ++++++++++------------
 1 file changed, 10 insertions(+), 12 deletions(-)

diff --git a/lisp/progmodes/typescript-ts-mode.el b/lisp/progmodes/typescript-ts-mode.el
index a0ba425b3e9..e0583f4b05c 100644
--- a/lisp/progmodes/typescript-ts-mode.el
+++ b/lisp/progmodes/typescript-ts-mode.el
@@ -167,6 +167,8 @@ typescript-ts-mode--font-lock-settings
 
      (method_definition
       name: (property_identifier) @font-lock-function-name-face)
+     (method_signature
+      name: (property_identifier) @font-lock-function-name-face)
      (required_parameter (identifier) @font-lock-variable-name-face)
      (optional_parameter (identifier) @font-lock-variable-name-face)
 
@@ -211,10 +213,8 @@ typescript-ts-mode--font-lock-settings
 
      (enum_assignment name: (property_identifier) @font-lock-type-face)
 
-     (assignment_expression
-      left: [(identifier) @font-lock-variable-name-face
-             (member_expression
-              property: (property_identifier) @font-lock-variable-name-face)])
+     (variable_declarator
+      name: (identifier) @font-lock-variable-name-face)
 
      (for_in_statement
       left: (identifier) @font-lock-variable-name-face)
@@ -242,10 +242,6 @@ typescript-ts-mode--font-lock-settings
       name: (property_identifier) @font-lock-property-face)
      (public_field_definition
       name: (property_identifier) @font-lock-property-face)
-     (member_expression
-      object: (identifier) @font-lock-variable-name-face)
-     (member_expression
-      property: (_) @font-lock-property-face)
 
      (pair key: (property_identifier) @font-lock-variable-name-face)
 
@@ -263,9 +259,11 @@ typescript-ts-mode--font-lock-settings
       left: [(identifier) @font-lock-function-name-face
              (member_expression
               property: (property_identifier) @font-lock-function-name-face)]
-      right: [(function) (arrow_function)])
+      right: [(function) (arrow_function)]))
 
-     (call_expression
+   :language language
+   :feature 'function
+   '((call_expression
       function:
       [(identifier) @font-lock-function-name-face
        (member_expression
@@ -377,7 +375,7 @@ typescript-ts-mode
                 '((comment declaration)
                   (keyword string escape-sequence)
                   (constant expression identifier number pattern property)
-                  (bracket delimiter)))
+                  (function bracket delimiter)))
 
     (treesit-major-mode-setup)))
 
@@ -412,7 +410,7 @@ tsx-ts-mode
                 '((comment declaration)
                   (keyword string escape-sequence)
                   (constant expression identifier jsx number pattern property)
-                  (bracket delimiter)))
+                  (function bracket delimiter)))
 
     (treesit-major-mode-setup)))
 
-- 
2.37.2


  parent reply	other threads:[~2023-01-02 20:12 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-02 20:05 bug#60500: 29.0.60; typescript-ts-mode and tsx-ts-mode has inconsistent features/fontification wrt other ts major-modes Jostein Kjønigsen
2023-01-02 20:09 ` Eli Zaretskii
     [not found] ` <handler.60500.B.167268995730474.ack@debbugs.gnu.org>
2023-01-02 20:12   ` Jostein Kjønigsen [this message]
2023-01-02 20:56     ` bug#60500: Acknowledgement (29.0.60; typescript-ts-mode and tsx-ts-mode has inconsistent features/fontification wrt other ts major-modes) Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-01-02 22:27 ` bug#60500: 29.0.60; typescript-ts-mode and tsx-ts-mode has inconsistent features/fontification wrt other ts major-modes Yuan Fu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=47f99096-9938-4a69-02ea-6caaea3f5b3f@secure.kjonigsen.net \
    --to=jostein@secure.kjonigsen.net \
    --cc=60500@debbugs.gnu.org \
    --cc=casouri@gmail.com \
    --cc=jostein@kjonigsen.net \
    --cc=theo@thornhill.no \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.