Rely on LSP to reformat Rust buffers
This commit is contained in:
parent
2f003402d3
commit
c39ea4ff39
1 changed files with 9 additions and 8 deletions
|
|
@ -127,14 +127,17 @@
|
|||
(use-package iedit)
|
||||
(use-package wgrep)
|
||||
|
||||
(use-package lsp-mode
|
||||
:bind (:map lsp-mode-map
|
||||
("M-?" . lsp-find-references))
|
||||
:hook (before-save . (lambda ()
|
||||
(defun reformat-by-lsp ()
|
||||
"Reformat a file using LSP actions."
|
||||
(when (bound-and-true-p lsp-mode)
|
||||
(progn
|
||||
(lsp-organize-imports)
|
||||
(lsp-format-buffer)))))
|
||||
(lsp-format-buffer))))
|
||||
|
||||
(use-package lsp-mode
|
||||
:bind (:map lsp-mode-map
|
||||
("M-?" . lsp-find-references))
|
||||
:hook (before-save . reformat-by-lsp)
|
||||
:init
|
||||
(setq lsp-keymap-prefix "C-z l")
|
||||
:custom
|
||||
|
|
@ -217,6 +220,4 @@ When DEBUG is set, run the test in the debugger."
|
|||
:config
|
||||
(direnv-mode))
|
||||
|
||||
(use-package rustic
|
||||
:custom
|
||||
(rustic-format-on-save t))
|
||||
(use-package rustic)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue