[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/typescript-mode 89d22c4e18 051/222: Don't interpret forwar
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/typescript-mode 89d22c4e18 051/222: Don't interpret forward slash in list as operator. |
Date: |
Sun, 6 Feb 2022 16:59:12 -0500 (EST) |
branch: elpa/typescript-mode
commit 89d22c4e188cd93ea9550e85d17a2d9c0f3393dc
Author: Louis-Dominique Dubeau <ldd@lddubeau.com>
Commit: Louis-Dominique Dubeau <ldd@lddubeau.com>
Don't interpret forward slash in list as operator.
---
test-files/indentation-reference-document.ts | 21 +++++++++++++++++++++
typescript-mode.el | 8 ++++++++
2 files changed, 29 insertions(+)
diff --git a/test-files/indentation-reference-document.ts
b/test-files/indentation-reference-document.ts
index 8e9c809f5a..da1dd7d80c 100644
--- a/test-files/indentation-reference-document.ts
+++ b/test-files/indentation-reference-document.ts
@@ -215,4 +215,25 @@ namespace ts.server {
...rest: any[]) {
}
}
+
+ {
+ // Regular expressions in lists.
+
+ // List objects...
+ const a = [
+ /abc/,
+ /def/
+ ];
+
+ const z =
+ /abcd/;
+
+ // Argument lists...
+ function foo(a: RegExp, b: RegExp): void {
+ }
+
+ foo(
+ /abc/,
+ /def/);
+ }
}
diff --git a/typescript-mode.el b/typescript-mode.el
index 64f35247a6..5de10fb9a6 100644
--- a/typescript-mode.el
+++ b/typescript-mode.el
@@ -1659,6 +1659,14 @@ See `font-lock-keywords'.")
(save-excursion
(and (typescript--re-search-backward "[?:{]\\|\\_<case\\_>" nil
t)
(looking-at "?"))))
+ ;; Do not identify forward slashes appearing in a "list" as
+ ;; an operator. The lists are: arrays, or lists of
+ ;; arguments. In this context, they must be part of regular
+ ;; expressions, and not math operators.
+ (not (and (looking-at "/")
+ (save-excursion
+ (typescript--backward-syntactic-ws)
+ (memq (char-before) '(?, ?\[ ?\()))))
;; Do not identify methods, or fields, that are named "in" or
;; "instanceof" as being operator keywords.
(not (and
- [nongnu] elpa/typescript-mode e15e2bfa1a 131/222: Add jsdoc tests, (continued)
- [nongnu] elpa/typescript-mode e15e2bfa1a 131/222: Add jsdoc tests, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode c0f11efdfd 143/222: Fixing typescript--forward-expression for multiline indented string, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode a0f2c3ebd4 164/222: Reimplement template auto conversion as a post-self-insert-hook, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode b44b75dbe1 172/222: Add test case for infinite loop, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 5bf30fe8d6 175/222: Add member expressions tests involving type parameters., ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 1c27fb09ed 220/222: Fix cl deprecation warning, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode dd832751ab 217/222: Merge pull request #156 from zkry/fix-dot-after-exclamation-indentation, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 4249a20d6d 187/222: Added file for indent test case, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode c5e7788ce9 044/222: Merge pull request #28 from ananthakumaran/testing, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 99c2b74ac3 059/222: Make current-column function internal., ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 89d22c4e18 051/222: Don't interpret forward slash in list as operator.,
ELPA Syncer <=
- [nongnu] elpa/typescript-mode 393ac6db0f 081/222: add tests for regexp font locking, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 361564c4a9 057/222: typescript-current-column: Dont cause side-effects., ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode d155a4b623 063/222: Revert indent of complex parameters., ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode e0b4a6cb31 055/222: Merge pull request #36 from lddubeau/feature/improved-tslint-regex, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode bce2e73cf2 107/222: Remove unused dependencies, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 7172a23d86 072/222: Add a custom predicate for flyspell-prog-mode., ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode d8501770f6 103/222: Fix indentation of multiple curly braces in sequence., ELPA Syncer, 2022/02/06
- [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