branch: elpa/typescript-mode
commit bd15f212a782cd4da04da36ee25426ffea560198
Author: Jostein Kjønigsen <[email protected]>
Commit: Jostein Kjønigsen <[email protected]>
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