lexical-lsp / lexical

Lexical is a next-generation elixir language server
865 stars 79 forks source link

root_dir detection should not sniff around OS HOME dir #803

Open filipmnowak opened 1 month ago

filipmnowak commented 1 month ago

hi there, first of all, thank you for Lexical!

this is about example Neovim config introduced here, more specifically this part of it:

return lspconfig.util.root_pattern("mix.exs", ".git")(fname) or vim.loop.os_homedir()

apologies for quite authoritative issue title, but i really feel like it's bad idea that software i install pokes around root of my home directory. it's quite dangerous and in case of a bug can cause some damage.

some "prior art" to consider:

all in all, i get it, it's just an example config nobody is forcing me to use, but still, i feel like it would be safer to skip vim.loop.os_homedir() from it maybe?

scottming commented 1 month ago

@filipmnowak I think you make a good point; it can definitely be removed. I’ve forgotten where I copied or vim.loop.os_homedir() from, but it should be unnecessary.

Additionally, I noticed that someone already submitted a PR to nvim-lspconfig last year. Perhaps our nvim configuration doesn't need to be this complex anymore. However, I don’t have time to explore this further in the next few days. If you have the time, you’re welcome to submit a PR to help us update the nvim-related configuration.