haskell-ide-engine icon indicating copy to clipboard operation
haskell-ide-engine copied to clipboard

Not Working With Spacemacs

Open g00sed opened this issue 7 years ago • 11 comments

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.

g00sed avatar Mar 02 '19 13:03 g00sed

I use the develop branch of spacemacs, but it still does not work as in VSCode.

Christophe1997 avatar Mar 05 '19 10:03 Christophe1997

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)

chkl avatar Mar 09 '19 14:03 chkl

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?

alanz avatar Mar 10 '19 08:03 alanz

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)

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! :)

g00sed avatar Mar 10 '19 09:03 g00sed

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

chkl avatar Mar 10 '19 09:03 chkl

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)

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).

Christophe1997 avatar Mar 10 '19 15:03 Christophe1997

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 avatar Mar 10 '19 18:03 chkl

@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.

Christophe1997 avatar Mar 11 '19 05:03 Christophe1997

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.

michaelpj avatar Mar 11 '19 14:03 michaelpj

Is there anything actionable left for haskell-ide-project specifically?

Anrock avatar Mar 12 '19 17:03 Anrock

I believe this issue can be closed.

chkl avatar Mar 24 '19 15:03 chkl