Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lsp-signature prefix does not goes away #94

Closed
theSafdarAwan opened this issue Sep 5, 2021 · 15 comments
Closed

Lsp-signature prefix does not goes away #94

theSafdarAwan opened this issue Sep 5, 2021 · 15 comments

Comments

@theSafdarAwan
Copy link

Screenshot_2021-09-05_16-39-38

@kristijanhusak
Copy link

This also happens to me randomly, but also the signature popup is visible. I'm here in normal mode, cursor is just not visible on screenshot:

screenshot

I'm just not sure how to reproduce it 100%.

Some additional info:

  • Completion: nvim-cmp
  • OS: Linux
  • Neovim version: NVIM v0.6.0-dev+218-g3f526feeb

@sQVe
Copy link

sQVe commented Sep 15, 2021

I'm getting this too frequently. Enough for it to be very annoying.

Running nvim-cmp.

I'd love to help debug and solve this, just ping what information you need.

Repository owner deleted a comment from kmescharikov Sep 15, 2021
@ray-x
Copy link
Owner

ray-x commented Sep 16, 2021

I would suspect it is a issue that InsertLeave event was not trigger/missed. But not sure is it a defect from neovim or from the plugin. I am working on code cleanup this week. And will back to this once I finished.

@naripok
Copy link

naripok commented Sep 18, 2021

This also happens to me randomly, but also the signature popup is visible

This happens to me (every time) whenever I open a function parenthesis and leave insert mode before the signature popup shows.
The pop will get stuck and the only two ways to close it is to enter insert mode again inside the parenthesis and exit or to call lua vim.lsp.buf.signature_help().
I'm also using nvim-cmp and lspconfig.
Please, let me know if I can help with more info for debugging or anything else, really. :)

EDIT
Included a gif, for clarity.
It shows the preview window being opened after exiting insert mode and getting stuck, not closing on CursorMoved.
At the end of the gif I issue a vim.lsp.buf.signature_help() somewhere else, which closes the pervious window and gets closed on CursorMoved.

Peek 2021-09-15 13-13

I think it takes so long to open because the python lsp response to the signature query is slow, and maybe the problem is a race condition where the vim.lsp.util.close_preview_autocmd() callback is called before the actual preview windows get created, so the window reference passed to close_preview_autocmd second argument is not the correct ref to the window?
Just some thoughts, I haven't studied the code yet.
Maybe that is not the problem at all since the signature hint gets stuck too and it is not a preview window...

btw, my nvim --version output, if it helps:

nvim --version
NVIM v0.5.0
Build type: Release
LuaJIT 2.1.0-beta3

ray-x added a commit that referenced this issue Sep 24, 2021
@megalithic
Copy link

megalithic commented Oct 6, 2021

Can confirm that I'm still getting this behaviour too.

NVIM v0.6.0-dev+397-gc7a63f35d
Build type: Release
LuaJIT 2.1.0-beta3
Compiled by <me>

Features: +acl +iconv +tui
See ":help feature-compile"

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "
/home/linuxbrew/.linuxbrew/Cellar/neovim/HEAD-c7a63f3/share/nvim"

settings:

	require("lsp_signature").on_attach({
		bind = true, -- This is mandatory, otherwise border config won't get registered.
		floating_window = true,
		floating_window_above_cur_line = true, -- try to place the floating above the current line
		-- floating_window_off_y = 1, -- adjust float windows y position. allow the pum to show a few lines
		-- fix_pos = true,
		hint_enable = false,
		decorator = { "`", "`" },
		handler_opts = {
			border = "double",
		},
	})

@ray-x
Copy link
Owner

ray-x commented Oct 6, 2021

What is your function signature?

@ErikReider
Copy link

I've noticed this too... When pasting a method in insert mode -> move cursor to end of method parenthesis -> ^C -> :w.

@danielgatis
Copy link

same here! :(

@ray-x
Copy link
Owner

ray-x commented Nov 25, 2021

I did not see this happen for a while. I am using gopls, tsserver and pyright
Please check if it goes away by disabling autopair plugins or any similar plugins (or, maybe check my setup ray-x/nvim regarding how to setup autopir).
Please post your language server, your function signature and your lsp_signature config.
Also, a walk around is define the toggle key to toggle the floating window.

@theSafdarAwan
Copy link
Author

sorry i found what was causing it if you use (ctrl+c) to get out of the insert mode then use <c-[> this thing wont happen again
and also if ctrl+c is you habbit then set inoremap

@shlomocarmeter
Copy link

shlomocarmeter commented Dec 2, 2021

Had the same problem. Setting inoremap (ctrl+c) to (esc) fixed this for me. Thanks @imSafdarAwan!

@ray-x
Copy link
Owner

ray-x commented Dec 2, 2021

<ctrl-c> will trigger InsertLeave event on which signature is hooked on. So the plugin has no idea you are not in Normal mode and should close the popup.

@andriati-alex
Copy link

Thanks guys I really liked the plugin and was facing the same problem exiting with <ctrl-c>

ray-x added a commit that referenced this issue Dec 9, 2021
@ray-x
Copy link
Owner

ray-x commented Dec 9, 2021

Sorry. I was doing some refactoring in the last few days.
Pushed a change to master. Hope it works.

@druskus20
Copy link

It seems to work! Thanks!

@ray-x ray-x closed this as completed Apr 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests