echasnovski / mini.nvim

Library of 40+ independent Lua modules improving overall Neovim (version 0.8 and higher) experience with minimal effort
MIT License
4.54k stars 175 forks source link

completion errors out when opening a bracket in .adb (Ada) files #859

Closed Orest58008 closed 2 months ago

Orest58008 commented 2 months ago

Contributing guidelines

Module(s)

mini.completion

Description

mini.completion crashes when trying to complete inside open open brackets in Ada.

The LSP server is ada_language_server of version 24.0.4, configured with require'lspconfig'.als.setup {} and I have jiangmiao/auto-pairs installed

Neovim version

v0.9.5

Steps to reproduce

  1. Open an Ada file
  2. Write a function name (in my case it was Put_Line)
  3. Open a bracket (()
  4. Get error described in Actual behavior

Expected behavior

No response

Actual behavior

Gives this error:

Error executing vim.schedule lua callback: /usr/share/nvim/runtime/lua/vim/lsp/util.lua:1407: 'replacemen
t 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'                
        .../share/nvim/lazy/mini.completion/lua/mini/completion.lua:1085: in function 'show_signature_win
dow'                                                                                                     
        .../share/nvim/lazy/mini.completion/lua/mini/completion.lua:1056: in function 'callback'         
        /usr/share/nvim/runtime/lua/vim/lsp.lua:2020: in function 'handler'                              
        /usr/share/nvim/runtime/lua/vim/lsp.lua:1393: in function ''                                     
        vim/_editor.lua: in function <vim/_editor.lua:0>                                                 
Press ENTER or type command to continue
echasnovski commented 2 months ago

Thanks for the issue!

This seems to happen because 'mini.completion' tries to show signature information and fails due to an upstream error.

I don't have any LSP server for Ada files installed (and would like to keep it that way if possible), so would you mind getting some debug information to help solve this issue?

Here are the steps:

Orest58008 commented 2 months ago
{ { 4, { "```ada", "procedure Put_Line\n  (Item : String)", "```" }, {
      wrap_at = 80
    } } }
echasnovski commented 2 months ago

Thanks for the follow up!

This is indeed an upstream Neovim issue which got resolved in (hopefully soon to be released) 0.10 version. However, I did an update which should make this type of signature lines work on Neovim<0.10.

Orest58008 commented 2 months ago

Thank you for your time, the commit solved the issue!