summaryrefslogtreecommitdiffstatshomepage
path: root/runtime/lua/vim/lsp/buf.lua
AgeCommit message (Collapse)AuthorFiles
2026-04-11fix(lsp): check stale context in hover/signature callback #38724glepnir1
Problem: hover/signature callback lacked consistency checks, so slow LSP servers could open a float after the cursor had already moved away. Solution: guard the callback with buf validity, buf version, and cursor position checks before opening the float. Also fix table capacity calculation. (cherry picked from commit af9a72d8c105129bb107ee0bc9a38ade44caf7b6)
2026-04-08fix(diagnostics)!: restore `is_pull` namespace argument #38698Maria Solano1
Problem: The current LSP diagnostic implementation can't differ between a pull diagnostic with no identifier and a set of diagnostics provided via push diagnostics. "Anonymous pull providers" are expected by the protocol https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#diagnosticOptions , depending on how the capability was registered: - Dynamic registrations have an identifier. - Static registrations will not. Solution: Restore the `is_pull` argument removed in https://github.com/neovim/neovim/pull/37938, keeping the identifier of pull diagnostic collections. (cherry picked from commit 665ebce56924fbbdc4a13327a360a46791ae4c54)
2026-03-23fix(lsp): get_namespace signature (#38449)Tristan Knight1
Problem: Since the change to `pull_id` in #37938 we used the deprecated signature internally Solution: Don't
2026-03-21feat(lua): replace `buffer` with `buf` in vim.keymap.set/del #38360skewb1k1
The `buffer` option remains functional but is now undocumented. Providing both will raise an error. Since providing `buf` was disallowed before, there is no code that will break due to using `buffer` alongside `buf`.
2026-03-21fix(lsp/diagnostic): use diagnostic provider identifier for code actions #38401Sergei Slipchenko1
Problem: f9b2189b287a14478546da72b7ecdfd3afe981c7 started using namespaces for pull diagnostics that look like this `<id>:<identifier>`. `vim.lsp.buf.codeaction` passes `true` instead of an identifier to `vim.lsp.diagnostic.get_namespace`, resulting in a namespace that looks like `<id>:nil`. The end result is that none of the diagnostics are passed to `textDocument/codeAction` request. Because of that server might not send any code actions back. For example, eslint lsp responds with an empty list of actions if it receives no diagnostics. Solution: use `_provider_foreach` to collect diagnostics from all `identifiers` and use that identifier to get a namespace instead of `true`.
2026-03-19fix(lsp): improve diagnostics handling and commentstris2031
- Add TODO comments for aggregating diagnostics from all pull namespaces and for clearing diagnostics when an empty array is received, referencing the LSP specification. - Update diagnostics refresh logic to safely access previousResultId, preventing potential nil errors.
2026-02-01fix(lsp): call `on_list` before reading `loclist` #37645Maria Solano1
Problem: `on_list` is supposed to replace the default list-handler. With the current order of these `if` statements `on_list` won't be called if `loclist` is true. Solution: Change the order of the relevant blocks.
2026-01-23feat(lsp): highlighting the symbol being renamed (#37390)Yi Ming1
2026-01-12docs: misc (#37281)zeertzjq1
Close #37289 Close #37348 Co-authored-by: Marc Jakobi <marc@jakobi.dev> Co-authored-by: Anton Kesy <anton@kesy.de>
2026-01-07docs: misc (#37280)zeertzjq1
Close #36806 Close #36812 Close #37003 Close #37016 Close #37038 Close #37039 Close #37157 Close #37185 Close #37213 Co-authored-by: saroj_r <sarojregmi.official@gmail.com> Co-authored-by: Olivia Kinnear <git@superatomic.dev> Co-authored-by: Igor <igorlfs@ufmg.br> Co-authored-by: Justin Roberts <JustinEdwardLeo@gmail.com> Co-authored-by: "Mike J. McGuirk" <mike.j.mcguirk@gmail.com> Co-authored-by: Aymen Hafeez <49293546+aymenhafeez@users.noreply.github.com> Co-authored-by: Peter Cardenas <16930781+PeterCardenas@users.noreply.github.com> Co-authored-by: DrNayak2306 <dhruvgnk.work@gmail.com>
2025-11-24feat(lsp): incremental-selection operator-pending mode #36575Branden Call1
Problem: LSP incremental selection provides default visual-mode keymaps for `an` and `in`. Operator-pending mode is not supported, so `dan` and `can` do not apply the operation. Solution: Modify selection_range() to be synchronous. Add operator-pending mappings.
2025-11-12fix(lsp): reuse_win prioritizes windows/tabs currently displayed #36486Toby She1
Problem: reuse_win will always jump to the first window containing the target buffer rather even if the buffer is displayed in the current window/tab Solution: check to see if the buffer is already displayed in the current window or any window of the current buffer
2025-10-05feat(lsp): pass client ID in code action filter (#36046)Maria Solano1
2025-10-04fix(lsp): deprecate `vim.lsp.protocol.Methods` (#35998)Maria Solano1
2025-09-16docs: small fixes (#35791)zeertzjq1
Close #34938 Close #35030 Close #35233 Close #35259 Close #35290 Close #35433 Close #35541 Close #35766 Close #35792 Co-authored-by: huylg <45591413+huylg@users.noreply.github.com> Co-authored-by: Jason Del Ponte <961963+jasdel@users.noreply.github.com> Co-authored-by: sooriya <74165167+thuvasooriya@users.noreply.github.com> Co-authored-by: Andrew Braxton <andrewcbraxton@gmail.com> Co-authored-by: Enric Calabuig <enric.calabuig@gmail.com> Co-authored-by: Augusto César Dias <augusto.c.dias@gmail.com> Co-authored-by: David Sierra DiazGranados <davidsierradz@gmail.com> Co-authored-by: Stepan Nikitin <90522882+vectravox@users.noreply.github.com> Co-authored-by: Emilien Breton <bricktech2000@gmail.com>
2025-08-28refactor(lua): consistent use of local aliasesChristian Clason1
2025-08-27fix(lsp): don't treat MarkedString[] with language id as empty #35518Robert Muir1
Problem: Hover response of MarkedString[] where the first element contains a language identifier treated as empty. Solution: Fix empty check to handle case of MarkedString[] where the first element is a pair of a language and value.
2025-08-21fix(lsp): handle array with empty string when checking empty hover (#35423)Igor Lacerda1
2025-08-20fix(lsp): update window title when cycling through signatures #35407Tiago Inaba1
2025-08-11feat(lsp): support signature help noActiveParameterSupport #34838skewb1k1
2025-08-11docs(lsp): specify formatting_options type (#35302)Riley Bruins1
2025-08-06feat(lsp): improve signature help display #35190skewb1k1
- Add delimiter between function signature and documentation, matching hover formatting - Show title only if there are multiple clients or multiple signatures - Avoid duplicating the title inside the window if it's already shown in the border
2025-08-03revert(lsp): compare to `vim.NIL` in `lsp/buf.lua` (#35156)Maria José Solano1
revert(lsp): "compare to `vim.NIL` in `lsp/buf.lua` #35154" This reverts commit a5c598871bcc16f1bc6fb8d46eb826d83d7d0f24.
2025-08-03fix(lsp): compare to `vim.NIL` in `lsp/buf.lua` #35154Maria José Solano1
2025-08-02fix(lsp): handle nil response in references request #35139Maria José Solano1
2025-07-26fix(lsp): don't override `config.title` in `vim.lsp.buf.signature_help()` #35075Maria José Solano1
2025-07-20fix(lsp): show notification with empty hover response (#35014)Maria José Solano1
2025-07-06refactor(lsp): narrower `hierarchy` argument type (#34799)Maria José Solano1
2025-07-06refactor(lsp): consistent usage of vim.notify #34802Maria José Solano1
2025-07-04fix(lsp): consistent use of `vim.notify`/logging with unsupported methodsMaria José Solano1
2025-07-04fix(lsp): remove extra notify on empty hoverMaria José Solano1
2025-06-26fix(lsp): include context for each client in multi-handler results (#34669)Maria José Solano1
2025-06-23refactor(lsp): use `vim.lsp.buf_request_all` internally (#34604)Maria José Solano1
2025-06-17fix(lsp): support v:count in selection_range() #34551Riley Bruins1
Co-authored-by: Yi Ming <ofseed@foxmail.com>
2025-06-16feat(lsp): handle disabled code actions (#34453)Riley Bruins1
This commit also makes it so that disabled code actions are not displayed unless the trigger kind is "Invoked".
2025-06-16fix(lsp): add missing argument validations (#34519)Maria José Solano1
2025-06-15fix(lsp): use correct deprecation function (#34518)Maria José Solano1
2025-06-12feat(lsp): <Plug> mapping for signature help cycling #34039Tiago Inaba1
Replace direct function mappings with `<Plug>` mappings for cycling through overloaded signatures, providing better customization options for users. This change keeps the default mapping (`<C-s>`) for cycling if `<Plug>(nvim.lsp.ctrl-s)` is not mapped.
2025-06-12feat(lsp): incremental selection via "textDocument/selectionRange" #34011Riley Bruins1
Select outwards with "an" and inwards with "in" in Visual mode. Ranges are reset when leaving Visual mode.
2025-06-09feat(lsp): workspace diagnostic support (#34262)Maria José Solano1
* refactor(lsp): remove underscore prefix from local variables * feat(lsp): workspace diagnostic support
2025-06-06fix: type fixesLewis Russell1
Type fixes caught by emmylua
2025-04-27docs: lsp, emoji, startup #33446Justin M. Keyes1
Co-authored-by: Maria José Solano <majosolano99@gmail.com>
2025-04-26fix(lsp): cycling signatures with the default `config.focusable`Yi Ming1
2025-04-26fix(lsp): prioritize showing active signatureYi Ming1
2025-04-17fix(lsp): opts.reuse_win does not jump if buf is already open #33476Au.1
Problem: `vim.lsp.buf.[implementation|definition|...]({ reuse_win = true })` does not jump cursor to existing window if buffer is already open. Steps to reproduce: 1. `nvim repro.lua` 2. Insert anything that lsp can read to open the library definition/implementation, e.g., `vim.keymap.set` 3. open `repro.lua` buffer and the library buffer side by side. 4. type `gd` over `set` to jump to the library definition. The open buffer is scrolled to the target line, but cursor does not jump. Solution: Call nvim_set_current_win if necessary.
2025-04-17feat(lsp): use stricter types for methodsLewis Russell1
This change modifies gen_lsp.lua so alias types are generated for various types of lsp methods to distinguish between notifications and requests: - vim.lsp.protocol.Method.ServerToClient.Request - vim.lsp.protocol.Method.ServerToClient.Notification - vim.lsp.protocol.Method.ClientToServer.Request - vim.lsp.protocol.Method.ClientToServer.Notification These types are then used instead of `string` where appropriate.
2025-03-15fix(lsp): correctly check for "codeAction/resolve" supportTobias Schmitz1
2025-03-07fix(lsp): use unresolved code action when `codeAction/resolve` failsMaria José Solano1
2025-03-06feat(lsp): support for resolving code action command (#32704)Maria José Solano1
* fix(lsp): don't call codeAction_resolve with commands * feat(lsp): support for resolving code action command
2025-03-02docs: misc #31996Justin M. Keyes1