vim.buf.lsp.rename() getting called twice #24121
Replies: 2 comments 5 replies
-
hey, @debashisbiswas, I think you're on to exactly why it's happening, as the request is going to all the attached servers, AFAIK. I'm no where near an expert in all of this, but it seems to me that you could pick one of them that you would consider "secondary" (my guess is angularls but legit I never touch javascript or web anything, so you're going to have to make that call), and then in your setup for it you could disable the capability. note this isn't tested, you may have to set it differently, somehow..
Alternatively, and what I might actually do instead, you might be able to only invoke the request under the condition it isn't angularls asking, in the on_attach function where you set your keymaps..
notice that instead of discarding the client param, we specify it, and use it to check the name. I hope this helps! |
Beta Was this translation helpful? Give feedback.
-
Use any available lsp: Use lsp from priority list or use any available lsp: Use lsp from priority list or aks user to select lsp: |
Beta Was this translation helpful? Give feedback.
-
Hi all, I've recently been getting a weird issue in which
vim.buf.lsp.rename()
seems to get called twice in some projects. I suspect it might be because I'm using multiple language servers (Angular project hasangularls
andtsserver
), as it doesn't happen in a python project with justpyright
, but I'm not sure how to debug it or move towards a fix.When I say it gets called twice, this is what I mean:
vim.buf.lsp.rename()
using keybindvim.ui.input()
prompt shows up, my cursor moves to the prompt, and I edit to a new namevim.ui.input()
prompt shows up again, and my cursor moves back to the promptFor reference, my configuration is here:
https://github.com/debashisbiswas/.dotfiles/tree/master/nvim/.config/nvim
Beta Was this translation helpful? Give feedback.
All reactions