neodev.nvim
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)
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 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
I get the same warning.
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
And I created PR for it. https://github.com/neovim/nvim-lspconfig/pull/2110
PR is merged, so this issue can close.
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.