bug: root_dir
broken, always gets set when .neoconf.json
is present
#74
Labels
bug
Something isn't working
Did you check docs and existing issues?
Neovim version (nvim -v)
NVIM v0.10.0 (github release)
Operating system/version
Arch Linux
Describe the bug
I noticed recently some of my language servers that shouldn't be starting are starting and not respecting the
root_dir
that they have defined either the defaults provided bylspconfig
nor the ones I specify in my own configuration. This lead me down one crazy rabbit hole of source code digging until I found that Neoconf is actually overridingroot_dir
function in a way that makes it always set the root directory if aneoconf.json
file is set. This really messes up language servers that require configuration files to function and so theroot_dir
is quite strict to only enable when those configuration files are present.Steps To Reproduce
Requires: lua language server in path, I picked one I figured you probably have, feel free to adjust the
repro.lua
accordinglyrm -rf .repro
, make sure it's a clean environmentnvim -u repro.lua repro.lua
, run neovim and openrepro.lua
:LspInfo
, see that 0 clients are attached to the buffertouch .neoconf.json
, make an empty Neoconf configuration filenvim -u repro.lua repro.lua
, run neovim and openrepro.lua
:LspInfo
, see that 1 client is attached to the bufferExpected Behavior
I would expect that my language servers respect the
root_dir
that are set for them. A lot of language servers have blanket root directories such as.git
, but this is not all of them. Many language servers require the presence of configuration files and therefore having a blanket root directory is bad. Also, even if there is a default blanket type of root directory, if I manually set root directory configuration, it should be respected fully. It seems like with the current implementation in Neoconf, there is no way to remove behavior at all.Repro
The text was updated successfully, but these errors were encountered: