Closed MichaelXavier closed 10 years ago
Hi, thank you for trying company-ghc.
Instead of M-x ghc-debug
, check *GHC Debug*
buffer. (You need to set ghc-debug
before visiting the haskell file)
The most likely cause is failure of cabal configure
(invoked by ghc-mod
), due to e.g. missing dependency.
What happens if run ghc-mod boot
from shell or command prompt in the project directory?
Thanks for the fast respones! Ah yes, I forgot to take that out. The buffer I was looking at was indeed GHC Debug
You were onto something about booting ghc-mod. It didn't work, because I forgot that I had upgraded ghc versions which invalidated my sandbox. I tore it down and rebuilt it. Now, when I boot, I get a massive list of modules, functions, etc (which I assume is what I want).
However, it doesn't appear to be working. I'm testing it out by adding language pragmas and it fails to complete the pragma. Diagnose still shows all 0s and nils. The output in GHC Debug seems useless:
% ghc --version
The Glorious Glasgow Haskell Compilation System, version 7.8.3
% ghc-mod version
ghc-mod version 5.0.1 compiled by GHC 7.8.3
% ghc-modi version
ghc-modi version 5.0.1 compiled by GHC 7.8.3
% ghc --version
The Glorious Glasgow Haskell Compilation System, version 7.8.3
% ghc-mod version
ghc-mod version 5.0.1 compiled by GHC 7.8.3
% ghc-modi version
ghc-modi version 5.0.1 compiled by GHC 7.8.3
Now, when I boot, I get a massive list of modules, functions, etc (which I assume is what I want).
So it seems ghc-mod boot
is working.
However, it doesn't appear to be working. I'm testing it out by adding language pragmas and it fails to complete the pragma. Diagnose still shows all 0s and nils. The output in GHC Debug seems useless:
You are using flycheck (me too), so you don't call ghc-init
in haskell-mode-hook
, do you?
(which enables ghc-mod own error checker)
If ghc-init
is not called, then at least ghc-comp-init
(and ghc-import-module
optionally) needs to be called for company-ghc to work.
My hook is like the following.
(defun my-ghc-haskell-mode-hook ()
(ghc-abbrev-init)
(ghc-type-init)
(unless my-ghc-initialized
(ghc-comp-init)
;; (snip) misc keybinding here..
(setq my-ghc-initialized t))
(ghc-import-module))
I will update README and possibly company-ghc-diagnose
function.
I will update README and possibly company-ghc-diagnose function.
Done.
I went down the path of investigating ghc-mod from this and ended up working it out. Thanks!
You're welcome.
BTW, I'm using Angel on my server. Thank you!
@iquiw Having a similar problem. Reading about this: http://stackoverflow.com/a/28049104/750216 I downgraded cabal-install
to 1.20.0.6
and rebuilt the packages but that did not solve the problem. I will try upgrading to GHC 7.10.1, maybe that solves the problem.
ghc-mod does not build with 7.10.1 yet https://github.com/kazu-yamamoto/ghc-mod/issues/437
@razvan-panda It is probably ghc-mod
issue.
ghc-mod#437 is marked as "Fixed in master", so you can install it from github.
Hi!
I've been unable to successfully use company-ghci. Running
company-ghc-diagnose
shows nil and 0 completions:Before you invite me to RTFM, I have read the troubleshooting steps on this:
M-: (setq ghc-debug t)
and thenM-x ghc-debug
. Nothing jumps out me as erroneous:I'm using flycheck-haskell and haskell-mode. I'm happy to provide any additional details you find necessary and thankk you in advance for any help you can provide with debugging.