forked from FG42/FG42
Add support for cabal-fmt to haskell mode
This commit is contained in:
parent
78efcb37f0
commit
e10ea654ac
|
@ -48,6 +48,7 @@ in
|
||||||
|
|
||||||
fg42.paths = (with pkgs;[
|
fg42.paths = (with pkgs;[
|
||||||
haskell-language-server
|
haskell-language-server
|
||||||
|
haskellPackages.cabal-fmt
|
||||||
ghc
|
ghc
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
|
|
@ -78,7 +78,8 @@
|
||||||
(haskell-mode . turn-on-haskell-doc-mode)
|
(haskell-mode . turn-on-haskell-doc-mode)
|
||||||
(haskell-mode . haskell-indentation-mode)
|
(haskell-mode . haskell-indentation-mode)
|
||||||
(haskell-mode . haskell-setup-outline-mode)
|
(haskell-mode . haskell-setup-outline-mode)
|
||||||
|
(haskell-mode . (lambda ()
|
||||||
|
(require 'haskell-commands)))
|
||||||
:bind
|
:bind
|
||||||
(:map haskell-mode-map
|
(:map haskell-mode-map
|
||||||
("M-n" . haskell-goto-next-error)
|
("M-n" . haskell-goto-next-error)
|
||||||
|
@ -86,9 +87,18 @@
|
||||||
("C-c c" . haskell-compile)))
|
("C-c c" . haskell-compile)))
|
||||||
|
|
||||||
|
|
||||||
|
(cl-defmethod fg42/format-buffer-for ((mode (eql haskell-cabal-mode)))
|
||||||
|
"Use `cabal-fmt' to format the buffer whenever `haskell-cabal-mode' MODE is active."
|
||||||
|
(message "hehehehehehe")
|
||||||
|
(haskell-mode-buffer-apply-command "cabal-fmt"))
|
||||||
|
|
||||||
|
|
||||||
(use! haskell-cabal-mode
|
(use! haskell-cabal-mode
|
||||||
"Cabal integration."
|
"Cabal integration."
|
||||||
:mode ("\\.cabal\\'"))
|
:mode ("\\.cabal\\'")
|
||||||
|
:hook (haskell-cabal-mode . (lambda ()
|
||||||
|
(require 'haskell-commands))))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
(provide 'fg42/haskell-support)
|
(provide 'fg42/haskell-support)
|
||||||
|
|
Loading…
Reference in New Issue