-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Texlab root_dir is prioritising $HOME if $HOME/.latexmkrc is present #2975
Comments
This behavior of This is because the Instead, IMO doing a check on all the files given in the list for each directory before going to the ancestor is logical |
@tomtomjhj thoughts? |
#2885 seems to have changed the behavior of root_pattern. |
Why? It sounds like the issue can be fixed by swapping the order. The benefit of #2885 is that it at least makes the precedence rules very clear. |
The current solution will make root overly big in cases like this (
Personally, I prefer the older version of |
Description
As noted in PR #2831, $HOME/.latexmkrc is used for per-user config and should not be considered for fixing
root_dir
. However, even after #2831, I'm getting $HOME asroot_dir
with the following file structure:As a workaround, it is possible set
lua root_dir = require('lspconfig.util').root_pattern('.git')
which will yield the correctroot_dir
inside git repos.Neovim version
NVIM v0.10.0-dev Build type: RelWithDebInfo LuaJIT 2.1.0-beta3 Run "nvim -V1 -v" for more info
Nvim-lspconfig version
042aa6b
Operating system and version
Ubuntu 20.04 inside WSL2
Affected language servers
texlab
Steps to reproduce
:LspInfo
will showroot_dir = /home/user
Actual behavior
$HOME is chosen as the
root_dir
because of the existence of the.latexmkrc
file.Expected behavior
$HOME/work/project
should be chosen asroot_dir
since it has a.git
folder.Minimal config
LSP log
Non appeared in $HOME/.cache/nvim/lsp.log
The text was updated successfully, but these errors were encountered: