ray-x / lsp_signature.nvim

LSP signature hint as you type
Apache License 2.0
1.98k stars 53 forks source link

feat: time out or make non-blocking #288

Closed llllvvuu closed 9 months ago

llllvvuu commented 9 months ago

Sometimes language server will fall behind, e.g. when streaming a very long completion list. In this case, it will not be able to serve signature requests if it is single threaded or otherwise serves requests in order.

lsp_signature.nvim seems to be waiting for the signature help, thus blocking the UI. Would it make sense to make a config option to turn that off?

llllvvuu commented 9 months ago

Looks like the issue is actually cmp.visible() is blocking:

https://github.com/ray-x/lsp_signature.nvim/blob/bdf3dc7bb03edd25c2173e0e31c2fb122052ed23/lua/lsp_signature/helper.lua#L700

And that is due to cmp.sync:

https://github.com/hrsh7th/nvim-cmp/blob/5dce1b778b85c717f6614e3f4da45e9f19f54435/lua/cmp/init.lua#L87

the function does not start running until ~100 ms after it's called.