onsails / lspkind.nvim

vscode-like pictograms for neovim lsp completion items
MIT License
1.51k stars 39 forks source link

vim_item.menu is overwritten when setting the kind #72

Closed micangl closed 11 months ago

micangl commented 11 months ago

When lspkind.nvim sets the vim_item.menu field of an entry, it may overwrite some data already stored in the variable. An example of this is the seldomly employed labelDetails.description, which is concatenated by nvim-cmp with the menu field before the formatting.format function is called on the item.

    if opts.menu ~= nil then
      vim_item.menu = opts.menu[entry.source.name]
    end

This simple fix solves the problem.