Closed bradyt closed 5 years ago
In Windows, with (setq debug-on-error t), when I call dart-format with C-c C-o, I get the following backtrace.
(setq debug-on-error t)
dart-format
C-c C-o
Debugger entered--Lisp error: (file-missing "Searching for program" "No such file or directory" "c:/tools/dart-sdk/bin/dartfmt.exe") call-process("c:/tools/dart-sdk/bin/dartfmt.exe" nil #<buffer *Dart formatter errors*> nil "--line-length" "80" "--overwrite" "c:/Users/ADMINI~1/AppData/Local/Temp/2/formatxhLOUd.dart") apply(call-process "c:/tools/dart-sdk/bin/dartfmt.exe" nil #<buffer *Dart formatter errors*> nil ("--line-length" "80" "--overwrite" "c:/Users/ADMINI~1/AppData/Local/Temp/2/formatxhLOUd.dart")) (= 0 (apply (function call-process) (dart-formatter-command) nil error-buffer nil args)) (if (= 0 (apply (function call-process) (dart-formatter-command) nil error-buffer nil args)) nil (message "Formatting failed") (if error-buffer (progn (dart--formatter-show-errors error-buffer file (buffer-file-name)))) (throw '--cl-block-dart-format-- nil)) (save-restriction (widen) (if error-buffer (progn (save-current-buffer (set-buffer error-buffer) (setq buffer-read-only nil) (erase-buffer)))) (write-region nil nil file nil 'no-message) (dart-info (format "%s %s" (dart-formatter-command) args)) (if (= 0 (apply (function call-process) (dart-formatter-command) nil error-buffer nil args)) nil (message "Formatting failed") (if error-buffer (progn (dart--formatter-show-errors error-buffer file (buffer-file-name)))) (throw '--cl-block-dart-format-- nil)) (if (= 0 (call-process-region (point-min) (point-max) "diff" nil patch-buffer nil "--rcs" "-" file)) (message "Buffer is already formatted") (dart--apply-rcs-patch patch-buffer) (message "Formatted buffer")) (if error-buffer (progn (dart--kill-buffer-and-window error-buffer)))) (unwind-protect (save-restriction (widen) (if error-buffer (progn (save-current-buffer (set-buffer error-buffer) (setq buffer-read-only nil) (erase-buffer)))) (write-region nil nil file nil 'no-message) (dart-info (format "%s %s" (dart-formatter-command) args)) (if (= 0 (apply (function call-process) (dart-formatter-command) nil error-buffer nil args)) nil (message "Formatting failed") (if error-buffer (progn (dart--formatter-show-errors error-buffer file (buffer-file-name)))) (throw '--cl-block-dart-format-- nil)) (if (= 0 (call-process-region (point-min) (point-max) "diff" nil patch-buffer nil "--rcs" "-" file)) (message "Buffer is already formatted") (dart--apply-rcs-patch patch-buffer) (message "Formatted buffer")) (if error-buffer (progn (dart--kill-buffer-and-window error-buffer)))) (kill-buffer patch-buffer) (delete-file file)) (let* ((file (make-temp-file "format" nil ".dart")) (patch-buffer (get-buffer-create "*Dart formatter patch*")) (error-buffer (if dart-formatter-show-errors (progn (get-buffer-create "*Dart formatter errors*")))) (coding-system-for-read 'utf-8) (coding-system-for-write 'utf-8) (args (list "--line-length" (number-to-string dart-formatter-line-length) "--overwrite" file))) (unwind-protect (save-restriction (widen) (if error-buffer (progn (save-current-buffer (set-buffer error-buffer) (setq buffer-read-only nil) (erase-buffer)))) (write-region nil nil file nil 'no-message) (dart-info (format "%s %s" (dart-formatter-command) args)) (if (= 0 (apply (function call-process) (dart-formatter-command) nil error-buffer nil args)) nil (message "Formatting failed") (if error-buffer (progn (dart--formatter-show-errors error-buffer file (buffer-file-name)))) (throw '--cl-block-dart-format-- nil)) (if (= 0 (call-process-region (point-min) (point-max) "diff" nil patch-buffer nil "--rcs" "-" file)) (message "Buffer is already formatted") (dart--apply-rcs-patch patch-buffer) (message "Formatted buffer")) (if error-buffer (progn (dart--kill-buffer-and-window error-buffer)))) (kill-buffer patch-buffer) (delete-file file))) (catch '--cl-block-dart-format-- (let* ((file (make-temp-file "format" nil ".dart")) (patch-buffer (get-buffer-create "*Dart formatter patch*")) (error-buffer (if dart-formatter-show-errors (progn (get-buffer-create "*Dart formatter errors*")))) (coding-system-for-read 'utf-8) (coding-system-for-write 'utf-8) (args (list "--line-length" (number-to-string dart-formatter-line-length) "--overwrite" file))) (unwind-protect (save-restriction (widen) (if error-buffer (progn (save-current-buffer (set-buffer error-buffer) (setq buffer-read-only nil) (erase-buffer)))) (write-region nil nil file nil 'no-message) (dart-info (format "%s %s" (dart-formatter-command) args)) (if (= 0 (apply (function call-process) (dart-formatter-command) nil error-buffer nil args)) nil (message "Formatting failed") (if error-buffer (progn (dart--formatter-show-errors error-buffer file (buffer-file-name)))) (throw '--cl-block-dart-format-- nil)) (if (= 0 (call-process-region (point-min) (point-max) "diff" nil patch-buffer nil "--rcs" "-" file)) (message "Buffer is already formatted") (dart--apply-rcs-patch patch-buffer) (message "Formatted buffer")) (if error-buffer (progn (dart--kill-buffer-and-window error-buffer)))) (kill-buffer patch-buffer) (delete-file file)))) dart-format() funcall-interactively(dart-format) call-interactively(dart-format nil nil) command-execute(dart-format)
Presumably fixed in https://github.com/bradyt/dart-mode/commit/da244c6b9ee2d97c4dfacb93c2ec5f54d35c27de.
In Windows, with
(setq debug-on-error t)
, when I calldart-format
withC-c C-o
, I get the following backtrace.