I’m not sure quite why, and am not familiar enough with how LSPs work in Neovim to even start debugging this. (On a small tangent: how does one debug Neovim configs, in general? Is there a way to put breakpoints in Lua functions and step through them, line by line?)
My issue is that using vim.lsp.buf.rename() requires me to enter in the new variable name I’d like twice in a row. After entering it the first time, the “prompt” is reset to the old variable name, and I have to enter the new name again.
The language I’m having issues with is Python – I have Pyright and Jedi installed through nvim-lsp-installer, so I thought maybe the issue was having two LSPs simultaneously. But when I comment out the lines initializing Pyright, nothing changes.
I’m unfortunately confused enough that I’m not even sure which files would be helpful to share here, so let me know if there are functions or parts of my config you’d like to see. I’d really be grateful for help, even just for hints in the right direction!
@kay-adamof After uninstalling pyright, I am only prompted to rename once, but after pressing enter, no renaming happens, and I see the error message:
Language server couldn't provide rename result
After reinstalling pyright and uninstalling Jedi, renaming works completely as it’s supposed to. Maybe my solution is just not to use Jedi? I honestly can’t remember why I installed both it and pyright…
However, if I run :lua vim.lsp.buf.rename() manually I only need to enter the rename once so it doesn’t seem to be the LSP server… more like the command being registered twice or something like that.