aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim/lsp/protocol.lua
Commit message (Collapse)AuthorAge
* fix(lsp): preserve tag types to stabilize emmylua checks #42117Volodymyr Chernetskyi2026-09-27
| | | | | | | | | | | | | | | | Problem: EmmyLua widens singleton completion and symbol tags to integer during generic inference. Nested field checking can skip the resulting type mismatch depending on member iteration order, making lint flaky. Solution: Annotate both tag tables with their protocol types so get_value_set() preserves the singleton tag types without changing runtime behavior or disabling diagnostics. Validated with 1,000 consecutive full-runtime checks using EmmyLua 0.25.1 on macOS arm64. AI-assisted
* fix(lua): add missing param annotations (#41911)Lewis Russell2026-09-15
|
* feat(lsp): support `workspace/foldingRange/refresh` #41780Volodymyr Chernetskyi2026-09-09
| | | | | | | | | | | Problem: Servers cannot request refreshing stale LSP folding ranges after a project-wide change. Solution: Advertise `workspace.foldingRange.refreshSupport` and re-request folding ranges for active buffers when handling `workspace/foldingRange/refresh`. AI-assisted
* fix(lsp): completion dynamicRegistration breaks capability readers #41771glepnir2026-09-08
| | | | | | | | | | Problem: A server that supports dynamic registration must not also declare completionProvider at initialize, so server_capabilities.completionProvider is nil for anything reading it directly. Solution: Do not advertise it by default. A client that follows a registration can declare it itself.
* fix(lsp): announce typeHierarchy and executeCommand capabilities #41762Volodymyr Chernetskyi2026-09-07
| | | | | | | | | | | Problem: Type hierarchy (#28388, #28467) and `workspace/executeCommand` (#11607) are implemented, but `textDocument.typeHierarchy` and `workspace.executeCommand` are missing from `make_client_capabilities()`. Solution: Declare both capabilities. AI-assisted
* feat(lsp): support dynamic registration of completionProvider #41748glepnir2026-09-07
| | | | | | | | Problem: dynamicRegistration is declared false, and completionProvider is read from server_capabilities only. Solution: Declare it, and prefer registerOptions per field.
* feat(completion): support completionList.applyKind #40769glepnir2026-07-17
| | | | | | | | | | | Problem: values from completionList.itemDefaults always replace the item's own commitCharacters and data. Since 3.18 a server can ask for them to be merged instead. Solution: Handle CompletionList.applyKind and advertise applyKindSupport. Drop itemDefaults once folded into the items: get_items() runs twice on the same result and a Merge isn't idempotent. https://microsoft.github.io/language-server-protocol/specifications/lsp/3.18/specification/#completionItemApplyKinds
* feat(completion): commitCharacters #38417glepnir2026-07-15
| | | | | | | | | Problem: LSP completion commitCharacters are not handled. Typing a commit character (e.g. `.`, `(`, `;`) while a completion item is selected does not accept the item first. Solution: Store commit characters as a flat string in complete-items. Check it before completion stops, accept the match and let the character be inserted normally.
* fix(lsp): improve inlayHint.resolveSupport in client capabilities #40741Robert Muir2026-07-15
| | | | | | | | | | | | | Problem The current list of properties for inlay hint resolve support includes a non-existent "location". This field should be "label.location" according to the specification. Tooltips and commands for inlay hint "parts" aren't advertised as being resolvable. Solution Remove "location" and add "label.location", "label.tooltip", and "label.command". Closes #40740
* docs(lsp): bump protocol/meta to 3.18 #37273Tristan Knight2026-06-10
| | | | fixes glob spec regression related to "zero or more" vs "one or more" for `*` ref: https://github.com/microsoft/language-server-protocol/issues/2217
* fix(lsp): advertise that CompletionItem.detail can be resolved (#39934)Marcus Caisey2026-05-21
| | | | | | | | | Problem: We can resolve the `CompletionItem.detail` field but don't advertise this capability. Solution: Add `detail` to `textDocument.completion.completionItem.resolveSupport.properties`.
* fix(lsp): support nested workspace registrations #39574Tristan Knight2026-05-05
| | | | | | | | | | | Problem: Nested workspace capabilities like workspace.fileOperations.didCreate and workspace.textDocumentContent are not handled consistently for dynamic and static registration provider lookup. Solution: Generate explicit registration-provider mappings from the LSP metadata and use them when registering and querying capabilities. Add coverage for dynamic and static nested workspace registrations.
* feat(completion): completeopt=preselect, LSP CompletionItem.preselect #36613glepnir2026-04-13
| | | | | | | | | | 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.
* feat(lsp): support CompletionItem.labelDetails #38403glepnir2026-03-21
| | | | | | | | | 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
* feat(lsp): do completionItem/resolve if completeopt=popup #32820glepnir2026-03-11
| | | | | | | | | 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.
* fix(lsp): update metamodel (#38174)Maria Solano2026-03-05
|
* fix(lsp): map all LSP methods to server capabilities (#37910)Tristan Knight2026-02-16
|
* feat(lsp): support `textDocument/documentLink` (#37644)Maria Solano2026-02-16
|
* refactor(lsp): centralize provider capability resolution #37221Tristan Knight2026-02-14
| | | | | | | | - 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.
* feat(lsp): support range + full semantic token requests #37611jdrouhard2026-02-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* feat(lsp): support `workspace/codeLens/refresh`Yi Ming2026-02-03
|
* fix(lsp): improve dynamic registration handling #37161Tristan Knight2026-01-02
| | | | | | | | Work on #37166 - Dynamic Registration Tracking via Provider - Supports_Method - Multiple Registrations - RegistrationOptions may dictate support for a method
* Revert "feat(lsp): support `version` in `textDocument/publishDiagnostics` ↵Mathias Fußenegger2025-12-09
| | | | | | | | | #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.
* feat(lsp): support dynamic registration for diagnostics (#36841)Tristan Knight2025-12-06
|
* refactor(lsp): unify capability checks and registration #36781Tristan Knight2025-12-06
| | | | | | | 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
* feat(lsp): support diagnostic refresh requestPig Fang2025-12-05
|
* feat(lsp): semanticTokens/range #36705Tristan Knight2025-11-30
| | | | | | | | | | | | 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.
* feat(lsp): support `version` in `textDocument/publishDiagnostics` #36754Riley Bruins2025-11-29
| | | | This commit makes it so that push diagnostics received for an outdated document version are ignored.
* fix(lsp): enable insertReplaceSupport for use in adjust_start_col #36569Jeff Martin2025-11-18
| | | | | | | | | | | | | | | | | 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.
* fix(lsp): include missing LSP methods and update type annotationsDavidyz2025-10-16
|
* fix(lsp): deprecate `vim.lsp.protocol.Methods` (#35998)Maria Solano2025-10-04
|
* feat(lsp): document method types (#35934)Maria Solano2025-09-27
|
* fix(lsp): use correct `workspace.diagnostics` capability key (#35937)Maria Solano2025-09-27
|
* feat(lsp): support `textDocument/onTypeFormatting` (#34637)Riley Bruins2025-08-31
| | | | | | | | | | 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>
* feat(lsp): support `textDocument/inlineCompletion`Yi Ming2025-08-25
|
* feat(lsp): support signature help noActiveParameterSupport #34838skewb1k2025-08-11
|
* fix(lsp): update capability maps (#35227)Maria José Solano2025-08-07
|
* feat(lsp): diagnostic related documents supportRiley Bruins2025-07-21
|
* feat(lsp): support linked editing ranges #34388Riley Bruins2025-07-19
| | | ref: https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_linkedEditingRange
* feat(lsp): support diagnostic related information (#34474)Riley Bruins2025-07-07
|
* feat(lsp): handle deprecated document symbols (#34751)Maria José Solano2025-07-06
|
* fix(lsp): add `RequestFailed` error code constant #34645Maria José Solano2025-06-26
| | | | 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.
* feat(lsp): support annotated text edits (#34508)Maria José Solano2025-06-23
|
* fix(lsp): advertise supported fold kinds (#34461)Riley Bruins2025-06-16
| | | | This commit also makes it so that folds which have an unsupported fold kind have their `kind` ignored.
* feat(lsp): handle disabled code actions (#34453)Riley Bruins2025-06-16
| | | | This commit also makes it so that disabled code actions are not displayed unless the trigger kind is "Invoked".
* feat(lsp): support multiline semantic tokens #34458Riley Bruins2025-06-13
|
* fix(lsp): correct diagnostic data support and related info capabilities (#34454)Riley Bruins2025-06-12
|
* feat(lsp): incremental selection via "textDocument/selectionRange" #34011Riley Bruins2025-06-12
| | | | Select outwards with "an" and inwards with "in" in Visual mode. Ranges are reset when leaving Visual mode.
* fix(lsp): announce diagnostic tag support (#34436)Riley Bruins2025-06-10
| | | | | 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.
* feat(lsp): workspace diagnostic support (#34262)Maria José Solano2025-06-09
| | | | | * refactor(lsp): remove underscore prefix from local variables * feat(lsp): workspace diagnostic support