Skip to content
This repository has been archived by the owner on Oct 7, 2020. It is now read-only.

Hie crashes Coc Neovim #1761

Closed
Eugene-msc opened this issue May 4, 2020 · 6 comments
Closed

Hie crashes Coc Neovim #1761

Eugene-msc opened this issue May 4, 2020 · 6 comments

Comments

@Eugene-msc
Copy link

Eugene-msc commented May 4, 2020

I am trying to use HIE with Neovim and Coc. I configured everything as in documentation, but I get no diagnostics.

ghc is 8.8.3 and I built HIE from sources with stack
The system is Ubuntu 19.10

In :CocInfo I see that it crashes with error

2020-05-04 12:45:53.259897418 [ThreadId 9] - Scheduler thread exited unexpectedly: user error (Pattern match failure in do expression at lib/Distribution/Helper.hs:603:7-22)

And when I try to run hie-wrapper in shell I get the same error

2020-05-04 12:44:12.545691526 [ThreadId 4] - New cradle: /home/yeti/projects/haskell/helloworld/Hello.hs
2020-05-04 12:44:12.546935854 [ThreadId 4] - Cabal-Helper decided to use: ProjLocStackYaml {plStackYaml = "/home/yeti/projects/haskell/helloworld/stack.yaml"}
2020-05-04 12:44:12.547059432 [ThreadId 4] - Module "/home/yeti/projects/haskell/helloworld/Hello.hs" is loaded by Cradle: Cradle {cradleRootDir = "/home/yeti/projects/haskell/helloworld", cradleOptsProg = CradleAction: Other Stack}
2020-05-04 12:44:12.547137868 [ThreadId 4] - Found cradle: Cradle {cradleRootDir = "/home/yeti/projects/haskell/helloworld", cradleOptsProg = CradleAction: Other Stack}
hie-8.8.3: user error (Pattern match failure in do expression at lib/Distribution/Helper.hs:603:7-22)
hie-wrapper: callProcess: /home/yeti/.local/bin/hie-8.8.3 (exit 1): failed

@fendor
Copy link
Collaborator

fendor commented May 4, 2020

As a work-around, you can write a custom hie.yaml in the root of your project with the contents:

cradle:
  stack:

For an explanation of this hie.yaml, see https://github.com/mpickering/hie-bios/
And an example for a more complex one: https://github.com/haskell/haskell-ide-engine/blob/master/hie.yaml.stack
Some other examples, https://github.com/haskell/haskell-ide-engine#project-configuration

@jneira Iirc, you fixed that bug in cabal-helper?

@Eugene-msc
Copy link
Author

@fendor
Thanks, it worked! Now hie does not crash and I'm getting errors highlighted.
Not autocomplete though

@Eugene-msc
Copy link
Author

@fendor
I think lack of autocomplete was a problem of my project itself. I deleted unneeded files restarted Coc and it started working. Everything works now.
Thank you very much!

@fendor
Copy link
Collaborator

fendor commented May 4, 2020

Happy to help!

We'll keep this open, until the issue is fixed!

@fendor fendor reopened this May 4, 2020
@jneira
Copy link
Member

jneira commented May 15, 2020

Issue upstream: DanielG/cabal-helper#90
It seems it is caused by stack not returning any .cabal files

@jneira
Copy link
Member

jneira commented May 15, 2020

Closing in favor of #1666

@jneira jneira closed this as completed May 15, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants