From 2a4e0a964ec915865ddafded2757fab97fa4ff3b Mon Sep 17 00:00:00 2001 From: jao Date: Mon, 3 Oct 2022 02:33:03 +0100 Subject: hlint-refactor/flymake-hlint (not sure if we need eglot/lsp) --- init.el | 34 ++++++++++++++++++++++++++-------- 1 file changed, 26 insertions(+), 8 deletions(-) diff --git a/init.el b/init.el index bbdab46..2c57fd3 100644 --- a/init.el +++ b/init.el @@ -1988,18 +1988,23 @@ (use-package flymake :ensure t :custom ((flymake-mode-line-format '(" " flymake-mode-line-counters))) - :config (jao-define-attached-buffer "^\\*Flymake diagnostics .*\\*\\'") - :bind (:map flymake-mode-map (("M-m n" . flymake-goto-next-error) - ("M-m p" . flymake-goto-prev-error) - ("M-m i" . flymake-show-diagnostic) - ("M-m f" . flymake-show-buffer-diagnostics) - ("M-m l" . consult-flymake)))) + :config + (jao-define-attached-buffer "^\\*Flymake diagnostics .*\\*\\'") + + (transient-define-prefix jao-transient-flymake () + ["Flymake" + ("d" "show diagnostics" flymake-show-buffer-diagnostics) + ("i" "show diagnostic" flymake-show-diagnostic) + ("n" "next error" flymake-goto-next-error) + ("p" "previous error" flymake-goto-prev-error) + ("c" "consult flymake" consult-flymake)]) + + :bind (:map flymake-mode-map (("M-m" . jao-transient-flymake)))) ;;;; eglot (use-package eglot :ensure t - :bind (:map eglot-mode-map (("C-h ." . jao-eldoc-toggle))) - :hook ((haskell-mode . eglot-ensure))) + :bind (:map eglot-mode-map (("C-h ." . jao-eldoc-toggle)))) ;;;; workarounds (setq c-type-finder-time-slot nil) @@ -2250,6 +2255,19 @@ ("C-M-p" . flymake-goto-prev-error) ("" . haskell-session-kill)))) +(use-package hlint-refactor + :ensure t + :after haskell-mode + :hook ((haskell-mode . hlint-refactor-mode)) + :bind (:map haskell-mode-map (("C-M-h" . 'hlint-refactor-refactor-at-point) + ("C-M-S-h" . 'hlint-refactor-refactor-buffer))) + :diminish) + +(use-package flymake-hlint + :ensure t + :after haskell-mode + :hook ((haskell-mode . flymake-hlint-load))) + (require 'haskell) (diminish 'interactive-haskell-mode " λ") -- cgit v1.2.3