Add LSP rename command

This commit is contained in:
Talia 2024-04-30 09:05:57 +02:00
parent 75f62a7ffb
commit 4cdadaaaf9

View file

@ -38,4 +38,12 @@ return function(_, bufnr)
vim.api.nvim_buf_create_user_command(bufnr, "LspWorkspaces", function() vim.api.nvim_buf_create_user_command(bufnr, "LspWorkspaces", function()
print(vim.inspect(vim.lsp.buf.list_workspace_folders())) print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
end, {}) end, {})
vim.api.nvim_buf_create_user_command(bufnr, "Rename", function(params)
if #params.fargs > 0 then
vim.lsp.buf.rename(params.fargs[1])
else
vim.lsp.buf.rename()
end
end, {nargs = "?"})
end end