-
Notifications
You must be signed in to change notification settings - Fork 2.2k
fix(configs): remove utils in config with globs as markers #3711
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
I'm not entirely sure if this migration is ok. It seems like To make it clearer, I think This is not just aboute these configs, even for the ones already ported. |
I don't know if these is relevant for most of the configs, but if that is the case we would probably need a flag to change the behaviour of One example is Here it was explicitly said that the precedence was important, so I called |
lsp/ada_ls.lua
Outdated
root_dir = function(bufnr, on_dir) | ||
local fname = vim.api.nvim_buf_get_name(bufnr) | ||
on_dir(util.root_pattern('Makefile', '.git', 'alire.toml', '*.gpr', '*.adc')(fname)) | ||
root_markers = function(name, _) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think root_markers
accepts a function, based on :help vim.lsp.Config
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It actually does, that's what I was talking about in neovim/neovim#33444 (comment)
lsp/autotools_ls.lua
Outdated
root_markers = function(name, _) | ||
for _, pattern in ipairs(root_files) do | ||
if vim.glob.to_lpeg(pattern):match(name) ~= nil then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this is the pattern that's actually unavoidable in every config, it's a strong hint that we need to resolve neovim/neovim#33444 (by enhancing vim.fs.find()
, and/or accepting a function for root_markers
, and/or supporting wildcards directly in root_dir
/ root_markers
).
See also #3651 . Deciding on well-defined behavior will require some thought. |
45ae270
to
2fbea40
Compare
#3820 removes |
lspconfig.utils
from newest configs2fbea40
to
b01d198
Compare
Based on #2079.
The majority of configs which rely on
lspconfig.util
useutil.root_pattern
to match against wildcards. I've opened an issue here neovim/neovim#33444 to discuss about this.In the meantime I'll remove
lspconfig.util
where it's trivial to do so.