Lazy load ghc-comp-init in haskell layer

This commit is contained in:
syl20bnr 2015-02-14 22:45:14 -05:00
parent ff0a04dcef
commit 66e38ec962

View file

@ -12,6 +12,7 @@
(defvar haskell-packages
'(
company-ghc
flycheck
flycheck-haskell
ghc
@ -19,10 +20,6 @@
hi2
))
;; Only load company-ghc if company-mode is enabled
(when (member 'company-mode dotspacemacs-configuration-layers)
(add-to-list 'haskell-packages 'company-ghc))
(defun haskell/init-flycheck ()
;;(add-hook 'haskell-mode-hook 'flycheck-mode))
(add-hook 'flycheck-mode-hook 'flycheck-haskell-setup))
@ -161,11 +158,12 @@
(define-key haskell-cabal-mode-map [?\C-c ?\C-z] 'haskell-interactive-switch)))))
(defun haskell/init-company-ghc ()
(use-package ghc
:init
(add-to-list 'company-backends 'company-ghc)
(ghc-comp-init)
))
(use-package company-ghc
:if (configuration-layer/layer-declaredp 'company-mode)
:init
(progn
(add-to-list 'company-backends 'company-ghc)
(add-hook 'haskell-mode-hook 'ghc-comp-init))))
(defun haskell/init-hi2 ()
(use-package hi2