ray-x / lsp_signature.nvim

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

Cursor position outside buffer #295

Closed tan-wei closed 8 months ago

tan-wei commented 8 months ago

Use lsp_signature with cmp will cause this:

Error executing vim.schedule lua callback: ...vim/lazy/lsp_signature.nvim/lua/lsp_signature/helper.lua:676: Cursor position outside buffer
stack traceback:
    [C]: in function 'nvim_win_set_cursor'
    ...vim/lazy/lsp_signature.nvim/lua/lsp_signature/helper.lua:676: in function 'highlight_parameter'
    .../nvim/lazy/lsp_signature.nvim/lua/lsp_signature/init.lua:618: in function 'handler'
    /usr/share/nvim/runtime/lua/vim/lsp.lua:1517: in function ''
    vim/_editor.lua: in function <vim/_editor.lua:0>

And my configuration for lsp_signature is:

{
  log_path = vim.fn.stdpath "cache" .. "/lsp_signature.log",
  debug = true,
  hint_enable = false,
  handler_opts = { border = "rounded" },
  max_width = 80,
  noice = true,
}
tan-wei commented 8 months ago

It seems that neovim API returns this error. My neovim version is (nightly):

NVIM v0.10.0-dev-1573+gd92dd2a0c05
Build type: RelWithDebInfo
LuaJIT 2.1.1700008891
Run "nvim -V1 -v" for more info
tan-wei commented 8 months ago

Here is the debug log, I've cleaned the previous contents: lsp_signature.log

ray-x commented 8 months ago

I assume you are using latest version of lsp_signature. Could you send a rust code snippet i can reproduce the issue? I checked your logs but unfortunately, I am not familiar with rust and did not find anything useful yet.

tan-wei commented 8 months ago

Yes, I use the latest version of lsp_signature. A simple clean code should help:

fn test_function(a: i32, b:i32) -> i32 {
  0
}

fn main() {
  test_function(1, 2)
}

图片

ray-x commented 8 months ago

Looks good to me

image

I am using same version: NVIM v0.10.0-dev-1573+gd92dd2a0c-Homebrew

Could you set noice = false, I does not use noice and it might be they changed something

tan-wei commented 8 months ago

OK, after set noice = false, it does not happen. So I think your guess is correct.

ray-x commented 8 months ago

I may run some test and deprecate noice setting