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

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

[nongnu] elpa/typescript-mode bd15f212a7 165/222: Implement support type


From: ELPA Syncer
Subject: [nongnu] elpa/typescript-mode bd15f212a7 165/222: Implement support type-highlighting in some basic declarations
Date: Sun, 6 Feb 2022 16:59:29 -0500 (EST)

branch: elpa/typescript-mode
commit bd15f212a782cd4da04da36ee25426ffea560198
Author: Jostein Kjønigsen <jostein@kjonigsen.net>
Commit: Jostein Kjønigsen <jostein@kjonigsen.net>

    Implement support type-highlighting in some basic declarations
---
 typescript-mode.el | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/typescript-mode.el b/typescript-mode.el
index 3ae8e16ae0..68c01219a6 100644
--- a/typescript-mode.el
+++ b/typescript-mode.el
@@ -1997,6 +1997,18 @@ This performs fontification according to 
`typescript--class-styles'."
             '(end-of-line)
             '(1 font-lock-type-face)))
 
+    ;; type-highlighting in variable/parameter declarations
+    ;; supports a small variety of common declarations:
+    ;; - let a: SomeType;
+    ;; - private b: SomeType;
+    ;; - private someFunc(var: SomeType) {
+    ;; - private array: SomeType[]
+    ;; - private generic: SomeType<Foo>
+    ;; - private genericArray: SomeType<Foo>[]
+    ;; - function testFunc(): SomeType<> {
+    
(":\\s-\\([A-Z][A-Za-z0-9]+\\)\\(<[A-Z][A-Za-z0-9]+>\\)?\\(\[\]\\)?\\([,;]\\)?\\s-*{?"
+     (1 'font-lock-type-face))
+
     ;; highlights that append to previous levels
     ;;
     ,@typescript--font-lock-keywords-3



reply via email to

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