Another question regarding settting up a nice Haskell environment in Emacs.
Since intero was abandoned I've been using HLS and lsp-haskell (via Spacemacs). It's working really well, but there's one slightly strange behaviour I've obeserved regarding syntax checking with flycheck.
The lsp checker doesn't warn on a few things that I like to have warnings on, e.g. imports of unused modules, so I have configured a chain like this:
Flycheck is a modern on-the-fly syntax checking extension for GNU Emacs,
intended as replacement for the older Flymake extension which is part of GNU
Emacs. For a detailed comparison to Flymake see Flycheck versus Flymake.
I use eglot instead of the lsp package because I find it to be a bit more sane. With HLS it works out of the box for warnings, errors, and hints. The only downside is that it uses flymake instead of flycheck.
Another question regarding settting up a nice Haskell environment in Emacs.
Since
intero
was abandoned I've been using HLS and lsp-haskell (via Spacemacs). It's working really well, but there's one slightly strange behaviour I've obeserved regarding syntax checking with flycheck.The
lsp
checker doesn't warn on a few things that I like to have warnings on, e.g. imports of unused modules, so I have configured a chain like this:That almost works like I want, in order to get errors from all checkers in the first file I open I have to either
(flycheck-start-current-syntax-check 'lsp)
, orI tried adding
(flycheck-start-current-syntax-check 'lsp)
to the hook (after setting the next checker), but that made no difference.I must be doing something wrong!
There's clearly some timing issue, but what can I do to fix it?
Am I even putting the chain setup on a good
hook
?I use eglot instead of the
lsp
package because I find it to be a bit more sane. With HLS it works out of the box for warnings, errors, and hints. The only downside is that it usesflymake
instead offlycheck
.This is my Emacs + Haskell setup: https://github.com/pjones/emacsrc/blob/trunk/modes/haskell-mode-conf.el
I guess my search continues...
After quite a bit of trial and error I managed to find something that works: https://magnus.therning.org/posts/2021-03-05-000-flycheck-and-hls.html
Suggestions and improvements are always welcome, of course!