ray-x / lsp_signature.nvim

LSP signature hint as you type
Apache License 2.0
2.01k stars 56 forks source link

Signature help is too high above cursor #234

Open LostNeophyte opened 1 year ago

LostNeophyte commented 1 year ago

image There are two empty lines between the current line and the window. It only happens in the first half of the screen

minimal config: https://github.com/ray-x/lsp_signature.nvim/blob/master/tests/init_pack.lua with sumneko_lua instead of tsserver

ray-x commented 1 year ago

image Strange, I did not see it in the default config. Are you using a GUI neovim frontend ?

LostNeophyte commented 1 year ago

Just the terminal, it's weird I think it started after installing noice, but I uninstalled it and it's still happening, even in toolbox(podman)

ray-x commented 1 year ago

did you still have noice turn on in lspsignature setup? It will add empty lines to signature

LostNeophyte commented 1 year ago

I completely uninstalled noice, and it was even happening with the clean config. In a couple hours I'll check it on a different machine where noice was never installed just to be sure

ray-x commented 1 year ago

what is your lua lsp server version and your neovim version?

LostNeophyte commented 1 year ago

It happened in neovim nightly 0.9 and 0.8sumneko: 3.6.3 23 Nov 2022, 07:01 by @.***:

what is your lua lsp server version and your neovim version?

— Reply to this email directly, > view it on GitHub https://github.com/ray-x/lsp_signature.nvim/issues/234#issuecomment-1324588175> , or > unsubscribe https://github.com/notifications/unsubscribe-auth/A2KZQTXZTTBKXPYA6PPFGCTWJWXKTANCNFSM6AAAAAASIFNP74> . You are receiving this because you authored the thread.> Message ID: > <ray-x/lsp_signature> .> nvim/issues/234/1324588175> @> github> .> com>

LostNeophyte commented 1 year ago

Same thing is happening on the different machine, with sumneko 2.something

ray-x commented 1 year ago

I can see it with default config and latest neovim. Seems the border height calculation is incorrect with that combination.

ray-x commented 1 year ago

I pushed a fix. Seems to work fine for me. Could you check?

opalmay commented 1 year ago

Hi! Thank you for the fix. The issue is mostly solved, but not for the first time it shows when using toggle_key

LostNeophyte commented 1 year ago

It still happens for me

LostNeophyte commented 1 year ago

doesn't work with require: image

but works with print: image

LostNeophyte commented 1 year ago

:lua =vim.lsp.util._make_floating_popup_size({ "```lua", "hi", "```", "2nd line" },{} returns 8, 4 so it looks like it counts ``` lines even though they aren't displayed

so if you add the border to the returned height, it's actually too much, I'm not sure if that isn't a bug on nvim's side in that case

ray-x commented 1 year ago

I noticed require has some empty lines in its signature doc. It can be the size calculation is not correct somewhere. In your example, it might be correct if the borders are included.

LostNeophyte commented 1 year ago

this fixes the issue, I hope it helps, I think it also solves https://github.com/ray-x/lsp_signature.nvim/issues/242 and https://github.com/ray-x/lsp_signature.nvim/issues/224, It may not work with signature that doesn't have code blocks though, I don't know which lsp server to use to test that