10

I can't get hlint suggestions to appear in emacs using intero.

  • I have a new installation of emacs 24.5
  • I added the intero stuff at here into new ~/.emacs file
  • I've done nothing else to emacs.

I've read that the solution is:

(flycheck-add-next-checker 'intero
                           '(warning . haskell-hlint))

But I don't know what I'm supposed to do with this. If I add it to my ~/.emacs file then emacs fails on start up.

(The rest seems OK - intero starts when I open a Haskell file - errors are immediately flagged as I type.)

How do I get Hlint suggestions to appear?

BillyBadBoy
  • 552
  • 3
  • 18
  • Have you installed `hlint` ? – Sibi Nov 03 '16 at 12:18
  • hlint is installed in my stack project, i.e. I can run `stack exec hlint` but it's not installed globally. – BillyBadBoy Nov 03 '16 at 12:21
  • Can you do the following checks: 1) See if your hlint executable is in the correct path which your flycheck recognizes. Explictly add in the variable `exec-path`, if it's not in that path. I usually install hlint globally via stack and use that for my emacs session. 2) If 1st method is not the problem, then try running this emacs command: `intero-info` and then see if flycheck shows the hlint warnings for you. – Sibi Nov 03 '16 at 12:37
  • And just to ask the most obvious think - does your file actually have any warnings ? :-) You can check that by running hlint manually on the file. – Sibi Nov 03 '16 at 12:42

1 Answers1

2

Fixed by adding this to my ~/.emacs file:

;; do linting on-the-fly 
(with-eval-after-load 'intero
  (flycheck-add-next-checker 'intero '(warning . haskell-hlint))
)

(The full ~/.emacs file can be viewed here)

Syscall
  • 19,327
  • 10
  • 37
  • 52
BillyBadBoy
  • 552
  • 3
  • 18