yegappan / lsp

Language Server Protocol (LSP) plugin for Vim9
MIT License
458 stars 49 forks source link

LspCodeAction unable to create files. #445

Closed darkseid-is closed 7 months ago

darkseid-is commented 7 months ago

Getting following error when trying to create file with rust-analyzer

Error: request textDocument/codeAction failed (Client does not support create capability., error = RequestFailed)
yegappan commented 7 months ago

Can you describe the list of steps (along with a sample rust file) to reproduce this issue?

darkseid-is commented 7 months ago
# create new project
cargo new hola

# open file
vim hola/src/main.rs

# add following line to top of file 
mod io;

Screenshots neovim lsp code action screenshot_1706025395

vim-lsp code action screenshot_1706025473

Thank you.

yegappan commented 7 months ago

I have committed the change https://github.com/yegappan/lsp/commit/491a32144022a0fa3ac174fea60dfb133779383e to support this. Can you try out the latest version of the plugin?

darkseid-is commented 7 months ago

In the latest version, creating files works but renaming file throws an error Error: Renaming files not supported.

yegappan commented 7 months ago

Can you add the steps for renaming files using the Rust language server?

darkseid-is commented 7 months ago
  1. In line mod io place cursor in io
  2. call LspRename and enter new name
yegappan commented 7 months ago

Thanks for the steps. I have committed https://github.com/yegappan/lsp/commit/72301ac00707579f7e85f91c6ba95e3a962123d5 to add support for renaming files. Can you try using the latest version of the plugin?

darkseid-is commented 7 months ago

New Update works as expected.

Thank you for the quick fix and for a great tool.