[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/typescript-mode cebfe5952b 114/222: Rename the regexp matc
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/typescript-mode cebfe5952b 114/222: Rename the regexp matching pretty error messages. |
Date: |
Sun, 6 Feb 2022 16:59:23 -0500 (EST) |
branch: elpa/typescript-mode
commit cebfe5952b6d57ffcaa3ae5a50ff90729c18eb9c
Author: Louis-Dominique Dubeau <ldd@lddubeau.com>
Commit: Louis-Dominique Dubeau <ldd@lddubeau.com>
Rename the regexp matching pretty error messages.
This commit renames the complation regexp for pretty error
messages. (Discussed [here][1].) It also adds a comment distinguishing
plain and pretty error messages and giving some historical background.
[1]: https://github.com/ananthakumaran/typescript.el/issues/77
---
typescript-mode-tests.el | 4 +---
typescript-mode.el | 25 ++++++++++++++++++++-----
2 files changed, 21 insertions(+), 8 deletions(-)
diff --git a/typescript-mode-tests.el b/typescript-mode-tests.el
index 2b77423017..4cf37fd01e 100644
--- a/typescript-mode-tests.el
+++ b/typescript-mode-tests.el
@@ -625,14 +625,12 @@ const b = 'not terminated bbb")))
(ert-deftest recognizes-tsc-errors ()
(dolist (test-case
- ;; typescript 2.6 and earlier
`(("test.ts(2,7): error TS2322: Type '2' is not assignable to type
'string'."
,typescript-tsc-error-regexp
"test.ts")
- ;; typescript 2.7 and later
("test.ts:2:7 - error TS2322: Type '2' is not assignable to type
'string'."
- ,typescript-tsc27-error-regexp
+ ,typescript-tsc-pretty-error-regexp
"test.ts")
))
(let* ((text (car test-case))
diff --git a/typescript-mode.el b/typescript-mode.el
index c5a1bc28da..757ac94712 100644
--- a/typescript-mode.el
+++ b/typescript-mode.el
@@ -2525,7 +2525,21 @@ the broken-down class name of the item to insert."
;;; compilation-mode support
-;; handle compiler-errors like the following when doing M-x
compile<ret>tsc<ret>
+;; tsc supports formatting errors in two general ways: plain and
+;; pretty. ("Plain" is our term for "not pretty".) In tsc versions
+;; prior to 2.7, the plain and pretty formats both used the same
+;; format for references into files. `typescript-tsc-error-regexp`
+;; covers both plain and pretty for those versions.
+;;
+;; Version 2.7 changed the pretty format so as to format source code
+;; references differently. This required the introduction of
+;; `typescript-tsc-pretty-error-regexp`. The format of plain error
+;; messages did not change. So from that version onwards,
+;; `typescript-tsc-error-regexp` covers plain error messages and
+;; `typescript-tsc-pretty-error-regexp` covers pretty error messages.
+
+;; handle plain compiler-errors like the following when doing M-x
compile<ret>tsc<ret>
+;;
;; greeter.ts(24,9): error TS2362: The left-hand side of an arithmetic
operation must be of type 'any', 'number' or an enum type.
;; greeter.ts(30,12): error TS2339: Property 'indexOf' does not exist on type
'number'.
(defconst typescript-tsc-error-regexp
@@ -2535,14 +2549,15 @@ the broken-down class name of the item to insert."
"error [[:alnum:]]+: [^\r\n]+$")
"Regexp to match errors generated by tsc.")
-;; handle compiler-errors like the following when doing M-x
compile<ret>tsc<ret>
+;; handle pretty compiler-errors like the following when doing M-x
compile<ret>tsc<ret>
;; test.ts:2:7 - error TS2322: Type '2' is not assignable to type 'string'.
-(defconst typescript-tsc27-error-regexp
+(defconst typescript-tsc-pretty-error-regexp
(concat
"^[[:blank:]]*"
"\\([^(\r\n)]+\\):\\([0-9]+\\):\\([0-9]+\\) - [[:blank:]]*"
"error [[:alnum:]]+: [^\r\n]+$")
"Regexp to match errors generated by tsc.")
+
;;
;; Should handle output like:
;; src/modules/authenticator.ts[1, 83]: ' should be "
@@ -2585,8 +2600,8 @@ the broken-down class name of the item to insert."
,typescript-tsc-error-regexp
1 2 3 2)
- (typescript-tsc27
- ,typescript-tsc27-error-regexp
+ (typescript-tsc-pretty
+ ,typescript-tsc-pretty-error-regexp
1 2 3 2)
(typescript-tslint
- [nongnu] elpa/typescript-mode 6918f3f6d7 212/222: Merge pull request #154 from emacs-typescript/feature/build-tasks, (continued)
- [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
- [nongnu] elpa/typescript-mode 90d9758cfb 035/222: Revert "Fix wrong cursor position in `typescript-indent-line`", ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 1cea84486f 064/222: Merge pull request #35 from lddubeau/feature/indent-return-annotations, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 9ad892fb22 061/222: Add keyword 'object', ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode e3d2fee6de 004/222: unnecessary for single package file, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 7e8b9641ae 096/222: Mark typescript indent variables as safe for file local customizations, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 813cf4fef3 069/222: Fix endless loop (hang) in indentation-code., ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode cebfe5952b 114/222: Rename the regexp matching pretty error messages.,
ELPA Syncer <=
- [nongnu] elpa/typescript-mode 5d5c611e2d 119/222: Add tags in js2-mode, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode e608305ade 137/222: checkdoc fixes, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 85504ce34b 138/222: Update build-badge URL., ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode f6330f420e 144/222: Add a test for #107., ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode c1aa1b2e7d 149/222: add better generics highlighting, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 1bafd279cf 148/222: Enable more colors (#110), ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 607897d583 151/222: Update Emacs Git to Xenial-build, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 42b366e669 153/222: Merge pull request #111 from tam5/master, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 2405090403 152/222: Handle CI-failures correctly., ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 895cd7f425 173/222: Fix indentation infinite looping, ELPA Syncer, 2022/02/06