branch: elpa/dart-mode
commit 9be0c64d6dd7042bf2143a9a163ae50cc1d25556
Author: Nathan Weizenbaum <[email protected]>
Commit: Nathan Weizenbaum <[email protected]>
Add support for flymake.
---
dart-mode.el | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/dart-mode.el b/dart-mode.el
index da557ea..0a94ee7 100644
--- a/dart-mode.el
+++ b/dart-mode.el
@@ -456,6 +456,24 @@ Each list item should be a regexp matching a single
identifier.")
(funcall (c-lang-const c-make-mode-syntax-table dart))))
+;;; Flymake Support
+
+(defun flymake-dart-init ()
+ "Return the dart_analyzer command to invoke for flymake."
+ (let* ((temp-file (flymake-init-create-temp-buffer-copy
+ 'flymake-create-temp-inplace))
+ (local-file (file-relative-name
+ temp-file
+ (file-name-directory buffer-file-name))))
+ (list "dart_analyzer" (list "--error_format" "machine" local-file))))
+
+(eval-after-load 'flymake
+ '(progn
+ (push '("\\.dart\\'" flymake-dart-init) flymake-allowed-file-name-masks)
+ (push
'("^[^|]+|[^|]+|[^|]+|file:\\([^|]+\\)|\\([0-9]+\\)|\\([0-9]+\\)|[0-9]+|\\(.*\\)$"
1 2 3 4)
+ flymake-err-line-patterns)))
+
+
;;; Initialization
;;;###autoload (add-to-list 'auto-mode-alist '("\\.dart\\'" . dart-mode))