-
-
Notifications
You must be signed in to change notification settings - Fork 156
Open
Description
I don't know how many LSP clients can send workspace/willRenameFiles request and handle the response. Neovim comes with no handler and I didn't find any plugin for it.
On the other side I can send such request and would see the response if it worked. In
| $document = $this->locator->get($file); |
I get
TextDocumentNotFound because the new file doesn't exist yet. Is it intentional?
I check it with
local function willRenameCurrentBuffer(newPath)
if not vim.startswith(newPath, '/') then
newPath = vim.fs.joinpath(vim.uv.cwd(), newPath) -- replace vim.uv with vim.loop on <=0.9
end
local response = vim.lsp.buf_request_sync(0, 'workspace/willRenameFiles', {files = {{
oldUri = vim.uri_from_bufnr(0), -- the current file
newUri = vim.uri_from_fname(newPath)
}}})
vim.print(response)
end
vim.api.nvim_create_user_command('WillRenameCurrentBuffer', function (opts)
willRenameCurrentBuffer(opts.args)
end, {nargs = 1, complete = 'file'})Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels