Last active
November 14, 2016 01:50
-
-
Save krisajenkins/6417f196291d8d387976 to your computer and use it in GitHub Desktop.
GHCi REPL-style completions for company-mode
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(require 'cl-lib) | |
(require 'thingatpt) | |
(defun haskell-process-completions-at-point () | |
"A company-mode-compatible complete-at-point function." | |
(-when-let (process (haskell-process)) | |
(-when-let (symbol (symbol-at-point)) | |
(destructuring-bind (start . end) (bounds-of-thing-at-point 'symbol) | |
(let ((completions (haskell-process-get-repl-completions (haskell-process) | |
(symbol-name symbol)))) | |
(list start end completions)))))) | |
(add-hook 'haskell-mode-hook | |
(lambda () | |
(setq-local completion-at-point-functions | |
'(haskell-process-completions-at-point)))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is now integrated into haskell-mode, so find it there m'friends...