[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/typescript-mode 526f307ca8 101/222: Fontify yield and yiel
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/typescript-mode 526f307ca8 101/222: Fontify yield and yield* as keyword |
Date: |
Sun, 6 Feb 2022 16:59:22 -0500 (EST) |
branch: elpa/typescript-mode
commit 526f307ca8ca50b8f98975f2812198212f6acf2f
Author: felipe <felipe@fov.space>
Commit: felipe <felipe@fov.space>
Fontify yield and yield* as keyword
Closes #67
---
typescript-mode-tests.el | 22 ++++++++++++++++++++++
typescript-mode.el | 3 ++-
2 files changed, 24 insertions(+), 1 deletion(-)
diff --git a/typescript-mode-tests.el b/typescript-mode-tests.el
index 487dc2fa8d..795555f27d 100644
--- a/typescript-mode-tests.el
+++ b/typescript-mode-tests.el
@@ -350,6 +350,28 @@ declare function declareFunctionDefn(x3: xty3, y3: yty3):
ret3;"
(font-lock-test "=//g something // comment"
'(("g something" . font-lock-comment-face))))
+(ert-deftest font-lock/yield ()
+ "`yield' and `yield*' should be fontified as keywords."
+ (font-lock-test
+ "function* gen(x0: xty0, y0: yty0): ret0 {
+ yield 123;
+ yield* subIter;
+}"
+ '(("yield 123" . font-lock-keyword-face)
+ ("yield\\*" . font-lock-keyword-face)
+ ("\\* subIter" . font-lock-keyword-face))))
+
+(ert-deftest font-lock/yielder ()
+ "`yielder' should not be fontified as a keyword."
+ (font-lock-test
+ "function* gen(x0: xty0, y0: yty0): ret0 {
+ const yielder = 123;
+ yield abc;
+ return yielder;
+}"
+ '(("yielder =" . font-lock-variable-name-face)
+ ("yielder;" . nil))))
+
(ert-deftest
font-lock/text-after-trailing-regexp-delim-should-not-be-fontified ()
"Text after trailing regular expression delimiter should not be fontified."
(test-with-temp-buffer
diff --git a/typescript-mode.el b/typescript-mode.el
index bd2f332e4a..1d5536f0bc 100644
--- a/typescript-mode.el
+++ b/typescript-mode.el
@@ -290,7 +290,7 @@ Match group 1 is the name of the macro.")
"private" "protected" "public" "readonly" "return" "set" "static" "string"
"super" "switch" "this" "throw" "true"
"try" "type" "typeof" "var" "void"
- "while" ))
+ "while")) ; yield is handled separately
"Regexp matching any typescript keyword.")
(defconst typescript--basic-type-re
@@ -318,6 +318,7 @@ Match group 1 is the name of the macro.")
(list "\\_<for\\_>"
"\\s-+\\(each\\)\\_>" nil nil
(list 1 'font-lock-keyword-face))
+ (cons "\\_<yield\\(\\*\\|\\_>\\)" 'font-lock-keyword-face)
(cons typescript--basic-type-re font-lock-type-face)
(cons typescript--constant-re font-lock-constant-face)))
"Level two font lock keywords for `typescript-mode'.")
- [nongnu] elpa/typescript-mode 438fc968bf 016/222: Highlight set and get keyword, (continued)
- [nongnu] elpa/typescript-mode 438fc968bf 016/222: Highlight set and get keyword, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode b6e993513c 015/222: Merge pull request #10 from nahuel/patch-1, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 09123ba690 002/222: prepare for melpa, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode abc0751c0e 025/222: Merge pull request #22 from josteink/master, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 5931f2776d 049/222: Add keyof keyword., ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 782e8dd32e 071/222: Add fontification support for jsdoc/typedoc tags., ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode f6d28c7a0d 073/222: Remove the fontification hack., ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 4b69ca57f5 080/222: Simplify regexp literal, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 7249d76e2d 097/222: Merge pull request #64 from dakra/master, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode d1ddaad259 089/222: Fix indentation of continued expressions., ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 526f307ca8 101/222: Fontify yield and yield* as keyword,
ELPA Syncer <=
- [nongnu] elpa/typescript-mode 67d67f0c20 099/222: Typo in the readme, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode b5e3f2a8a6 100/222: Merge pull request #68 from GeertVL/patch-1, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode a5f342e539 160/222: Add snake_cased function call to regression test suite, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 6eaddf6c17 162/222: Drop the custom insert-and-indent code in favor of electric-indent., ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 0fc7297870 184/222: Add compilation-mode support for ng lint too., ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode b6cd68ae77 177/222: Add test-cases for type-highlights supported so far., ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 102587e458 183/222: Merge pull request #132 from jkdufair/master, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode e6f68ab2dd 198/222: Fontify basic types over keywords., ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode fb44319479 197/222: Merge pull request #125 from Fuco1/fix/prefer-constant-over-keyword, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode ae32e1c28f 193/222: Use ‘insert-file-contents’ instead of ‘find-file’ for tests., ELPA Syncer, 2022/02/06