lsp_signature.nvim icon indicating copy to clipboard operation
lsp_signature.nvim copied to clipboard

Lua exception raised during signature help for `asyncio.gather()`

Open Intery opened this issue 2 years ago • 4 comments

Hi, thanks for the great plugin!

Just wanted to report a minor issue. When the signature help is displayed for a asyncio.gather(...), it often produces the following error:

Error executing vim.schedule lua callback: /usr/share/nvim/runtime/lua/vim/lsp/util.lua:1407: 'replacement string' item contains newlines                                                                                                                                                                                       
stack traceback:                                                                                                                                                                                                                                                                                                                
        [C]: in function 'nvim_buf_set_lines'                                                                                                                                                                                                                                                                                   
        /usr/share/nvim/runtime/lua/vim/lsp/util.lua:1407: in function 'stylize_markdown'                                                                                                                                                                                                                                       
        /usr/share/nvim/runtime/lua/vim/lsp/util.lua:1665: in function 'open_floating_preview'                                                                                                                                                                                                                                  
        ...im/plugged/lsp_signature.nvim/lua/lsp_signature/init.lua:562: in function 'handler'                                                                                                                                                                                                                                  
        /usr/share/nvim/runtime/lua/vim/lsp.lua:1394: in function ''                                                                                                                                                                                                                                                            
        vim/_editor.lua: in function <vim/_editor.lua:0> 

This appears to be a regression of #254, or perhaps a corner case. I am using the latest master version of the plugin.

I usually easily work around this by toggling off signature help before writing a gather statement, and as far as I have seen it only affects gather. image

Intery avatar Jul 27 '23 20:07 Intery

What is the LSP you using for python? pyright?

ray-x avatar Jul 30 '23 09:07 ray-x

Only jedi_language_server. I can attempt to setup a minimal init to reproduce it if it would help?

Intery avatar Aug 03 '23 04:08 Intery

I will give Jedi a try first. It's been a while since I've used Pyright.

ray-x avatar Aug 05 '23 11:08 ray-x

Hi, I have the exact same problem but for a Scala project using nvim-metals for the LSP.

Seems to be a subset of methods, for some it works fine but for others I get the above error. It's triggered when I'm entering insert-mode within the () of a method or by position the cursor within the arguments and do vim.lsp.buf.signature_help().

olatheander avatar Sep 05 '23 09:09 olatheander