Saghen / blink.cmp

Performant, batteries-included completion plugin for Neovim
MIT License
632 stars 27 forks source link

Implement InsertReplaceEdit support #21

Open synqqrawr opened 3 days ago

synqqrawr commented 3 days ago

If I accept a suggestion from rust-analyzer, I would get this error:

Error executing vim.schedule lua callback: .../nvim/lazy/blink.cmp/lua/blink/cmp/accept/text-edits.lua:12: attempt to index field 'range' (a nil value)                                  
stack traceback:                                                                                                                                                                         
        .../nvim/lazy/blink.cmp/lua/blink/cmp/accept/text-edits.lua:12: in function 'get_from_item'                                                                                      
        .../share/nvim/lazy/blink.cmp/lua/blink/cmp/accept/init.lua:8: in function <.../share/nvim/lazy/blink.cmp/lua/blink/cmp/accept/init.lua:6>                                       
        .../.local/share/nvim/lazy/blink.cmp/lua/blink/cmp/init.lua:139: in function <.../.local/share/nvim/lazy/blink.cmp/lua/blink/cmp/init.lua:139>

This happens on the default config on latest commit

niclas-j commented 2 days ago

Same issue with typescript with the vtsl client.

famiu commented 2 days ago

Not sure if this is the same issue, but I get this error on clangd when accepting LSP completions (only when signature help is turned on):

Error executing vim.schedule lua callback: .../.local/share/nvim/lazy/blink.cmp/lua/blink/cmp/init.lua:78: attempt to index field 'context' (a nil value)
stack traceback:
    .../.local/share/nvim/lazy/blink.cmp/lua/blink/cmp/init.lua:78: in function 'callback'
    ...e/nvim/lazy/blink.cmp/lua/blink/cmp/sources/lib/init.lua:134: in function 'fn'
    .../nvim/lazy/blink.cmp/lua/blink/cmp/sources/lib/async.lua:86: in function 'cb'
    .../nvim/lazy/blink.cmp/lua/blink/cmp/sources/lib/async.lua:44: in function 'resolve'
    .../nvim/lazy/blink.cmp/lua/blink/cmp/sources/lib/async.lua:163: in function 'resolve_if_completed'
    .../nvim/lazy/blink.cmp/lua/blink/cmp/sources/lib/async.lua:169: in function 'cb'
    .../nvim/lazy/blink.cmp/lua/blink/cmp/sources/lib/async.lua:44: in function 'resolve'
    ...nvim/lazy/blink.cmp/lua/blink/cmp/sources/lib/source.lua:106: in function <...nvim/lazy/blink.cmp/lua/blink/cmp/sources/lib/source.lua:106>
calisfed commented 2 days ago

Got same issue with @famiu when adding vim.keymap.set from lua_ls LSP . Confim that turned off signature helped fix the issue

Saghen commented 2 days ago

@famiu Seems like a different issue, can you create a separate issue? Edit: Never mind, resolved this with https://github.com/Saghen/blink.cmp/commit/6a21d7c12d7186313e0dea2c04d0dd63b6534115

Saghen commented 1 day ago

You can temporarily avoid this issue by not setting capabilities.textDocument.completion.completionItem.insertReplaceSupport = true in lspconfig (or elsewhere). This plugin currently only supports the default capabilities as per #13