[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/typescript-mode f9cd0dd539 112/222: Try parse new error-fo
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/typescript-mode f9cd0dd539 112/222: Try parse new error-format introduced in tsc 2.7+ |
Date: |
Sun, 6 Feb 2022 16:59:23 -0500 (EST) |
branch: elpa/typescript-mode
commit f9cd0dd539d5d23f2b466de0cf20f9b0aef07258
Author: Jostein Kjønigsen <jostein@kjonigsen.net>
Commit: Jostein Kjønigsen <jostein@kjonigsen.net>
Try parse new error-format introduced in tsc 2.7+
Add to compilation-mode.
Tests.
This hopefully fixes
https://github.com/ananthakumaran/typescript.el/issues/77.
---
typescript-mode-tests.el | 28 ++++++++++++++++++++++++++++
typescript-mode.el | 12 ++++++++++++
2 files changed, 40 insertions(+)
diff --git a/typescript-mode-tests.el b/typescript-mode-tests.el
index 656553944d..2b77423017 100644
--- a/typescript-mode-tests.el
+++ b/typescript-mode-tests.el
@@ -620,6 +620,34 @@ const b = 'not terminated bbb")))
(let ((typescript-autoconvert-to-template-flag t))
(should-modify str delimiter))))))
+;; compilation-mode tests
+
+(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
+ "test.ts")
+ ))
+ (let* ((text (car test-case))
+ (regexp (cadr test-case))
+ (matched-file-name (cl-caddr test-case))
+ (times 1))
+ (with-temp-buffer
+ (insert text)
+ (goto-char (point-min))
+
+ (re-search-forward regexp)
+ (should
+ (equal matched-file-name (match-string 1)))))))
+
+
(provide 'typescript-mode-tests)
;;; typescript-mode-tests.el ends here
diff --git a/typescript-mode.el b/typescript-mode.el
index 11627ab412..a3d92dbfac 100644
--- a/typescript-mode.el
+++ b/typescript-mode.el
@@ -2535,6 +2535,14 @@ 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>
+;; test.ts:2:7 - error TS2322: Type '2' is not assignable to type 'string'.
+(defconst typescript-tsc27-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 "
@@ -2577,6 +2585,10 @@ the broken-down class name of the item to insert."
,typescript-tsc-error-regexp
1 2 3 2)
+ (typescript-tsc27
+ ,typescript-tsc27-error-regexp
+ 1 2 3 2)
+
(typescript-tslint
,typescript-tslint-report-regexp
3 4 5 (1))))
- [nongnu] elpa/typescript-mode 7526f138a0 032/222: Avoid capturing things we dont need for compilation-mode., (continued)
- [nongnu] elpa/typescript-mode 7526f138a0 032/222: Avoid capturing things we dont need for compilation-mode., ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 666052f09f 033/222: Update readme., ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 4235b47a38 060/222: Fix indent for lines which starts with tabs., ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 52c08d0628 091/222: Add more fontification tests for regular expressions., ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode e25c7ddb8a 062/222: Fix indentation of funcs with return annotations., ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 536e4da380 087/222: Fix bug with hanling array shorthand in return value types., ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 70acbf9c3d 078/222: Change font-lock-test to also accept a list of locations, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode a2167a133d 056/222: Fix errors with indentation when line has wide unicode chars., ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 09bdb97c32 065/222: Fix an indentation bug., ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 8b2815514d 088/222: Simplify typescript--backward-to-parameter-list, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode f9cd0dd539 112/222: Try parse new error-format introduced in tsc 2.7+,
ELPA Syncer <=
- [nongnu] elpa/typescript-mode a1cdb7a1ec 121/222: Remove redundant regexp groups for jsdoc tags, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode fd1c9daa4d 094/222: Add failing cases., ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode bd046e0fae 120/222: Add tags in usejsdoc.org, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 3c79132066 136/222: fix warnings from package-lint, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 000131df29 150/222: Update CI-settings, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode b1d1948c15 123/222: Merge pull request #88 from Ptival/fix-indentation-method-calls-keywords, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 039d122384 156/222: add a test for simple tsx, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode c766ec8009 159/222: Include symbol constituents in typescript--function-call-re, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 5e0b9ee095 168/222: Add a test that fails without the following indentation fix., ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 42a60e5c88 190/222: Merge pull request #137 from sirikid/feature/comma-first-lists, ELPA Syncer, 2022/02/06