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
|
;;; module-haskell.el
|
||||||
|
|
||||||
;; requires cabal (flycheck), ghci/hugs (repl)
|
|
||||||
|
|
||||||
(def-package! haskell-mode
|
(def-package! haskell-mode
|
||||||
:mode (("\\.hs$" . haskell-mode)
|
:mode "\\.hs$"
|
||||||
("\\.ghci$" . ghci-script-mode)
|
:mode ("\\.ghci$" . ghci-script-mode)
|
||||||
("\\.cabal$" . haskell-cabal-mode))
|
:mode ("\\.cabal$" . haskell-cabal-mode)
|
||||||
:interpreter (("runghc" . haskell-mode)
|
:interpreter (("runghc" . haskell-mode)
|
||||||
("runhaskell" . haskell-mode))
|
("runhaskell" . haskell-mode))
|
||||||
:config
|
:config
|
||||||
(load "haskell-mode-autoloads" nil t)
|
(load "haskell-mode-autoloads" nil t)
|
||||||
|
|
||||||
(set! :popup "*debug:haskell*" :size 20)
|
|
||||||
(set! :repl 'haskell-mode #'switch-to-haskell)
|
(set! :repl 'haskell-mode #'switch-to-haskell)
|
||||||
|
|
||||||
(push ".hi" completion-ignored-extensions)
|
(push ".hi" completion-ignored-extensions)
|
||||||
|
|
||||||
(autoload 'switch-to-haskell "inf-haskell" nil t)
|
(autoload 'switch-to-haskell "inf-haskell" nil t)
|
||||||
|
@ -23,7 +21,18 @@
|
||||||
(def-package! dante
|
(def-package! dante
|
||||||
:after haskell-mode
|
:after haskell-mode
|
||||||
:config
|
:config
|
||||||
(when (executable-find "cabal")
|
(if (executable-find "cabal")
|
||||||
(add-hook! 'haskell-mode-hook
|
(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; -*-
|
;; -*- no-byte-compile: t; -*-
|
||||||
;;; lang/haskell/packages.el
|
;;; lang/haskell/packages.el
|
||||||
|
|
||||||
;; requires haskell cabal-install ghz happy alex
|
|
||||||
|
|
||||||
(package! haskell-mode)
|
(package! haskell-mode)
|
||||||
(package! dante)
|
(package! dante)
|
||||||
|
|
||||||
|
(when (featurep! :completion company)
|
||||||
|
(package! company-ghc))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue