emacsorphanage / dart-mode

An Emacs mode for the Dart language
GNU General Public License v3.0
15 stars 2 forks source link

dart-format-on-save not work. #116

Closed zw963 closed 3 years ago

zw963 commented 3 years ago

I saw you move dart server code into a seperate repo, but wiki never update.

  commit c5681185359c7db54756d7935de421da8eef37c7
    Author: Brady Trainor <redacted>
    Date:   Tue Aug 6 23:39:45 2019 -0700

        Move dart server code to a separate repo

  diff --git a/dart-mode.el b/dart-mode.el

so, where is the repo you move dart-format-on-save to ?

how to continue use this feature?

thank you

zw963 commented 3 years ago

oh, i knew it.

https://github.com/bradyt/dart-server

bradyt commented 3 years ago

Thank you for the issue.

I've been using reformatter, with:

(reformatter-define dart-format
  :program "dart"
  :args '("format"))

(with-eval-after-load "dart-mode"
  (define-key dart-mode-map (kbd "C-c C-o") 'dart-format-buffer))

;; (with-eval-after-load "dart-mode"
;;   (bind-key "C-c C-o" 'dart-format-buffer dart-mode-map))

I haven't used dart-server in some time, I was often concerned it might use more RAM than should be necessary.

I've added a quick note to the wiki for that. If I missed something, please let me know.

Regarding formatting on save, I never really used that. Maybe we'd use some sort of dart-mode-hook that sets a buffer-local before-save-hook to call a formatter, such as reformatter's dart-format-buffer.

zw963 commented 3 years ago

Glad to see WiKi get updated, thank you.