lang/haskell: refactor + add company-ghc
This commit is contained in:
parent
e1f60b2bfd
commit
0e78cde69d
2 changed files with 20 additions and 10 deletions
|
@ -1,18 +1,16 @@
|
|||
;;; module-haskell.el
|
||||
|
||||
;; requires cabal (flycheck), ghci/hugs (repl)
|
||||
|
||||
(def-package! haskell-mode
|
||||
:mode (("\\.hs$" . haskell-mode)
|
||||
("\\.ghci$" . ghci-script-mode)
|
||||
("\\.cabal$" . haskell-cabal-mode))
|
||||
:mode "\\.hs$"
|
||||
:mode ("\\.ghci$" . ghci-script-mode)
|
||||
:mode ("\\.cabal$" . haskell-cabal-mode)
|
||||
:interpreter (("runghc" . haskell-mode)
|
||||
("runhaskell" . haskell-mode))
|
||||
:config
|
||||
(load "haskell-mode-autoloads" nil t)
|
||||
|
||||
(set! :popup "*debug:haskell*" :size 20)
|
||||
(set! :repl 'haskell-mode #'switch-to-haskell)
|
||||
|
||||
(push ".hi" completion-ignored-extensions)
|
||||
|
||||
(autoload 'switch-to-haskell "inf-haskell" nil t)
|
||||
|
@ -23,7 +21,18 @@
|
|||
(def-package! dante
|
||||
:after haskell-mode
|
||||
:config
|
||||
(when (executable-find "cabal")
|
||||
(if (executable-find "cabal")
|
||||
(add-hook! 'haskell-mode-hook
|
||||
#'(flycheck-mode dante-mode interactive-haskell-mode))))
|
||||
#'(flycheck-mode dante-mode interactive-haskell-mode))
|
||||
(warn "haskell-mode: couldn't find cabal")))
|
||||
|
||||
|
||||
(def-package! company-ghc
|
||||
:when (featurep! :completion company)
|
||||
:after haskell-mode
|
||||
:config
|
||||
(set! :company-backend 'haskell-mode #'company-ghc)
|
||||
(setq company-ghc-show-info 'oneline)
|
||||
(if (executable-find "ghc-mod")
|
||||
(add-hook 'haskell-mode-hook #'ghc-comp-init)
|
||||
(warn "haskell-mode: couldn't find ghc-mode")))
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
;; -*- no-byte-compile: t; -*-
|
||||
;;; lang/haskell/packages.el
|
||||
|
||||
;; requires haskell cabal-install ghz happy alex
|
||||
|
||||
(package! haskell-mode)
|
||||
(package! dante)
|
||||
|
||||
(when (featurep! :completion company)
|
||||
(package! company-ghc))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue