Remove redundant +default/lsp-format-region-or-buffer command

This commit is contained in:
Henrik Lissner 2020-05-06 15:14:16 -04:00
parent bc0477c3ba
commit da2247e3d6
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
2 changed files with 3 additions and 12 deletions

View file

@ -36,17 +36,6 @@ If ARG (universal argument), runs `compile' from the current directory."
(with-current-buffer buffer
(funcall (default-value 'major-mode))))))
;;;###autoload
(defun +default/lsp-format-region-or-buffer ()
"Format the buffer (or selection) with LSP."
(interactive)
(unless (bound-and-true-p lsp-mode)
(user-error "Not in an LSP buffer"))
(call-interactively
(if (doom-region-active-p)
#'lsp-format-region
#'lsp-format-buffer)))
;;;###autoload
(defun +default/restart-server ()
"Restart the Emacs server."

View file

@ -220,7 +220,9 @@ is selected)."
(interactive)
(call-interactively
(if (bound-and-true-p lsp-mode)
#'+default/lsp-format-region-or-buffer
(if (doom-region-active-p)
#'lsp-format-region
#'lsp-format-buffer)
(if (use-region-p)
#'+format/region
#'+format/buffer))))