Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Haskell] company-ghc and hindent not working for a new user #1631

Closed
gregwebs opened this issue May 18, 2015 · 9 comments
Closed

[Haskell] company-ghc and hindent not working for a new user #1631

gregwebs opened this issue May 18, 2015 · 9 comments

Comments

@gregwebs
Copy link

I am using ghc 7.8 on Ubuntu Linux. I installed all the Haskell dependencies (using stackage lts-2.8 for all the dependencies that would install through lts.

I enabled the haskell layer in my ~/.spacemacs

  (haskell :variables haskell-enable-shm-support t
                         haskell-enable-ghci-ng-support t
                         haskell-enable-hindent-style "andrew-gibiansky"
                         haskell-enable-company-mode t

On master, when I open a Haskell file I see the error

Error in post-command-hook (evil-mode-check-buffers): (void-function haskell-indentation-disable-show-indentation)

So I had switched to the develop branch on which I can actually edit a Haskell file.

When emacs opens I don't see any errors in the logs other than something about aspell.

When I open a Haskell file, I see this in the logs:

File mode specification error: (void-function electric-indent-local-mode)

When I do something like hit return in insert mode I see this error

haskell-mode-suggest-indent-choice: You tried to do an indentation command, but an indentation mode has not been enabled yet.

company-ghc-diagnose shows company mode is not configured

* company-ghc backend not found
* automatic scan module is disabled.
  You need to run either 'M-x company-ghc-turn-on-autoscan' once
  or 'M-x company-ghc-scan-modules' when it is necessary.
* ghc-boot process has not been done

I am stuck in a state where I have much less functionality than I had with Vim. Any help is greatly appreciated.

@syl20bnr
Copy link
Owner

First, install aspell to resolve the issue with aspell, it could prevent other hooks to be executed.
What version of Emacs do you use ?

@syl20bnr
Copy link
Owner

Linking it to an oooooooooold issue #9. I should fix this in the next few days.

@gregwebs
Copy link
Author

Is there information for resolving the aspell issue? apt-get install aspell tells me it is already installed.

@syl20bnr
Copy link
Owner

Verify on a terminal if you can execute aspell and then if Emacs can see it by typing :!aspell.

@gregwebs
Copy link
Author

Those both work. The only error I actually see is:

Error while loading 50dictionaries-common: Symbol's value as variable is void: debian-aspell-only-dictionary-alist

But then later it seems to indicate it is working

Starting new Ispell process [aspell::english] ...

@DNNX
Copy link

DNNX commented May 24, 2015

I'm experiencing a similar issue. company-ghc diagnostics gives me this:

* company-ghc backend not found
* automatic scan module is disabled.
  You need to run either 'M-x company-ghc-turn-on-autoscan' once
  or 'M-x company-ghc-scan-modules' when it is necessary.
* ghc-boot process has not been done

Module                                  Alias               Candidates
-------------------------------------------------------------------------------

Can't see any errors related to aspell though. I tried to run aspell in terminal and :!aspell in spacemacs - both time these commands printed aspell usage help, which I think is expected behaviour. BTW, I used stackage as well, just like @gregwebs . The only difference is that I used lts-2.9 rather than 2.8. Not sure if it matters though.

@pseudonom
Copy link
Contributor

I ran into the same problem with Ubuntu's default emacs 24.3. Installing emacs 24.5 from source fixed it.

@martinmr
Copy link

I ran into this problem but I already had version 24.5.

What I did was to move the line

  (add-to-list 'exec-path "~/.cabal/bin/")

from dotspacemacs/init to dotspacemacs/config.

@d12frosted
Copy link
Collaborator

README file now says that you need to place (add-to-list 'exec-path "~/.cabal/bin/") in dotspacemacs/user-config instead of dotspacemacs/user-init on development branch. So that should resolve described problems.
@TheBB pinging you 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants