[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/typescript-mode e38492f1cd 179/222: Extend Type-name to su
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/typescript-mode e38492f1cd 179/222: Extend Type-name to support namespace-prefixes. |
Date: |
Sun, 6 Feb 2022 16:59:30 -0500 (EST) |
branch: elpa/typescript-mode
commit e38492f1cd4559bc7ba06b4d844e7efe6bcf5354
Author: Jostein Kjønigsen <jostein@kjonigsen.net>
Commit: Jostein Kjønigsen <jostein@kjonigsen.net>
Extend Type-name to support namespace-prefixes.
---
typescript-mode-general-tests.el | 26 ++++++++++++++++++++++++++
typescript-mode.el | 2 +-
2 files changed, 27 insertions(+), 1 deletion(-)
diff --git a/typescript-mode-general-tests.el b/typescript-mode-general-tests.el
index 7fdb1bcc8d..6e3f098aa7 100644
--- a/typescript-mode-general-tests.el
+++ b/typescript-mode-general-tests.el
@@ -512,6 +512,32 @@ function foo<Z, Y, Z & Y, Z | Y | Z, Y<X<X, Y>>>()\n"
(should (eq (get-face-at "SomeType") 'font-lock-type-face))
(should (eq (get-face-at "Foo") 'font-lock-type-face))))
+(ert-deftest font-lock/type-names-level4-namespaces ()
+ "Namespaced Typenames should be highlighted in declarations"
+ (test-with-fontified-buffer
+ "private b: Namespaced.ClassName;"
+ (should (eq (get-face-at "Namespaced") 'font-lock-type-face))
+ (should (eq (get-face-at "ClassName") 'font-lock-type-face)))
+ (test-with-fontified-buffer
+ "function test(var1: Namespaced.ClassName): RetType {\n}"
+ (should (eq (get-face-at "Namespaced") 'font-lock-type-face))
+ (should (eq (get-face-at "ClassName") 'font-lock-type-face)))
+
+ (test-with-fontified-buffer
+ "class Foo { test(var1: Namespaced.ClassName): RetType {\n}"
+ (should (eq (get-face-at "Namespaced") 'font-lock-type-face))
+ (should (eq (get-face-at "ClassName") 'font-lock-type-face)))
+
+ (test-with-fontified-buffer
+ "function test(var1: Type): Namespaced.ClassName {\n}"
+ (should (eq (get-face-at "Namespaced") 'font-lock-type-face))
+ (should (eq (get-face-at "ClassName") 'font-lock-type-face)))
+
+ (test-with-fontified-buffer
+ "class Foo { test(var1: Type): Namespaced.ClassName {\n}"
+ (should (eq (get-face-at "Namespaced") 'font-lock-type-face))
+ (should (eq (get-face-at "ClassName") 'font-lock-type-face))))
+
(defun flyspell-predicate-test (search-for)
"This function runs a test on
`typescript--flyspell-mode-predicate'. `SEARCH-FOR' is a string
diff --git a/typescript-mode.el b/typescript-mode.el
index a911f7f169..53f12c02c3 100644
--- a/typescript-mode.el
+++ b/typescript-mode.el
@@ -63,7 +63,7 @@
;;; Constants
-(defconst typescript--type-name-re "[A-Z][A-Za-z0-9]+"
+(defconst typescript--type-name-re
"\\(?:[A-Z][A-Za-z0-9]+\\.\\)\\{0,\\}\\(?:[A-Z][A-Za-z0-9]+\\)"
"Regexp matching a conventional TypeScript type-name. Must start with
upper-case letter!")
(defconst typescript--name-start-re "[a-zA-Z_$]"
- [nongnu] elpa/typescript-mode a09e9c78f9 108/222: Highlight class names., (continued)
- [nongnu] elpa/typescript-mode a09e9c78f9 108/222: Highlight class names., ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 7c6fd0f4a8 115/222: Document how to handle ANSI codes in error messages., ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 9796425fdb 113/222: Add support for new type "unknown"., ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 39b7ba9e54 117/222: Distinguish type arguments from lesser/greater than. (Fixes #81), ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 30f8b8feb4 122/222: Merge pull request #87 from Ailrun/add-jsdoc-tags, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 29282a32b7 124/222: add never type, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 8910e12525 129/222: Add autoload cookie with safe-local-var for typescript-indent-level, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode fbaad515c9 132/222: Merge pull request #89 from Ailrun/update-jsdoc-tests, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 32146510b8 147/222: Pin our dist to Trusty., ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 706f938aef 155/222: force generic regex to include symbol before it (#119), ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode e38492f1cd 179/222: Extend Type-name to support namespace-prefixes.,
ELPA Syncer <=
- [nongnu] elpa/typescript-mode 7040961735 166/222: Highlight type-names in type-casts too., ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode de1a696c3c 174/222: Ignore errors from backward-list, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode a7cd7a92a5 167/222: fix(font-lock): prefer fontifying constants over keywords, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 1767de1095 180/222: Merge pull request #129 from emacs-typescript/feature/types-in-declarations, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 0d5c941c4c 195/222: * typescript-mode.el: Use EOS instead of EOL for auto mode regexp., ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 7d80174b23 216/222: Skip past ? and ! in typescript--compute-member-expression-indent, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 6918f3f6d7 212/222: Merge pull request #154 from emacs-typescript/feature/build-tasks, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 13e6da6c57 219/222: Merge pull request #157 from rsimoes/patch-1, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode a6e0eac105 029/222: Fix wrong cursor position in `typescript-indent-line`, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 0f41709e15 074/222: Fontify @type properly and allow jsdoc one-liners., ELPA Syncer, 2022/02/06