neodev.nvim icon indicating copy to clipboard operation
neodev.nvim copied to clipboard

LSP[sumneko_lua] Your workspace is set to `/home/XYZ`. Lua language server refused to load this directory. Please check your configura tion.[learn more here](https://github.com/sumneko/lua-language-server/wiki/Why-scanning-home-folder)

Open c3n21 opened this issue 2 years ago • 2 comments

Hello!

Recently every time I open up a .lua file I always get this error

LSP[sumneko_lua] Your workspace is set to '/home/zhifan'. Lua language server refused to load this directory. Please check your configura tion.[learn more here](https://github.com/sumneko/lua-language-server/wiki/Why-scanning-home-folder)

but I don't know how should I fix it. The Language Server itself still works even if the message shows up

c3n21 avatar May 30 '22 12:05 c3n21

@c3n21 This is something I've seen when opening some of my lua files. I think it is a issue with the language-server itself since I do not use this project. Cause for me is that I open lua files that are in my dofiles. If I open lua files that are not in repo tracked from home, all is good. Also if I rename ~/.git to ~/.git.b, lsp stops giving me errors

DusanLesan avatar Jun 12 '22 08:06 DusanLesan

I get the same warning.

mosheavni avatar Jul 27 '22 14:07 mosheavni

I found cause of this. This is because there are files in your home directory that match these root patterns, such as .luarc.json. The first one here has returned the home directory. https://github.com/neovim/nvim-lspconfig/blob/0fafc3ef648bd612757630097c96b725a36a0476/lua/lspconfig/server_configurations/sumneko_lua.lua#L23

uga-rosa avatar Sep 05 '22 14:09 uga-rosa

And I created PR for it. https://github.com/neovim/nvim-lspconfig/pull/2110

uga-rosa avatar Sep 05 '22 15:09 uga-rosa

PR is merged, so this issue can close.

uga-rosa avatar Sep 06 '22 11:09 uga-rosa

PR is merged, so this issue can close.

Thanks for your contribution! I didn't comment further this issue because I couldn't reproduce the issue recently.

c3n21 avatar Sep 06 '22 11:09 c3n21