37 Commits

Author SHA1 Message Date
Iordanis Petkakis
03f1293e33 fix(util.lsp): pass formatters_by_ft to opts (#6894)
## Description
Here
c64a61734f/lua/lazyvim/util/lsp.lua (L50)
we call directly `conform.format` with our specific options.

`conform.nvim` also allows passing options such as `lsp_format` directly
to `formatter_by_ft` as also can be seen
[here](5420c4b5ea/doc/conform.txt (L20-L21)).
Those options are not passed when we call `conform.format(opts)` in the
LSP formatter.

So, we add these options. Also, fix the correct name for general format
options, since it had been changed at some time in `conform.nvim` and
that change made it to the plugin spec, but not here.
<!-- Describe the big picture of your changes to communicate to the
maintainers
  why we should accept this pull request. -->

## Related Issue(s)
Fixes #6893
<!--
  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.
2026-03-01 10:12:58 +01:00
Iordanis Petkakis
a4e19e9c9c fix(util.lsp): LazyVim.lsp.execute only request single client (#6904)
## Description
`LazyVim.lsp.execute` uses `vim.lsp.buf_request` which sends the request
to all attached clients.

`LazyVim.lsp.execute` seems to me to be the equivalent of
[vim.lsp.buf.execute_command](922816877f/runtime/lua/vim/lsp/buf.lua (L1366-L1376)),
but adds the option to also open in Trouble. Otherwise the request is
being made the same way. This command will be deprecated in 0.12 and
it's advised to use `client:exec_cmd` instead.

Since LazyVim supports Neovim >=0.11.2, it makes sense to refactor the
corresponding codeblock and use `client:cmd_exec` instead (it's already
available in Neovim 0.11).

I only changed the necessary parts where `vim.lsp.buf_request` was being
used and not Trouble (when `opts.open = true`), since I'm not familiar
with its codebase. That's also why I went for extending `params` in the
`else` branch instead of adding `title` into original `params`, since I
didn't know how Trouble will react to this change. Not sure if maybe
there also needs to be some change there.
<!-- Describe the big picture of your changes to communicate to the
maintainers
  why we should accept this pull request. -->

## Related Issue(s)
Fixes #6900
<!--
  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.
2026-03-01 09:31:44 +01:00
Folke Lemaitre
3964433062 feat(lsp): refactor lsp code to use Snacks.util.lsp.on 2025-10-25 16:56:19 +02:00
Folke Lemaitre
f4e64eea45 refactor(lsp): remove LazyVim.lsp.get_clients 2025-09-16 17:34:17 +02:00
Folke Lemaitre
23b9cdeb34 fix(lspconfig): remove all references to lspconfig. Closes #6426 2025-09-15 20:42:10 +02:00
Folke Lemaitre
44ade7fdea fix(lsp): buffer should be second arg for supports_method 2025-09-15 17:15:51 +02:00
Folke Lemaitre
a7a94c50ac refactor: remove all <0.11 compat code 2025-09-15 11:16:53 +02:00
Folke Lemaitre
bed725a054 fix(lsp): fixed deprecated warnings 2025-09-15 07:44:02 +02:00
Folke Lemaitre
2f4697443c feat(core)!: move a bunch of LazyVim features to snacks.nvim (#4706)
## 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.
2024-11-07 15:54:47 +01:00
Folke Lemaitre
6e4025229d fix(lsp): backward compat with lspconfig refactor. Fixes #4525. See #4518 2024-10-02 10:18:21 +02:00
Folke Lemaitre
0d57115f01 fix(lsp): dont highlight document words when cmp is visible 2024-06-16 15:17:56 +02:00
Folke Lemaitre
52b572881b fix(lsp): add file completion to rename file 2024-06-12 10:43:01 +02:00
Folke Lemaitre
d90930b13e fix(typescript): implemented move to new file. Fixes #3534 2024-06-08 07:30:49 +02:00
Folke Lemaitre
a636bf2022 feat(typescript): open locations from lsp execute command with trouble for vtsls 2024-06-05 22:19:19 +02:00
Folke Lemaitre
1bd4d2fc72 feat(lsp): simpler API to deal with code actions 2024-06-05 22:18:14 +02:00
Folke Lemaitre
f6bcf6f12c fix(lsp): fix ts/deno both attaching 2024-05-29 15:39:17 +02:00
Folke Lemaitre
b949dba489 feat(lsp): added leader-cR to rename the current file and to lsp rename operations 2024-05-29 14:45:55 +02:00
Folke Lemaitre
4bbeb37a18 fix(lsp): fix LazyVim's on_file_rename to work according to the lsp spec 2024-05-29 14:45:55 +02:00
Folke Lemaitre
0a63734b78 fix(lsp): double check for documentHighlight. See #3246 2024-05-27 18:22:44 +02:00
Folke Lemaitre
b3373f3428 fix(lsp): added a-n, a-p for document highlights and cycling. Closes #3320 2024-05-26 16:03:13 +02:00
Lawrence Ho
07a137199c fix(lsp): properly get buffer for dynamic capabilities (#3315) 2024-05-26 10:11:12 +02:00
Folke Lemaitre
10ed3082a4 fix(lsp): use proper buffer for dynamic capabilities. Fixes #3246 2024-05-23 17:39:23 +02:00
Folke Lemaitre
8c94842b4a fix(lsp): sometimes lsp client is not fully initialized and doesnt yet have client.supports_method on 0.9.5. Fixes #3263 2024-05-21 18:23:10 +02:00
Folke Lemaitre
3db94e44a0 refactor(lsp): refactored again :) 2024-05-20 20:25:55 +02:00
Folke Lemaitre
ac092289f5 refactor(lsp): prevent autocmd leaks 2024-05-20 00:56:25 +02:00
Folke Lemaitre
69751cf417 refactor(lsp): refactored on_supports_method 2024-05-20 00:35:52 +02:00
Folke Lemaitre
20e002f9f0 feat(lsp): properly update certain Neovim functionlity based on dynamic capabilities. See #3244. Fixes #3246 2024-05-20 00:08:05 +02:00
Folke Lemaitre
a4d83524a7 fix(lsp): move next/prev reference keymaps to lsp keymaps. See #3220 2024-05-18 15:46:35 +02:00
Iordanis Petkakis
b1ea356e6c fix(util.lsp): add desc for keymaps reference (#3193) 2024-05-17 11:19:34 +02:00
Folke Lemaitre
87493af237 fix(lsp): dont try to highlight refs for deleted buffers 2024-05-17 10:10:31 +02:00
Folke Lemaitre
cc99b219de feat(lsp): document highlights now use native lsp. vim-illuminate is available as an extra 2024-05-17 09:19:28 +02:00
Folke Lemaitre
7a5dbeae75 feat: use LazyVim everywhere instead of require("lazyvim.util") 2024-03-22 09:15:09 +01:00
Alexander Arvidsson
213493e766 fix(format): Don't leak bufnr into opts tables (#2794) 2024-03-22 07:18:15 +01:00
Iordanis Petkakis
afca0b7876 fix(conform): make lsp_fallback option user configurable (#2616) 2024-03-14 14:14:41 +01:00
Folke Lemaitre
3f1bf70b14 refactor(util.lsp): easier lsp client filters 2023-10-13 12:20:55 +02:00
Folke Lemaitre
4584410e76 feat(format): use conform as lsp formatter since it has better format diffs 2023-10-13 09:45:35 +02:00
Folke Lemaitre
c8c929c9fd perf(util): split lazyvim.util in smaller separate modules 2023-10-12 11:48:02 +02:00