Skip to content

Commit

Permalink
haskell: use ghc-mod for "mhi" and "mht" bindings when enabled
Browse files Browse the repository at this point in the history
ghc-mod can get type / info without having to manually push the code to
REPL first. syl20bnr#3173
  • Loading branch information
tko committed Sep 29, 2015
1 parent cd3fb97 commit 5c8b84b
Showing 1 changed file with 18 additions and 7 deletions.
25 changes: 18 additions & 7 deletions layers/+lang/haskell/packages.el
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,16 @@
:if haskell-enable-ghc-mod-support
:init (add-hook 'haskell-mode-hook 'ghc-init)
:config
(when (configuration-layer/package-usedp 'flycheck)
;; remove overlays from ghc-check.el if flycheck is enabled
(set-face-attribute 'ghc-face-error nil :underline nil)
(set-face-attribute 'ghc-face-warn nil :underline nil))))
(progn
(when (configuration-layer/package-usedp 'flycheck)
;; remove overlays from ghc-check.el if flycheck is enabled
(set-face-attribute 'ghc-face-error nil :underline nil)
(set-face-attribute 'ghc-face-warn nil :underline nil))

(evil-leader/set-key-for-mode 'haskell-mode
"mhi" 'ghc-show-info
"mht" 'ghc-show-type) ; conflict with ghci-ng below?
)))

(defun haskell/init-haskell-mode ()
(use-package haskell-mode
Expand Down Expand Up @@ -108,8 +114,6 @@

"mhd" 'inferior-haskell-find-haddock
"mhh" 'hoogle
"mhi" 'haskell-process-do-info
"mht" 'haskell-process-do-type
"mhT" 'spacemacs/haskell-process-do-type-on-prev-line
"mhy" 'hayoo

Expand All @@ -122,6 +126,13 @@
"mda" 'haskell-debug/abandon
"mdr" 'haskell-debug/refresh)

(unless haskell-enable-ghc-mod-support
(evil-leader/set-key-for-mode 'haskell-mode
"mhi" 'haskell-process-do-info
"mht" 'haskell-process-do-type ; conflict with ghci-ng below?
)
)

;; Switch back to editor from REPL
(evil-leader/set-key-for-mode 'haskell-interactive-mode
"msS" 'haskell-interactive-switch)
Expand Down Expand Up @@ -161,7 +172,7 @@

(evil-leader/set-key-for-mode 'haskell-mode
"mu" 'haskell-mode-find-uses
"mht" 'haskell-mode-show-type-at
"mht" 'haskell-mode-show-type-at ; conflict with ghc-mod?
"mgg" 'haskell-mode-goto-loc))

;; Useful to have these keybindings for .cabal files, too.
Expand Down

0 comments on commit 5c8b84b

Please sign in to comment.