perf(luasnip): luasnip wasn't lazyloaded (#4032)

## Description

this makes the extra luasnip lazy load at the same time as nvim cmp.
just putting `lazy = true` works because `nvim-cmp` when being loaded
with `InsertEnter` also load `cmp-luasnip`, which itself load `LUASNIP`.

you can see the problem in the following discussion
https://github.com/LazyVim/LazyVim/discussions/3966 where luasnip was
not lazy loaded when starting lazyvim. This was also loading nvim-cmp
and all its dep when starting lazyvim, which negatively impacted
performance.

## Related Issue(s)

https://github.com/LazyVim/LazyVim/discussions/3966

## Checklist

- [x] I've read the
[CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md)
guidelines.
This commit is contained in:
Lucas 2024-07-14 18:19:28 +02:00 committed by GitHub
parent 29e285d882
commit e80ed322a7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,6 +1,7 @@
return { return {
{ {
"L3MON4D3/LuaSnip", "L3MON4D3/LuaSnip",
lazy = true,
build = (not LazyVim.is_win()) build = (not LazyVim.is_win())
and "echo 'NOTE: jsregexp is optional, so not a big deal if it fails to build'; make install_jsregexp" and "echo 'NOTE: jsregexp is optional, so not a big deal if it fails to build'; make install_jsregexp"
or nil, or nil,