emacs-lsp / lsp-haskell

lsp-mode :heart: haskell
https://emacs-lsp.github.io/lsp-haskell
GNU General Public License v3.0
227 stars 56 forks source link

Doesn't appear to recognise literate Haskell mode files. #119

Closed zac-garby closed 3 years ago

zac-garby commented 3 years ago

I've added these two lines to my .emacs:

(add-hook 'haskell-mode-hook #'lsp)
(add-hook 'haskell-literate-mode-hook #'lsp)

When I open a .hs file, the LSP opens up properly and everything works fine with the Haskell language server.

However, when I open a .lhs file, I get the following error message.

Screenshot 2021-03-22 at 10 55 27

I've had a look through the settings for lsp-mode and lsp-haskell but I haven't found any fix for this, so I'm hoping this would be the right place to ask.

Thanks!

zac-garby commented 3 years ago

The strange thing is, it definitely should work, looking at the code for lsp-haskell,

    ;; Should run under haskell-mode and haskell-literate-mode. We need to list the
    ;; latter even though it's a derived mode of the former
    :major-modes '(haskell-mode haskell-literate-mode)

So I'm not sure what I might have done wrong.

EDIT: I may have found the problem? It seems that the literate Haskell mode in emacs is called literate-haskell-mode, but this package refers to it as haskell-literate-mode.