emacs-lsp / lsp-haskell

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

Symbol’s value as variable is void: haskell-debug-mode-map #165

Closed svenpanne closed 1 year ago

svenpanne commented 1 year ago

After an update of all Spacemacs packages today, the change https://github.com/emacs-lsp/lsp-haskell/commit/c5d3bc2223f16b59eb39906affefeb08f13b918f got pulled in, and I'm relatively sure that this is the culprit for the error:

Error (use-package): haskell-mode/:config: Symbol’s value as variable is void: haskell-debug-mode-map

The Haskell layer of Spacemacs has not been changed, and my Haskell-related part of the Spacemacs config is trivial:

(haskell :variables haskell-completion-backend 'lsp)

Note that this error pops up even in something not related to Haskell, e.g. opening a Python file (LSP-based backend there, too), but I guess this is related to Spacemacs' initialization of layers.

jcs090218 commented 1 year ago

The issue is the variable haskell-debug-mode-map is defined in haskell-debug.el. I think this is a bug from spacemacs and not from our side.

Hope the information helps!

svenpanne commented 1 year ago

Hmmm, but this worked for years until the last commit in this project, so I still think this should be handled here. Any hints? Otherwise I'll guess there will be some responsibility ping-pong.

And to be honest: I don't even understand the reason for the change, why it should make things better. For now, it just makes things worse, at least for me.

jcs090218 commented 1 year ago

What this PR does is to force haskell-mode to be installed since it become one of the dependency. If spacemacs report error regarding haskell-mode error, then it should be resolve in spacemacs.

Do you previously have haskell-mode installed? My best guess is you don't have it installed until then, then the error pops out due to the PR (it forces you to install it.).

jcs090218 commented 1 year ago

And to be honest: I don't even understand the reason for the change, why it should make things better. For now, it just makes things worse, at least for me.

See #163 for the reason why. It does make sense since this package rely on haskell-mode:

https://github.com/emacs-lsp/lsp-haskell/blob/c5d3bc2223f16b59eb39906affefeb08f13b918f/lsp-haskell.el#L291

Otherwise, it won't work.

Regarding spacemacs, I don't use it so I can't tell if this is the config error or something else. 😓

svenpanne commented 1 year ago

[...] Do you previously have haskell-mode installed? My best guess is you don't have it installed until then, then the error pops out due to the PR (it forces you to install it.).

With Spacemacs, you don't install modes for yourself, this is done via the respective layer. (Well, you can do it by hand, but that would be bypassing the main idea of Spacemacs). I had a quick look at the corresponding Spacemacs layer at https://github.com/syl20bnr/spacemacs/blob/develop/layers/%2Blang/haskell/packages.el, but I can't see what's wrong there. It seems to require both lsp-haskell and haskell-mode, perhaps it's some kind of ordering problem. But who knows? :smile: I've opened an issue in that project, too, let's see if there is some reply.

Thanks for the help so far, things now make a little bit more sense to me. :+1:

lebensterben commented 1 year ago

This is a long known issue of Spacemacs and you can close this issue now.