ray-x / lsp_signature.nvim

LSP signature hint as you type
Apache License 2.0
2.07k stars 57 forks source link

Window closes itself with sumneko_lua - close_timeout #103

Closed ii14 closed 3 years ago

ii14 commented 3 years ago

With sumneko_lua the window always closes itself, no matter what, after 4 seconds. clangd doesn't have the same issue.

This is where it happens:

https://github.com/ray-x/lsp_signature.nvim/blob/79fda86596650f21c573b24a2338ce85f19c98aa/lua/lsp_signature.lua#L425-L427

By the way, I think this might be a mistake, the default timeout value is different here:

https://github.com/ray-x/lsp_signature.nvim/blob/79fda86596650f21c573b24a2338ce85f19c98aa/lua/lsp_signature.lua#L29

This option also isn't documented in the README.

My config:

require 'lsp_signature'.setup {
  bind = true,
  max_width = 80,
  max_height = 12,
  hint_enable = false,
  hint_prefix = '',
  handler_opts = { border = 'none' },
  toggle_key = '<C-K>',
  doc_lines = 2,
  floating_window_above_cur_line = false,
  -- close_timeout = 120000, -- workaround
}

Just in case this will be for some reason hard to get right, I propose at least having a way of disabling this timeout, by setting the option to either false, a negative number or zero.

ray-x commented 3 years ago

Yes. those setting was for test purpose. Please refer to latest README auto_close_after

ii14 commented 3 years ago

Thanks, seems to be working when it's disabled.

~I don't see any relevant changes to the actual README, just in the source code.~ I didn't notice the new branch.

One thing I'd like to point out, is that I don't think nil will actually disable the timeout, you have to set it to false:

https://github.com/ray-x/lsp_signature.nvim/blob/5ee2b1fff09463e22679f5f3f8040d1200d6f848/lua/lsp_signature.lua#L41

ray-x commented 3 years ago

Please update the code to latest. The default value updated to nil

gegoune commented 3 years ago

It still closes automatically for me even with auto_close_after = nil in config.

ii14 commented 3 years ago

@gegoune Changes are on the "refactor" branch, but auto_close_after = false will work if you're on the master branch.

ray-x commented 3 years ago

The changes merged to master.