Issafalcon / lsp-overloads.nvim

Extends the native nvim-lsp handlers to allow easier navigation through method overloads.
MIT License
88 stars 4 forks source link

'Invalid window id' when open and close signature are mapped to the same keybind #34

Closed leoshatrushin closed 6 months ago

leoshatrushin commented 7 months ago

With vim.keymap.set("n", "Y", "LspOverloadsSignature") and close_signature = "Y", if you open a signature window and navigate between parameters, then if you try to open a signature window again, you will get 'Invalid window id'. I can provide more details and investigate more if this does not reproduce.

Green0wl commented 6 months ago

the same problem.

Issafalcon commented 6 months ago

Hi @leoshatrushin - Thanks for raising this issue.

I've been able to reproduce the issue. This is due to an omission I made in the documentation, so I've made it more clear now in the README.

Essentially, the mappings rely on the buffer number being passed in, so that the signature popup can be correctly identified by the plugin. Without this, the popup window isn't tracked correctly and ends up closing prematurely when cycling through parameters. Passing in the buffer option when setting up the mappings, inside the on_attach method of the LSP server options, will correct this issue.

Issafalcon commented 6 months ago

I'll close the issue, but please do let me know if this doesn't fix your issue.