branch: elpa/dart-mode
commit e338148bdb5ee190c30bb0fbea100b9806ea7108
Author: Natalie Weizenbaum <[email protected]>
Commit: Natalie Weizenbaum <[email protected]>
Get rid of busted flymake and formatter support.
---
dart-mode.el | 105 -----------------------------------------------------------
1 file changed, 105 deletions(-)
diff --git a/dart-mode.el b/dart-mode.el
index eeb80a0..36623fe 100644
--- a/dart-mode.el
+++ b/dart-mode.el
@@ -480,111 +480,6 @@ 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)))
- ;; Work around Dart issue 7497
- (work-dir (expand-file-name
- "flymake-dart-work"
- (flymake-get-temp-dir))))
- (list "dart_analyzer" (list "--error_format" "machine" local-file
- "--work" work-dir))))
-
-(defun flymake-dart-cleanup ()
- "Clean up after running the Dart analyzer."
- (flymake-simple-cleanup)
- (let ((dir-name (expand-file-name
- "flymake-dart-work"
- (flymake-get-temp-dir))))
- (condition-case nil
- (delete-dir dir-name t)
- (error
- (flymake-log 1 "Failed to delete dir %s, error ignored" dir-name)))))
-
-(eval-after-load 'flymake
- '(progn
- (when (boundp 'flymake-warn-line-regexp)
- (add-hook 'dart-mode-hook
- (lambda ()
- (set (make-variable-buffer-local 'flymake-warn-line-regexp)
- "^WARNING|"))))
-
- (defadvice flymake-post-syntax-check (before
flymake-post-syntax-check-dart activate)
- "Sets the exit code of the dart_analyzer process to 0.
-
-dart_analyzer can report errors for files other than the current
-file. flymake dies horribly if the process emits a non-zero exit
-code without any warnings for the current file. These two
-properties interact poorly."
- (when (eq major-mode 'dart-mode)
- (ad-set-arg 0 0)))
-
- (push '("\\.dart\\'" flymake-dart-init flymake-dart-cleanup)
- flymake-allowed-file-name-masks)
- ;; Accept negative numbers to work around Dart issue 7495
- (push
'("^[^|]+|[^|]+|[^|]+|file:\\([^|]+\\)|\\([0-9]+\\)|\\([0-9]+\\)|[0-9]+|\\(.*\\)$"
- 1 2 3 4)
- flymake-err-line-patterns)))
-
-
-;;; Formatter integration
-
-(defcustom dart-format-path "dartformat"
- "The path to the dartformat executable.
-
-Defaults to looking it up on `exec-path'."
- :group 'dart-mode)
-
-(defun dart-format-region (beg end)
- "Run the Dart formatter on the current region.
-
-This uses `dart-format-path' to find the formatter."
- (interactive "r")
- (save-excursion
- (goto-char beg)
- (if (eolp) (forward-char))
- (back-to-indentation)
- (let ((indent (/ (current-column) 2)))
- ;; Make sure that the region starts at the beginning of a line so that
the
- ;; formatter can re-indent it correctly.
- (beginning-of-line)
- (setq beg (point))
-
- ;; Same with the end.
- (goto-char end)
- (unless (bolp)
- (end-of-line)
- (forward-char))
- (setq end (point))
-
- (call-process-region
- beg end dart-format-path t t nil
- "--statement" "--indent" (number-to-string indent)))))
-
-(defun dart-format-statement (pos)
- "Run the Dart formatter on the current statement.
-
-This uses `dart-format-path' to find the formatter."
- (interactive "d")
- (save-excursion
- (dart-beginning-of-statement)
- (let ((beg (point)))
- (loop do (condition-case nil
- (forward-sexp)
- (error (backward-up-list -1)))
- until (if (looking-at "[[:space:]\\n]*\\(;\\)")
- (goto-char (match-end 1))
- (and (eq (char-before) ?})
- (eolp))))
- (dart-format-region beg (point)))))
-
-
;;; Dart analysis server
(cl-defstruct