kabouzeid / nvim-lspinstall

Provides the missing :LspInstall for nvim-lspconfig
MIT License
526 stars 65 forks source link

haskell does not work (`cmd_cwd` changes and hls can't find hie.yaml) #161

Open Frefreak opened 3 years ago

Frefreak commented 3 years ago

It seems currently when using (lspinstall 54b439241e83e0a9ce8f6bcdf3b2c560a2328792, lspconfig 31615992abe962ad2b08ad3e23b8a0df006a8328, neovim v0.6.0-dev+223-g384a43fe7) together, the behaviour when opening a .hs file is that somebody will chdir to the language server's install path (for haskell that is $HOME/.local/share/nvim/lspinstall/haskell in linux), but because hls is cwd sensitive it will just exit if it can't find a hie.yaml under current directory. I see that lspinstall would set a cmd_cwd during setup which might be the cause. Set this to something like vim.loop.cwd() during require'lspconfig'.haskell.setup can workaround this but maybe this shouldn't be set in the first place?