## Description
`mason-lspconfig` v2 made changes to conform with latest Neovim
`vim.lsp.config`/`vim.lsp.enable` API.
- Lock `mason` and `mason-lspconfig` to v1 versions for Neovim <0.11 and
latest HEAD for Neovim >=0.11.
- Change `:get_install_path()` method in LazyVim to use
`LazyVim.get_pkg_path()` and also update name references to new ones.
- Change `nvim-lspconfig` from `LazyFile` to `{ "BufReadPre",
"BufNewFile", "BufWritePre" }` for Neovim >=0.11, since on `BufReadPost`
the LSP would not attach on the first buffer. Previously the
`setup.handlers()` function from `mason-lspconfig` would take care of
that, but that has been removed on v2. I fail to think if there's a
better way to handle this.
Most of the changes in `/lsp/init.lua` are thanks to @williamboman
comment
[here](https://github.com/LazyVim/LazyVim/pull/6041#issuecomment-2857266471).
I've also seen that both `mason-lspconfig` and `rustaceanvim` now have
as minimum requirements Neovim >=0.11.
As such I would suggest, instead of all the conditional checks for
Neovim versions to create a stable release where we pin `mason` and
`mason-lspconfig` to v1 versions and then only incorporate William's
suggestions in a new release and mention in the README that users who
are on Neovim <0.11 should use the stable release where the plugin
versions are pinned to v1. Not sure how you want to tackle this, so this
is merely just a suggestion from my part.
Both #6041 and #6045 tackle only with the new name references and the
offending line that was causing the error, but don't take into
consideration the LSP servers configurations. `opts.setup` would not
execute on both, since that was handled by `setup_handlers()` function
in the past. I checked with Typescript lang and with those PRs there are
no Javascript settings in `vtsls` (by checking with
`:=LazyVim.opts("nvim-lspconfig").servers.vtsls`).
#6045 also tried to change the method `:get_install_pkg()` by using
`vim.fn.exepath`, but to my understanding that only returns the binary
path not the package installation path and that is later concatenated to
find other paths, which I believe is not correct.
PS: There are 2 commits, because my LazyVim fork was not up to date and
updated it and then merged the branch I had into a new branch. Sorry if
that causes any inconvenience.
<!-- Describe the big picture of your changes to communicate to the
maintainers
why we should accept this pull request. -->
## Related Issue(s)
Fixes#6039
<!--
If this PR fixes any issues, please link to the issue here.
- Fixes #<issue_number>
-->
## Screenshots
<!-- Add screenshots of the changes if applicable. -->
## Checklist
- [x] I've read the
[CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md)
guidelines.
---------
Co-authored-by: Folke Lemaitre <folke.lemaitre@gmail.com>
Co-authored-by: William Boman <william@redwill.se>
Co-authored-by: Luis Durão <kpvrzlzzx@mozmail.com>
## Description
LazyVim comes with a bunch of smaller QoL plugin like features, but it's
not easy for non LazyVim users to use them.
That's why I started working on
[snacks.nvim](https://github.com/folke/snacks.nvim), a collection of
small QoL plugins for Neovim.
Snacks also includes a bunch of new improvements to these features.
This PR fully integrates with snacks.
## Todo
- [ ] add proper deprecations where needed
- [ ] create snacks docs
- [ ] document all the new improvements relevant to LazyVim users
## Closes
- [ ] #4492
- [ ] #4333
- [ ] #4687
## Screenshots
<!-- Add screenshots of the changes if applicable. -->
## Checklist
- [ ] I've read the
[CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md)
guidelines.
## What is this PR for?
Small refactor to use the already available `get_plugin()` function.
## Does this PR fix an existing issue?
No.
## Checklist
- [x] I've read the
[CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md)
guidelines.
## What is this PR for?
Refactoring of pickers in LazyVim:
- [x] telescope moved to extras
- [x] dressing was moved to the telescope extra. Not needed with fzf-lua
and noice
- [x] when none of the two is enabled, then telescope will be enabled
- [x] when using `:LazyExtras` to enable fzf-lua, the telescope spec
will never be parsed
- [x] when not using `:LazyExras`, the spec will be parsed, but one of
the two will be disabled.
- [x] only one picker extra can be used to prevent issues
- [ ] cleanup lsp keymaps
## What is this PR for?
This PR fixes a bug in the `LazyVim.memoize` function that was causing
unexpected behavior in my configuration. The issue was discovered when
setting `vim.g.lazyvim_prettier_needs_config = true` in my
`lua/config/options.lua`, which did not work as expected.
The root cause was an issue with `LazyVim.memoize` cache key generation,
which led to `M.has_config(ctx)` always returning the same result as
`M.has_parser(ctx)`. This happened because `LazyVim.memoize` generates
cache keys based on the function parameters, and both functions were
being called with identical parameters:
7d30360df2/lua/lazyvim/plugins/extras/formatting/prettier.lua (L77-L81)
By improving the cache key generation to include function information,
we can ensure unique keys for different functions even if their
parameters are identical, thereby fixing the issue.
## Does this PR fix an existing issue?
N/A
## Checklist
- [x] I've read the
[CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md)
guidelines.
New extra with an initial implementation of fzf-lua.
## Todo
- [x] check all places that currently depend on telescope and provide an
alternative or disable
- [x] disable telescope spec completely. (currently only removed its
keymaps)
- [x] trouble integration
- [x] https://github.com/ibhagwan/fzf-lua/issues/1241
---------
Co-authored-by: Iordanis Petkakis <12776461+dpetka2001@users.noreply.github.com>