Skip to content

Commit a4858b9

Browse files
committed
Add error regexps for elixirc and credo
1 parent 01b3324 commit a4858b9

File tree

1 file changed

+63
-1
lines changed

1 file changed

+63
-1
lines changed

elixir-mode.el

Lines changed: 63 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,11 @@
3636

3737
;;; Code:
3838

39+
(require 'compile) ; compilation-error-regexp-alist-alist
3940
(require 'easymenu) ; Elixir Mode menu definition
41+
(require 'elixir-format) ; Elixir Format functions
4042
(require 'elixir-smie) ; Syntax and indentation support
4143
(require 'pkg-info) ; Display Elixir Mode package version
42-
(require 'elixir-format) ; Elixir Format functions
4344

4445
(defgroup elixir nil
4546
"Major mode for editing Elixir code."
@@ -551,6 +552,67 @@ just return nil."
551552
(add-to-list 'auto-mode-alist '("\\.ex\\'" . elixir-mode))
552553
(add-to-list 'auto-mode-alist '("\\.exs\\'" . elixir-mode)))
553554

555+
;;;###autoload
556+
(mapc
557+
(cl-function
558+
(lambda ((symbol . spec))
559+
"Add SPEC to `compilation-error-regexp-alist-alist'."
560+
(setf (alist-get symbol compilation-error-regexp-alist-alist) spec)))
561+
562+
'((elixir-error
563+
"^== Compilation error in file \\(.*\\) ==$"
564+
1 ;; file
565+
nil ;; no line
566+
nil ;; no column
567+
2 ;; type, 2 for error
568+
1 ;; hyperlink; file
569+
)
570+
571+
(elixir-trace
572+
"^ +\\(\\([^:]+\\):\\([0-9]+\\)\\): .*$"
573+
2 ;; file
574+
3 ;; line
575+
nil ;; no column
576+
0 ;; type, 0 for info
577+
1 ;; hyperlink; file & line together
578+
)
579+
580+
(elixir-credo-warning
581+
"^┃ \\[W] . .*\n┃ +\\(\\([^:]+\\):\\([0-9]+\\):\\([0-9]+\\)\\) .*$"
582+
2 ;; file
583+
3 ;; line
584+
4 ;; column
585+
1 ;; type, 1 for warning
586+
1 ;; hyperlink, file, line and column together
587+
)
588+
589+
(elixir-credo-warning-no-column
590+
"^┃ \\[W] . .*\n┃ +\\(\\([^:]+\\):\\([0-9]+\\)\\) .*$"
591+
2 ;; file
592+
3 ;; line
593+
nil ;; no column
594+
1 ;; type, 1 for warning
595+
1 ;; hyperlink, file and line together
596+
)
597+
598+
(elixir-credo-info
599+
"^┃ \\[[^W]] . .*\n┃ +\\(\\([^:]+\\):\\([0-9]+\\):\\([0-9]+\\)\\) .*$"
600+
2 ;; file
601+
3 ;; line
602+
4 ;; column
603+
0 ;; type, 0 for info
604+
1 ;; hyperlink, file, line and column together
605+
)
606+
607+
(elixir-credo-info-no-column
608+
"^┃ \\[[^W]] . .*\n┃ +\\(\\([^:]+\\):\\([0-9]+\\)\\) .*$"
609+
2 ;; file
610+
3 ;; line
611+
nil ;; no column
612+
0 ;; type, 0 for info
613+
1 ;; hyperlink, file and line together
614+
)))
615+
554616
(provide 'elixir-mode)
555617

556618
;;; elixir-mode.el ends here

0 commit comments

Comments
 (0)