Closed bennypowers closed 1 year ago
I just read the documentation for lsp-handler
and from what I understood it's not. The handler would only be called once (when the server responds) so it wouldn't be possible to do any sort of "live preview" anymore. inc_rename
calls vim.lsp.buf.rename
internally when the user confirms the command.
Let me know if I have misunderstood you though!
what about
local origrename = vim.lsp.buf.rename
vim.lsp.buf.rename = function()
-- do inc-rename
origrename()
end
Well you could do something like
vim.lsp.buf.rename = function()
vim.api.nvim_feedkeys(":IncRename ", "n", false)
end
but I'm not sure if that's what you wanted to do. We don't need to call origrename
because that already happens in inc-rename
. We can't use the default behavior of the original vim.lsp.buf.rename
because that uses vim.ui.input
which is not previewable.
Hey @bennypowers, is this still an issue for you?
Is it possible to use this as a drop in handler for
vim.lsp.buf.rename()
?