reddit / emacs

lsp-haskell not working

Exzelt8042 · 2022-07-21 06:49
I've installed lsp-mode and lsp-haskell on windows and have added ```(require 'lsp) (require 'lsp-haskell) ;; Hooks so haskell and literate haskell major modes trigger LSP setup (add-hook 'haskell-mode-hook #'lsp) (add-hook 'haskell-literate-mode-hook #'lsp)``` to my init.el . However, when I open a haskell file, nothing happens. I dont get any messages or anything, but the server isnt initialized. How do I fix this?
yyoncho · 2022-07-21 08:17
1. Check the major mode in the buffer. It should be haskell-mode. 2. Check what happens when you do M-x lsp in the buffer.
Exzelt8042 · 2022-07-21 08:20
The major mode is Fundamental even when opening a file with .hs extension. M-x lsp gives this: Warning (lsp-mode): Unable to calculate the languageId for buffer ‘Main.hs’. Take a look at ‘lsp-language-id-configuration’. The ‘major-mode’ is fundamental-mode Disable showing Disable logging
yyoncho · 2022-07-21 08:34
You have to install haskell-mode from melpa.
Exzelt8042 · 2022-07-21 08:43
got it to work, thanks!