Efm tries to get in on the action with vim.lsp.buf.rename?

Hi, I’ve got an interesting issue with the following setup. (I mentioned it on the IRC channel last night, but thought it’s worth asking for more ideas.)

Two LSPs are turned on in this example: efm and Pyright. Upon triggering the rename action, both of them try to rename the symbol (one after the other). Of course only Pyright is successful, but you have to fill out the rename dialogue for both servers, which is an annoying doubling of effort. Also, two changes are registered. How can I stop efm from responding to the rename call?

Here’s a minimal repro: Efm breaks vim.lsp.buf.rename()? · GitHub (Note that every now and then everything works without a hitch; I’m not sure why.)

I’ve tried something like

local efm_on_attach = function(client, _)
    local rc = client.resolved_capabilities
    rc.rename = false

require'lspconfig'.efm.setup {
    on_attach = efm_on_attach,
    filetypes = {'python'}

but without success.

@mjlbach suggested lsp: select handlers/capabilities per server when using multiple language servers · Issue #14101 · neovim/neovim · GitHub was implicated. I haven’t tried merging that PR.