syl20bnr / spacemacs

A community-driven Emacs distribution - The best editor is neither Emacs nor Vim, it's Emacs *and* Vim!
http://spacemacs.org
GNU General Public License v3.0
23.67k stars 4.89k forks source link

Intero mode won't start for Stack-based Haskell project #6733

Closed mands closed 8 years ago

mands commented 8 years ago

Intero mode won't start for Stack-based Haskell project

Description :octocat:

I can't seem to get intero mode to load when opening a stack-based Haskell project. It always starts company-ghci instead even though I've configured intero within .spacemacs.

Intero starts normally within the same project using vanilla emacs. I can also manually start Intero within spacemacs per buffer with M-x intero-mode however this doesn't enable the key-bindings (e.g. SPC m i is not defined). Perhaps unrelated, but layer will force-install Intero version 0.1.15, even though stack wants to install 0.1.16.

Have updated all packages but no luck.

Other system info

Stack version - Version 1.1.2, Git revision cebe10e845fed4420b6224d97dcabf20477bbd4b (3646 commits) x86_64 hpack-0.14.0 GHC - 7.10.3 from lts-6.7 (installed via Stack, no system ghc present) Intero - 0.1.15 Shell - fish

Reproduction guide :beetle:

Observed behaviour: :eyes: :broken_heart:

Expected behaviour: :heart: :smile:

(helm emacs-lisp
      (haskell :variables haskell-completion-backend 'intero haskell-process-type 'stack-ghci))

Backtrace :paw_prints:

<<BACKTRACE IF RELEVANT>>
d12frosted commented 8 years ago

That's interesting. I have pretty similar setup to yours (except I am on OS X). Are you sure you don't have any configs for Haskell development? Could you try M-: spacemacs-haskell//setup-completion-backend <ret> while editing any hs file. Does it turn on intero? If not, could you please share the value of haskell-completion-backend (SPC h d v haskell-completion-backend)?

mands commented 8 years ago

Thanks for replying.

So running M-: spacemacs-haskell//setup-completion-backend <ret> returns the following backtrace:

Debugger entered--Lisp error: (void-variable spacemacs-haskell//setup-completion-backend)
  eval(spacemacs-haskell//setup-completion-backend nil)
  eval-expression(spacemacs-haskell//setup-completion-backend nil)
  funcall-interactively(eval-expression spacemacs-haskell//setup-completion-backend nil)
  call-interactively(eval-expression nil nil)
  command-execute(eval-expression)

And SPC h d v haskell-completion-backend returns this:

haskell-completion-backend is a variable defined in ‘config.el’.
Its value is ‘intero’

Documentation:
Completion backend used by company.
Available options are ‘ghci’, ‘intero’ and ‘ghc-mod’. Default is
‘ghci’.
mands commented 8 years ago

Just to add - no, don't think I have any other configs around - it's a clean install of emacs (on Fedora 24) with a brand new .emacs.d and .spacemacs along with running stack setup to make sure .stack is setup correctly.

TheBB commented 8 years ago

I guess @d12frosted meant M-: (spacemacs-haskell//setup-completion-backend), with parentheses.

mands commented 8 years ago

Ah ok - M-: (spacemacs-haskell//setup-completion-backend) from a .hs file returns nil and doesn't startup Intero.

d12frosted commented 8 years ago

@mands @TheBB oh yeah, I've meant with parentheses.

I think I know what's wrong with your setup. intero works only when company is used. So you have to enable auto-completion layer.

d12frosted commented 8 years ago

I've sent a PR that should help to avoid such situations.

Also it's not stated in readme that you have to enable auto-completion layer. So @mands thanks for bringing this issue up! 👍

mands commented 8 years ago

Yep - adding the auto-completion layer did the trick - intero then booted up immediately :) Thanks for the quick response/fix!

d12frosted commented 8 years ago

Fixed with released of Spacemacs v0.200. Let us know if you still have any problems with this issue.