emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/typescript-mode a2c2ff03e7 024/222: Add support for compil


From: ELPA Syncer
Subject: [nongnu] elpa/typescript-mode a2c2ff03e7 024/222: Add support for compilation-mode.
Date: Sun, 6 Feb 2022 16:59:00 -0500 (EST)

branch: elpa/typescript-mode
commit a2c2ff03e72dc92daf140f56f9be3ced5d22c072
Author: Jostein Kjønigsen <jostein@kjonigsen.net>
Commit: Jostein Kjønigsen <jostein@kjonigsen.net>

    Add support for compilation-mode.
---
 typescript-mode.el | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/typescript-mode.el b/typescript-mode.el
index 4c70034968..7217871faa 100644
--- a/typescript-mode.el
+++ b/typescript-mode.el
@@ -52,6 +52,7 @@
 ;;; Code:
 
 (eval-and-compile
+  (require 'compile)
   (require 'cc-mode)
   (require 'font-lock)
   (require 'newcomment)
@@ -1981,6 +1982,20 @@ the broken-down class name of the item to insert."
 
    (cdr pitem)))
 
+;;; compilation-mode support
+
+;; handle 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'.
+(add-to-list 'compilation-error-regexp-alist 'typescript-mode)
+(add-to-list 'compilation-error-regexp-alist-alist
+             (list 'typescript-mode
+                   (concat
+                    "^[[:blank:]]*"
+                    "\\([^(\r\n)]+\\)(\\([0-9]+\\),\\([0-9]+\\)):[[:blank:]]+"
+                    "error [[:alnum:]]+: [^\r\n]+$")
+                   1 2 3 1))
+
 ;;; Main Function
 
 (defalias 'typescript-parent-mode



reply via email to

[Prev in Thread] Current Thread [Next in Thread]