mirror of
https://github.com/neovim/neovim.git
synced 2025-11-17 07:41:27 +00:00
fix(lsp)!: pass buffer number to root_dir function
Problem: The root dir function is not passed any context and can only assume the current buffer is the one being attached. The main use case is for getting the path of the buffer using `nvim_buf_get_name`. Solution: Pass the buffer number as the first argument.
This commit is contained in:
committed by
Lewis Russell
parent
3b0fe2659e
commit
debabaf884
@@ -6348,7 +6348,8 @@ describe('LSP', function()
|
||||
vim.lsp.config('foo', {
|
||||
cmd = server.cmd,
|
||||
filetypes = { 'foo' },
|
||||
root_dir = function(cb)
|
||||
root_dir = function(bufnr, cb)
|
||||
assert(tmp1 == vim.api.nvim_buf_get_name(bufnr))
|
||||
vim.system({ 'sleep', '0' }, {}, function()
|
||||
cb('some_dir')
|
||||
end)
|
||||
|
||||
Reference in New Issue
Block a user