Not Working With Spacemacs
I don't think this is a bug, but rather a consequence of my own ignorance. I have installed haskell-ide-engine on Arch and added the code snippets to my .spacemacs file, but I have not noticed any changes in my editor. Any help would be greatly appreciated.
I use the develop branch of spacemacs, but it still does not work as in VSCode.
Setting hie up with spacemacs can be a little icky sometimes. I just tried to set up a fresh emacs installation with hie and got it working after several configuration attempts.
Let's first find out what's not working with your configuration. Can you open a simple project (e.g. an empty projected with stack new)? Now, if you press M-x and type in lsp-describe-session what's your output? Also, if possible, could you post your emacs config?
The installation instructions in the Readme are outdated. afaik the function lsp-haskell-enable does not exist anymore. So the correct snippet for the user-config section should be:
(setq lsp-haskell-process-path-hie "hie-wrapper")
(require 'lsp)
(require 'lsp-haskell)
(add-hook 'haskell-mode-hook #'lsp)
The installation instructions in the Readme are outdated.
Which REAADME? Can you make a PR on it once you have worked out what it should be?
Setting hie up with spacemacs can be a little icky sometimes. I just tried to set up a fresh emacs installation with hie and got it working after several configuration attempts.
Let's first find out what's not working with your configuration. Can you open a simple project (e.g. an empty projected with
stack new)? Now, if you pressM-xand type inlsp-describe-sessionwhat's your output? Also, if possible, could you post your emacs config?The installation instructions in the Readme are outdated. afaik the function
lsp-haskell-enabledoes not exist anymore. So the correct snippet for the user-config section should be:(setq lsp-haskell-process-path-hie "hie-wrapper") (require 'lsp) (require 'lsp-haskell) (add-hook 'haskell-mode-hook #'lsp)
Adding the snippet to my .spacemacs turns off my Haskell syntax highlighting and asks me to install the "haskell" layer for haskell-mode to work. lsp-describe-session does nothing.
edit: syntax highlighting works now and there's no more error. edit 2: Got it to work. Thank you! :)
The installation instructions in the Readme are outdated.
Which REAADME? Can you make a PR on it once you have worked out what it should be?
Here's a PR with the changes that worked for me:
https://github.com/haskell/haskell-ide-engine/pull/1125
Setting hie up with spacemacs can be a little icky sometimes. I just tried to set up a fresh emacs installation with hie and got it working after several configuration attempts. Let's first find out what's not working with your configuration. Can you open a simple project (e.g. an empty projected with
stack new)? Now, if you pressM-xand type inlsp-describe-sessionwhat's your output? Also, if possible, could you post your emacs config? The installation instructions in the Readme are outdated. afaik the functionlsp-haskell-enabledoes not exist anymore. So the correct snippet for the user-config section should be:(setq lsp-haskell-process-path-hie "hie-wrapper") (require 'lsp) (require 'lsp-haskell) (add-hook 'haskell-mode-hook #'lsp)Adding the snippet to my .spacemacs turns off my Haskell syntax highlighting and asks me to install the "haskell" layer for haskell-mode to work. lsp-describe-session does nothing.
edit: syntax highlighting works now and there's no more error. edit 2: Got it to work. Thank you! :)
Could you show the exact .spacemacs config for me. I set the new config in develop branch of spacemacs, but completion still can not work(syntax highlighting works).
Here's the exact .spacemacs file for you: https://gist.github.com/chkl/d833438b4fcf4bf7c2eb41bd80c0f84c
About auto-complete: It seems to me that it is not yet well-integrated in the haskell-layer yet. The functionality exists (e.g. when the cursor is at an incomplete name and you do M-x completion-at-point) but the function is not bound to a key yet. ~~But imho this is a separate issue of either the Spacemacs haskell layer or the lsp-haskell plugin~~.
Edit: There's a separate package lsp-company that provides lsp based auto-completion. I updated the gist to include it. Auto-completion works with that too. Worked for me out of the box.
@alanz: What is your opinion on including that one in the Readme as well?
@chkl Thanks for your config, I enable the lsp manually and it works. I have to say that I really miss OCaml merlin, It works powerful as HIE but easy config.
I have a PR up to add support properly: https://github.com/syl20bnr/spacemacs/pull/11887
I use it, it seems to work. Sadly they seem to be barely merging anything for months, so I don't know when it will ever get in.
Is there anything actionable left for haskell-ide-project specifically?
I believe this issue can be closed.