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

(void-variable lsp-haskell-formatting-provider) #156

Closed josefs closed 10 months ago

josefs commented 1 year ago

I'm having trouble starting to use lsp-haskell. I've followed the installation instructions but when I open a Haskell file I get:

File mode specification error: (void-variable lsp-haskell-formatting-provider)

What am I doing wrong and how do I fix it? I don't particularly need a formatter and I don't have any installed at the moment.

My currently installed package version: lsp-mode 8.0.0 lsp-haskell 20220809.2129

Philonous commented 1 year ago

I've got the same error and managed to fix it for myself:

It turns out that the latest git version of lsp-haskell uses the macro defcustom-lsp which was implemented in lsp-mode in https://github.com/emacs-lsp/lsp-mode/commit/491d667d1e113bd6b43d1f88d47383e7fb137ddb, Oct 27, 2021 but lsp-mode 8.0.0 was released Sep 4, 2021

Or in other words: your lsp-mode version is too old for lsp-haskell. And it appears that compiling lsp-haskell with the missing macro somehow leads to broken byte code rather than aborting the compilation.

How to fix:

michaelpj commented 10 months ago

Not sure there's anything to do here