VonHeikemen / lsp-zero.nvim

A starting point to setup some lsp related features in neovim.
https://lsp-zero.netlify.app/v4.x/
MIT License
3.76k stars 95 forks source link

snippets don't work unless cmp-luasnip is added as a dependency #142

Closed juantascon closed 1 year ago

juantascon commented 1 year ago

I had to add "saadparwaiz1/cmp_luasnip" as a dependency for snippets to work, perhaps it's a good idea to update the docs to reflect that

VonHeikemen commented 1 year ago

You can still get snippets from the LSP servers. What you don't get are the ones from friendly-snippets.

ByteDrummer commented 1 year ago

I also encountered this and found it confusing that we're told to add 'L3MON4D3/LuaSnip' but can't use it as a source for cmp without 'saadparwaiz1/cmp_luasnip' unless there's something I'm missing.

VonHeikemen commented 1 year ago

nvim-cmp can use luasnip to expand snippets that come from your LSP server, so technically you don't need saadparwaiz1/cmp_luasnip in order to have "snippet support".

saadparwaiz1/cmp_luasnip is the plugin that loads your custom snippets into the completion menu.

ByteDrummer commented 1 year ago

That makes sense, thank you. It would be helpful to mention that in https://github.com/VonHeikemen/lsp-zero.nvim/blob/v2.x/doc/md/autocomplete.md#add-an-external-collection-of-snippets