ray-x / lsp_signature.nvim

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

When typing test names in Elixir Test files, lsp signature throws error. #213

Open zdcthomas opened 2 years ago

zdcthomas commented 2 years ago

When typing a test name in elixir test files, lsp signature throws this error.

Error executing vim.schedule lua callback: ...-unwrapped-0.7.2/share/nvim/runtime/lua/vim/lsp/util.lua:1203: String cannot contain newlines
stack traceback:
        [C]: in function 'nvim_buf_set_lines'
        ...-unwrapped-0.7.2/share/nvim/runtime/lua/vim/lsp/util.lua:1203: in function 'stylize_markdown'
        ...-unwrapped-0.7.2/share/nvim/runtime/lua/vim/lsp/util.lua:1449: in function 'open_floating_preview'
        ...cker/start/lsp_signature.nvim/lua/lsp_signature/init.lua:471: in function 'handler'
        ...eovim-unwrapped-0.7.2/share/nvim/runtime/lua/vim/lsp.lua:1025: in function ''
        vim/_editor.lua: in function <vim/_editor.lua:0>

I can try to dig into it more later, but I thought I'd post it here sooner rather than later.

I'm on the most recent version of this plugin, Nvim version 0.7.2 elixir version 1.13.4

ray-x commented 2 years ago

Is elixir return markdown. I am not sure if it is a default setup for elixir.

zdcthomas commented 2 years ago

It does for every other signature I've encountered. Normal functions, and even macros return good markdown.

Let me try to intercept the message and see what it's actually returning

dkarter commented 2 years ago

@zdcthomas have you had any luck looking into this? if you want extra 👀 I'd be happy to pair this weekend

natdm commented 1 year ago

I've got the exact same issue, only with elixir.

ray-x commented 1 year ago

Would be great if anyone can turn the logs by doing this:

  debug = false, -- set to true to enable debug logging
  log_path = vim.fn.stdpath("cache") .. "/lsp_signature.log", -- log dir when debug is on
  -- default is  ~/.cache/nvim/lsp_signature.log
  verbose = false, -- show debug line number}

And send me the logs.

I have zero experience with elixir so it will be much easier if someone can reproduce and post the logs.

jared-mackey commented 1 year ago

@ray-x I'd be happy to. How can I send them over to you? I'm still seeing this as of the latest commit.

DanielPower commented 1 year ago

I'm getting the same error with lua-language-server and Love2D. But I'm only getting it on certain function signatures.

love.graphics.newImageFont, love.graphics.newShader both produce this error for example. But most functions work fine. love.graphics.print, love.graphics.shear for example work fine.

Error executing vim.schedule lua callback: /usr/share/nvim/runtime/lua/vim/lsp/util.lua:1402: attempt to index a nil value                                                                                                                                                                                                      
stack traceback:                                                                                                                                                                                                                                                                                                                
        /usr/share/nvim/runtime/lua/vim/lsp/util.lua:1402: in function 'stylize_markdown'                                                                                                                                                                                                                                       
        /usr/share/nvim/runtime/lua/vim/lsp/util.lua:1665: in function 'open_floating_preview'                                                                                                                                                                                                                                  
        .../nvim/lazy/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>         
drselump14 commented 11 months ago

hi guys, does anyone has workaround for this issue?

Graborg commented 11 months ago

Hi! This still happens: Here's the log you specified (running on latest on master e371ff6: lsp_signature.log

ray-x commented 11 months ago

Hi, @Graborg, thanks for the log. I pushed a commit, could you try if the latest fixed the issue?

Graborg commented 11 months ago

Works amazingly. Thank you! And thanks for the crazy quick response 💚