emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/typescript-mode ec2c4c11fc 08/10: Merge pull request #172


From: ELPA Syncer
Subject: [nongnu] elpa/typescript-mode ec2c4c11fc 08/10: Merge pull request #172 from Fuco1/fix/keywords-method-calls
Date: Sat, 30 Jul 2022 06:59:04 -0400 (EDT)

branch: elpa/typescript-mode
commit ec2c4c11fcb6d9e8e626cadd28b5d411f0825d0e
Merge: 35f01b3aeb 367cfb70f5
Author: Jostein Kjønigsen <jostein@kjonigsen.net>
Commit: GitHub <noreply@github.com>

    Merge pull request #172 from Fuco1/fix/keywords-method-calls
    
    fix(fontlock): do not fontify function calls as keywords
---
 typescript-mode-general-tests.el | 11 +++++++++++
 typescript-mode.el               |  2 +-
 2 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/typescript-mode-general-tests.el b/typescript-mode-general-tests.el
index ad5ed6220f..33d5850f80 100644
--- a/typescript-mode-general-tests.el
+++ b/typescript-mode-general-tests.el
@@ -396,6 +396,17 @@ snake_cased_function(1, 2, 3)"
       (("endpoint" "data") . nil)
       (("<" ">" ",") . nil))))
 
+(ert-deftest font-lock/method-call-with-keyword-name ()
+  "If the name of the function/method is a keyword, it should still be 
highlighted as function."
+  (test-with-fontified-buffer
+      "const app = express();
+app.get()
+app.post()
+app.delete()"
+    (should (eq (get-face-at "get") 'font-lock-function-name-face))
+    (should (eq (get-face-at "post") 'font-lock-function-name-face))
+    (should (eq (get-face-at "delete") 'font-lock-function-name-face))))
+
 (ert-deftest font-lock/generics ()
   "Tests that type hints within generics are highlighted properly."
   (font-lock-test
diff --git a/typescript-mode.el b/typescript-mode.el
index 215a5d8585..98d20eb7ef 100644
--- a/typescript-mode.el
+++ b/typescript-mode.el
@@ -2028,7 +2028,7 @@ This performs fontification according to 
`typescript--class-styles'."
     ,@typescript--font-lock-keywords-3
 
     (,typescript--decorator-re (1 font-lock-function-name-face))
-    (,typescript--function-call-re (1 font-lock-function-name-face))
+    (,typescript--function-call-re (1 font-lock-function-name-face t))
     (,typescript--builtin-re (1 font-lock-type-face))
 
     ;; arrow function



reply via email to

[Prev in Thread] Current Thread [Next in Thread]