summaryrefslogtreecommitdiffstatshomepage
path: root/runtime/lua/vim/lsp/protocol.lua
AgeCommit message (Collapse)AuthorFiles
2026-04-13feat(completion): completeopt=preselect, LSP CompletionItem.preselect #36613glepnir1
Problem: LSP CompletionItem.preselect is not supported. https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#completionClientCapabilities Solution: - Add "preselect" field to complete-items and "preselect" flag to 'completeopt'. - Set preselectSupport=true in LSP client capabilities.
2026-03-21feat(lsp): support CompletionItem.labelDetails #38403glepnir1
Problem: CompletionItem.labelDetails is ignored, losing function signatures and module info in the completion menu. Solution: Append labelDetails.detail to abbr and use labelDetails.description for menu with fallback to item.detail. https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#completionItemLabelDetails
2026-03-11feat(lsp): do completionItem/resolve if completeopt=popup #32820glepnir1
Problem: No completionItem/resolve handler. Solution: If completeopt=popup is set, invoke completionItem/resolve when a completion item is selected. Show resolved documentation in popup next to the completion menu.
2026-03-05fix(lsp): update metamodel (#38174)Maria Solano1
2026-02-16fix(lsp): map all LSP methods to server capabilities (#37910)Tristan Knight1
2026-02-16feat(lsp): support `textDocument/documentLink` (#37644)Maria Solano1
2026-02-14refactor(lsp): centralize provider capability resolution #37221Tristan Knight1
- Refactor LSP client to use unified provider-based capability lookup for diagnostics and other features. - Introduce `_provider_value_get` to abstract capability retrieval, supporting both static and dynamic registrations. - Update diagnostic handling and protocol mappings to leverage provider-centric logic.
2026-02-03feat(lsp): support range + full semantic token requests #37611jdrouhard1
From the LSP Spec: > There are two uses cases where it can be beneficial to only compute > semantic tokens for a visible range: > > - for faster rendering of the tokens in the user interface when a user > opens a file. In this use case, servers should also implement the > textDocument/semanticTokens/full request as well to allow for flicker > free scrolling and semantic coloring of a minimap. > - if computing semantic tokens for a full document is too expensive, > servers can only provide a range call. In this case, the client might > not render a minimap correctly or might even decide to not show any > semantic tokens at all. This commit unifies the usage of range and full/delta requests as recommended by the LSP spec and aligns neovim with the way other LSP clients use these request types for semantic tokens. When a server supports range requests, neovim will simultaneously send a range request and a full/delta request when first opening a file, and will continue to issue range requests until a full response is processed. At that point, range requests cease and full (or delta) requests are used going forward. The range request should allow servers to return a result faster for quicker highlighting of the file while it works on the potentially more expensive full result. If a server decides the full result is too expensive, it can just error out that request, and neovim will continue to use range requests. This commit also fixes and cleans up some other things: - gen_lsp: registrationMethod or registrationOptions imply dynamic registration support - move autocmd creation/deletion to on_attach/on_detach - debounce requests due to server refresh notifications - fix off by one issue in tokens_to_ranges() iteration
2026-02-03feat(lsp): support `workspace/codeLens/refresh`Yi Ming1
2026-01-02fix(lsp): improve dynamic registration handling #37161Tristan Knight1
Work on #37166 - Dynamic Registration Tracking via Provider - Supports_Method - Multiple Registrations - RegistrationOptions may dictate support for a method
2025-12-09Revert "feat(lsp): support `version` in `textDocument/publishDiagnostics` ↵Mathias Fußenegger1
#36754" (#36865) This reverts commit 03d6cf7aae4a72c7221a4fb8ebb14a7c8603ba18. See https://github.com/neovim/neovim/pull/36754#issuecomment-3626115697 The change was supposed to avoid showing stale diagnostics but had the opposite effect.
2025-12-06feat(lsp): support dynamic registration for diagnostics (#36841)Tristan Knight1
2025-12-06refactor(lsp): unify capability checks and registration #36781Tristan Knight1
Problem: Our LSP type system didnt have a concept of RegistrationMethods, this is where the method to dynamically register for a capability is sent to a different method endpoint then is used to call it. Eg `textDocument/semanticTokens` rather than the specific full/range/delta methods Solution: Extended generator to create `vim.lsp.protocol.Methods.Registration` with these registration methods. Also extend `_request_name_to_client_capability` to cover these methods. Adjust typing to suit
2025-12-05feat(lsp): support diagnostic refresh requestPig Fang1
2025-11-30feat(lsp): semanticTokens/range #36705Tristan Knight1
Problem: Nvim supports `textDocument/semanticTokens/full` and `…/full/delta` already, but most servers don't support `…/full/delta` and Nvim will try to request and process full semantic tokens response on every buffer change. Even though the request is debounced, there is noticeable lag if the token response is large (in a big file). Solution: Support `textDocument/semanticTokens/range`, which requests semantic tokens for visible screen only.
2025-11-29feat(lsp): support `version` in `textDocument/publishDiagnostics` #36754Riley Bruins1
This commit makes it so that push diagnostics received for an outdated document version are ignored.
2025-11-18fix(lsp): enable insertReplaceSupport for use in adjust_start_col #36569Jeff Martin1
Problem: With the typescript LSes typescript-language-server and vtsls, omnicompletion on partial tokens for certain types, such as array methods, and functions that are attached as attributes to other functions, either results in no entries populated in the completion menu (typescript-language-server), or an unfiltered completion menu with all array methods included, even if they don't share the same prefix as the partial token being completed (vtsls). Solution: Enable insertReplaceSupport and uses the insert portion of the lsp completion response in adjust_start_col if it's included in the response. Completion results are still filtered client side.
2025-10-16fix(lsp): include missing LSP methods and update type annotationsDavidyz1
2025-10-04fix(lsp): deprecate `vim.lsp.protocol.Methods` (#35998)Maria Solano1
2025-09-27feat(lsp): document method types (#35934)Maria Solano1
2025-09-27fix(lsp): use correct `workspace.diagnostics` capability key (#35937)Maria Solano1
2025-08-31feat(lsp): support `textDocument/onTypeFormatting` (#34637)Riley Bruins1
Implements [on-type formatting](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.18/specification/#textDocument_onTypeFormatting) using a `vim.on_key()` approach to listen to typed keys. It will listen to keys on the *left hand side* of mappings. The `on_key` callback is cleared when detaching the last on-type formatting client. This feature is disabled by default. Co-authored-by: Maria José Solano <majosolano99@gmail.com>
2025-08-25feat(lsp): support `textDocument/inlineCompletion`Yi Ming1
2025-08-11feat(lsp): support signature help noActiveParameterSupport #34838skewb1k1
2025-08-07fix(lsp): update capability maps (#35227)Maria José Solano1
2025-07-21feat(lsp): diagnostic related documents supportRiley Bruins1
2025-07-19feat(lsp): support linked editing ranges #34388Riley Bruins1
ref: https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_linkedEditingRange
2025-07-07feat(lsp): support diagnostic related information (#34474)Riley Bruins1
2025-07-06feat(lsp): handle deprecated document symbols (#34751)Maria José Solano1
2025-06-26fix(lsp): add `RequestFailed` error code constant #34645Maria José Solano1
Also remove `serverErrorStart/End` as [the spec](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#errorCodes) says that they're deprecated and don't even represent a real error code.
2025-06-23feat(lsp): support annotated text edits (#34508)Maria José Solano1
2025-06-16fix(lsp): advertise supported fold kinds (#34461)Riley Bruins1
This commit also makes it so that folds which have an unsupported fold kind have their `kind` ignored.
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-13feat(lsp): support multiline semantic tokens #34458Riley Bruins1
2025-06-12fix(lsp): correct diagnostic data support and related info capabilities (#34454)Riley Bruins1
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-10fix(lsp): announce diagnostic tag support (#34436)Riley Bruins1
This commit also adds a type annotation to the returned client capabilities table, because without it lua_ls does not provide autocompletion for the fields within the table.
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-05-25fix(lsp): announce `normalizesLineEndings` capability (#34175)Maria José Solano1
2025-05-04feat(lsp): support `documentColor` dynamic registration #33800Maria José Solano1
2025-04-26feat(lsp): generate method to client capability mapMaria José Solano1
2025-04-24feat(lsp): support `textDocument/documentColor`Maria José Solano1
test(lsp): add tests form `vim.lsp.document_color`
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-10feat(lsp): support completion context #32793Maria José Solano1
Problem: vim.lsp.completion with "autotrigger" enabled, does not send completion context, even though it has all the necessary info. Solution: Include the context for "autotrigger". trigger() also optionally accepts context when manually invoked.
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-02-21feat(lsp): use the meta model to generate server capability mapMaria José Solano1
2025-02-17feat(lsp): update LSP typesMaria José Solano1
2025-02-14feat(lsp): add support for completionItem.command resolvingMathias Fussenegger1
`command` was already resolved via a `completionItem/resolve` request but only if `additionalTextEdits` were also present, and the `resolveSupport` capability wasn't listed. Closes https://github.com/neovim/neovim/issues/32406
2025-01-27fix: resolve all remaining LuaLS diagnosticsLewis Russell1
2024-11-29feat(lsp): support `textDocument/foldingRange` (#31311)Yi Ming1
* refactor(shared): extract `vim._list_insert` and `vim._list_remove` * feat(lsp): add `vim.lsp.foldexpr()` * docs(lsp): add a todo for state management * feat(lsp): add `vim.lsp.folding_range.foldclose()` * feat(lsp): schedule `foldclose()` if the buffer is not up-to-date * feat(lsp): add `vim.lsp.foldtext()` * feat(lsp): support multiple folding range providers * refactor(lsp): expose all folding related functions under `vim.lsp.*` * perf(lsp): add `lsp.MultiHandler` for do `foldupdate()` only once