aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim/lsp/handlers.lua
Commit message (Collapse)AuthorAge
* fix(lua): enable param-type-mismatch diagnosticLewis Russell2026-09-28
| | | | | | | | | Problem: Argument type mismatches are excluded from EmmyLua checks. Solution: Correct runtime annotations and calls, document local checker workarounds, and enable the diagnostic. AI-assisted
* fix(lua): enable unnecessary-assert diagnosticLewis Russell2026-09-28
| | | | AI-assisted
* fix(lua): enable nil-safety diagnostics in runtime codeLewis Russell2026-09-25
| | | | | | | | | | | | Enable EmmyLua's need-check-nil diagnostic and resolve nullable values through more precise types, explicit invariants, and guards for missing runtime state. Keep analyzer-specific workarounds local and update the affected API documentation. Exclude the bundled re.lua from analysis so its nil-check warnings do not fail CI. AI-assisted
* fix(lua): add missing param annotations (#41911)Lewis Russell2026-09-15
|
* build: enable more EmmyLua checksLewis Russell2026-09-09
| | | | | | | | | | Enable checks for unused code, deprecated calls, return types, and annotations. Fix the warnings and replace the deprecated highlight function. Keep exceptions where old APIs are still needed or the checker gets it wrong. AI-assisted
* 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
* refactor(lsp): convert diagnostics to capability framework #40433jdrouhard2026-06-26
| | | | | | | | | | | | | | | | | | | | | | | | | Problem: Diagnostic tracking used a separate bufstates table and manual LspDetach/LspNotify autocmd management via _enable()/_refresh(), duplicating the lifecycle logic already provided by the Capability framework. This caused inconsistencies in how client attach/detach and buffer teardown were handled compared to other LSP features. Solution: Replace the ad-hoc bufstate tracking and _enable/_refresh pattern in vim.lsp.diagnostic with a proper Diagnostics subclass of Capability. This cleans up a few random places in the main lsp module and client module that were poking the diagnostics. It also fixes some pre-existing bugs and inconsistencies that were discovered: - Refresh diagnostics immediately on attach instead of lazily by the first didOpen/didChange notification - Fix Capability.active lookup in M.enable() to key by it_bufnr instead of the filter bufnr - Set lsp defaults before calling the _text_document_did_open_handler in Client:on_attach() so defaults are there before any lsp notification occurs - Log (and return early) on any error from a diagnostic request result instead of only returning early for server cancelled errors
* refactor(lsp): remove some private utility functionsYi Ming2026-05-16
| | | | | | | | | Problem: `make_position_params`/`get_line_byte_from_position`/`make_line_range_params` are private functions and their functionality can be replaced by `vim.pos` now. Solution: Remove them, use `vim.pos` instead.
* fix(lsp): callHierarchy/outgoingCalls ranges are relative to caller, not ↵Ashley Hauck2026-04-23
| | | | | | | | | | | | | callee #39336 Problem: The fromRanges field of the result of callHierarchy/outgoingCalls is documented as being relative to the caller. Using vim.lsp.buf.outgoing_calls() opened the qflist with an entry with the callee's filename, but the caller's line number. Solution: Open the qflist with the callers file (the bufnr from the request), rather than the callees (the uri from the resulting CallHierarchyItem)
* fix(lsp): guard dynamic capability attachment #38382Tristan Knight2026-03-20
| | | | | | | | | Problem: The capability attach path for client/registerCapability can initialize a capability even when the capability was only registered in specific buffers Solution: Check supports_method() before attaching capabilities from the dynamic registration handler so unsupported registrations are ignored. AI-assisted: OpenCode
* feat(lsp): migrate `document_color` to capability framework (#38344)Maria Solano2026-03-18
| | | | | * feat(lsp): migrate `document_color` to capability framework * feat(lsp): use `vim.Range` in `document_color` module
* fix(lsp): support workspace/configuation with no section #27510Tim Pope2026-02-15
| | | | | | | | | | | | | | | | | | | The [spec for `workspace/configuration`](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#workspace_configuration) marks the `section` property of each item in `items` optional. Therefore, I believe it violates the spec to skip over items without a section, because then the length of the results won't match the length of a valid `items` input. The spec does not elaborate on _what_ to return in this case, but I don't think it would be controversial to say that returning the full configuration, as done for an empty string, is the most natural interpretation. That empty string case, by the way, was initially [added in response](https://github.com/neovim/nvim-lspconfig/commit/5da124fc82c24592abc3a97c68363bb4e85e3c85) to a real world implementation requesting it. I don't have a similar real world implementation to point to for the omitted `section`, but I would note that `getConfiguration()` from `vscode-languageserver-node` [defaults to a request with no section](https://github.com/Microsoft/vscode-languageserver-node/blob/d859bb14d1bcb3923eecaf0ef587e55c48502ccc/server/src/common/configuration.ts#L24-L26) when called with no arguments. I surmise that this is intended as a way to retrieve the full configuration.
* feat(lsp): support `workspace/codeLens/refresh`Yi Ming2026-02-03
|
* feat(lsp)!: reimplement `textDocument/codeLens` as decoration providerYi Ming2026-02-03
|
* feat(lsp): support dynamic registration for diagnostics (#36841)Tristan Knight2025-12-06
|
* feat(lsp): support diagnostic refresh requestPig Fang2025-12-05
|
* fix(lsp): typos in method names #36077Igor Lacerda2025-10-07
|
* fix(lsp): format_item should return string (#36025)phanium2025-10-05
| | | | Problem: format_item return two value Solution: `:h vim.ui.select()` say format_item should return string
* fix(lsp): deprecate `vim.lsp.protocol.Methods` (#35998)Maria Solano2025-10-04
|
* fix(lsp): use `vim.notify` with action-less `showMessage` requests (#34720)Maria José Solano2025-07-01
|
* fix(lsp): use vim.notify for all message types #34489someoneinjd2025-06-16
| | | | | | Problem: Currently, vim.notify is only used to display messages when the message type is Error. Solution: Use vim.notify to display messages for all message types.
* fix: type fixesLewis Russell2025-06-06
| | | | Type fixes caught by emmylua
* refactor(docs): remove unnecessary `@private`/`@nodoc` annotations (#33951)Maria José Solano2025-05-10
| | | | | * refactor(docs): remove `@private` annotations from local functions * refactor(docs): remove unnecessary `@nodoc` annotations
* feat(lsp): support `documentColor` dynamic registration #33800Maria José Solano2025-05-04
|
* feat(lsp): add select kind in showMessageRequest #32387Maria José Solano2025-02-13
|
* feat(lsp)!: `symbol_to_item` requires `offset_encoding`Yi Ming2025-02-11
|
* fix: resolve all remaining LuaLS diagnosticsLewis Russell2025-01-27
|
* fix(lsp): prefer `on_list` over `loclist` in default handlerEvgeni Chasnovski2025-01-23
| | | | | | | | | | Problem: setting `loclist = true` makes `on_list` being ignored. This was not a problem before, but with `vim.lsp.buf.document_symbol` using `loclist = true` as default it is needed to explicitly pass `loclist = false` in order to use custom `on_list`. Solution: prefer `on_list` over `loclist` and document the latter as taking effect only in the default handler.
* fix(messages): lsp window/showMessage is not an errorLuuk van Baal2025-01-17
| | | | Ref https://github.com/neovim/neovim/discussions/32015
* refactor: use nvim.foo.bar format for namespacesMaria José Solano2025-01-14
|
* feat(api): deprecate nvim_out/err_write(ln)Luuk van Baal2025-01-09
|
* fix(lsp): retrigger diagnostics request on server cancellation (#31345)Gregory Anders2024-11-25
| | | Co-authored-by: Jesse <github@jessebakker.com>
* refactor(lsp): fold in dynamic_registration code into the clientLewis Russell2024-11-18
| | | | | | | | | | | Problem: Capability register logic is spread across 3 files. Solution: - Consolidate (and simplify) logic into the client. - Teach client.supports_method about resolve methods
* feat(lsp)!: remove client-server handlers from vim.lsp.handlersLewis Russell2024-11-01
| | | | | | | | | | - Partition the handlers in vim.lsp.handlers as: - client to server response handlers (RCS) - server to client request handlers (RSC) - server to client notification handlers (NSC) Note use string indexes instead of protocol.methods for improved typing in LuaLS (tip: use hover on RCS, RSC or NSC).
* feat(lsp)!: multiple client support for vim.lsp.buf.hover()Lewis Russell2024-10-29
| | | | Deprecate `vim.lsp.handlers.hover` and `vim.lsp.handlers['textDocument/hover']`
* feat(lsp): deprecate vim.lsp.buf.completionLewis Russell2024-10-24
| | | | Use `vim.lsp.completion.trigger()` instead'
* refactor: rename vim.highlight => vim.hlJustin M. Keyes2024-10-21
| | | | | | | | | | | | Problem: - `vim.highlight` module does not follow `:help dev-name-common`, which documents the name for "highlight" as "hl". - Shorter names are usually preferred. Solution: Rename `vim.highlight` to `vim.hl`. This is not a breaking change until 2.0 (or maybe never).
* feat(lsp)!: support multiple clients in goto methods (#30877)Mathias Fußenegger2024-10-20
| | | | | | | | | | | | | | | Relates to: - https://github.com/neovim/neovim/issues/30034 - https://github.com/neovim/neovim/issues/17712 - https://github.com/neovim/neovim/issues/16363 Closes: - https://github.com/neovim/neovim/issues/26936 (but only provides bufnr and method) - https://github.com/neovim/neovim/issues/22318 Might fix: https://github.com/neovim/neovim/issues/30737
* feat(lsp)!: support multiple clients in lsp.buf.referencesMathias Fussenegger2024-10-20
| | | | | | | Relates to: - https://github.com/neovim/neovim/issues/17712 - https://github.com/neovim/neovim/issues/30034
* fix(lsp): handle multiline signature help labels #30460Maria José Solano2024-10-15
|
* refactor(lua): improve type annotationsLewis Russell2024-06-11
|
* feat(lsp): completion side effectsMaria José Solano2024-05-27
|
* feat: remove deprecated featuresdundargoc2024-05-16
| | | | | | | | | | | | | | | | | | | Remove following functions: - vim.lsp.util.extract_completion_items - vim.lsp.util.get_progress_messages - vim.lsp.util.parse_snippet() - vim.lsp.util.text_document_completion_list_to_complete_items - LanguageTree:for_each_child - health#report_error - health#report_info - health#report_ok - health#report_start - health#report_warn - vim.health.report_error - vim.health.report_info - vim.health.report_ok - vim.health.report_start - vim.health.report_warn
* Merge #28637 more support for vim.lsp.ListOpts.loclistJustin M. Keyes2024-05-07
|\
| * feat(lsp): support vim.lsp.ListOpts.loclist in location_handler()tom-anders2024-05-07
| |
| * docs(lsp): document vim.lsp.ListOpts.loclisttom-anders2024-05-07
| |
| * refactor(lsp): use vim.cmd instead of api.nvim_commandtom-anders2024-05-07
| | | | | | | | | | | | As suggested in https://github.com/neovim/neovim/pull/28483#discussion_r1586878457 and https://github.com/neovim/neovim/pull/28483#discussion_r1586878226
| * docs(lsp): fix type annotations in response_to_list(...)tom-anders2024-05-07
| |
| * refactor(lsp): move repeated table construction into a variabletom-anders2024-05-07
| | | | | | | | As suggested in https://github.com/neovim/neovim/pull/28483#discussion_r1581712828
| * refactor(lsp): use vim.is_callable()tom-anders2024-05-07
| |