summaryrefslogtreecommitdiffstatshomepage
path: root/runtime/lua/vim/lsp/handlers.lua
AgeCommit message (Collapse)AuthorFiles
2026-04-23fix(lsp): callHierarchy/outgoingCalls ranges are relative to caller, not ↵Ashley Hauck1
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)
2026-03-20fix(lsp): guard dynamic capability attachment #38382Tristan Knight1
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
2026-03-18feat(lsp): migrate `document_color` to capability framework (#38344)Maria Solano1
* feat(lsp): migrate `document_color` to capability framework * feat(lsp): use `vim.Range` in `document_color` module
2026-02-15fix(lsp): support workspace/configuation with no section #27510Tim Pope1
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.
2026-02-03feat(lsp): support `workspace/codeLens/refresh`Yi Ming1
2026-02-03feat(lsp)!: reimplement `textDocument/codeLens` as decoration providerYi Ming1
2025-12-06feat(lsp): support dynamic registration for diagnostics (#36841)Tristan Knight1
2025-12-05feat(lsp): support diagnostic refresh requestPig Fang1
2025-10-07fix(lsp): typos in method names #36077Igor Lacerda1
2025-10-05fix(lsp): format_item should return string (#36025)phanium1
Problem: format_item return two value Solution: `:h vim.ui.select()` say format_item should return string
2025-10-04fix(lsp): deprecate `vim.lsp.protocol.Methods` (#35998)Maria Solano1
2025-07-01fix(lsp): use `vim.notify` with action-less `showMessage` requests (#34720)Maria José Solano1
2025-06-16fix(lsp): use vim.notify for all message types #34489someoneinjd1
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.
2025-06-06fix: type fixesLewis Russell1
Type fixes caught by emmylua
2025-05-10refactor(docs): remove unnecessary `@private`/`@nodoc` annotations (#33951)Maria José Solano1
* refactor(docs): remove `@private` annotations from local functions * refactor(docs): remove unnecessary `@nodoc` annotations
2025-05-04feat(lsp): support `documentColor` dynamic registration #33800Maria José Solano1
2025-02-13feat(lsp): add select kind in showMessageRequest #32387Maria José Solano1
2025-02-11feat(lsp)!: `symbol_to_item` requires `offset_encoding`Yi Ming1
2025-01-27fix: resolve all remaining LuaLS diagnosticsLewis Russell1
2025-01-23fix(lsp): prefer `on_list` over `loclist` in default handlerEvgeni Chasnovski1
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.
2025-01-17fix(messages): lsp window/showMessage is not an errorLuuk van Baal1
Ref https://github.com/neovim/neovim/discussions/32015
2025-01-14refactor: use nvim.foo.bar format for namespacesMaria José Solano1
2025-01-09feat(api): deprecate nvim_out/err_write(ln)Luuk van Baal1
2024-11-25fix(lsp): retrigger diagnostics request on server cancellation (#31345)Gregory Anders1
Co-authored-by: Jesse <github@jessebakker.com>
2024-11-18refactor(lsp): fold in dynamic_registration code into the clientLewis Russell1
Problem: Capability register logic is spread across 3 files. Solution: - Consolidate (and simplify) logic into the client. - Teach client.supports_method about resolve methods
2024-11-01feat(lsp)!: remove client-server handlers from vim.lsp.handlersLewis Russell1
- 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).
2024-10-29feat(lsp)!: multiple client support for vim.lsp.buf.hover()Lewis Russell1
Deprecate `vim.lsp.handlers.hover` and `vim.lsp.handlers['textDocument/hover']`
2024-10-24feat(lsp): deprecate vim.lsp.buf.completionLewis Russell1
Use `vim.lsp.completion.trigger()` instead'
2024-10-21refactor: rename vim.highlight => vim.hlJustin M. Keyes1
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).
2024-10-20feat(lsp)!: support multiple clients in goto methods (#30877)Mathias Fußenegger1
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
2024-10-20feat(lsp)!: support multiple clients in lsp.buf.referencesMathias Fussenegger1
Relates to: - https://github.com/neovim/neovim/issues/17712 - https://github.com/neovim/neovim/issues/30034
2024-10-15fix(lsp): handle multiline signature help labels #30460Maria José Solano1
2024-06-11refactor(lua): improve type annotationsLewis Russell1
2024-05-27feat(lsp): completion side effectsMaria José Solano1
2024-05-16feat: remove deprecated featuresdundargoc1
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
2024-05-07Merge #28637 more support for vim.lsp.ListOpts.loclistJustin M. Keyes1
2024-05-07feat(lsp): support vim.lsp.ListOpts.loclist in location_handler()tom-anders1
2024-05-07docs(lsp): document vim.lsp.ListOpts.loclisttom-anders1
2024-05-07refactor(lsp): use vim.cmd instead of api.nvim_commandtom-anders1
As suggested in https://github.com/neovim/neovim/pull/28483#discussion_r1586878457 and https://github.com/neovim/neovim/pull/28483#discussion_r1586878226
2024-05-07docs(lsp): fix type annotations in response_to_list(...)tom-anders1
2024-05-07refactor(lsp): move repeated table construction into a variabletom-anders1
As suggested in https://github.com/neovim/neovim/pull/28483#discussion_r1581712828
2024-05-07fix(lsp): rename LspProgress data.result => data.params #28632Jongwook Choi1
Rename the field `result` to `params` in the `data` table for `LspProgress` autocmds. This aligns with LspNotify. The previous name was chosen because the initial handler implementation mistakenly had a parameter name `result` instead of `params` for the `$/progress` LSP "notification" handler. However, `params` would be a more appropriate name that is more consistent with the underlying LSP type (`ProgressParams`). See also: https://microsoft.github.io/language-server-protocol/specifications/specification-current/#progress
2024-05-07refactor(lsp): use vim.is_callable()tom-anders1
2024-05-03fix(vim.ui)!: change open() to return `result|nil, errmsg|nil` #28612Justin M. Keyes1
reverts e0d92b9cc20b58179599f53dfa74ca821935a539 #28502 Problem: `vim.ui.open()` has a `pcall()` like signature, under the assumption that this is the Lua idiom for returning result-or-error. However, the `result|nil, errmsg|nil` pattern: - has precedent in: - `io.open` - `vim.uv` (`:help luv-error-handling`) - has these advantages: - Can be used with `assert()`: ``` local result, err = assert(foobar()) ``` - Allows LuaLS to infer the type of `result`: ``` local result, err = foobar() if err then ... elseif result then ... end ``` Solution: - Revert to the `result|nil, errmsg|nil` pattern. - Document the pattern in our guidelines.
2024-04-25fix(vim.ui)!: change open() to return pcall-like values #28502Justin M. Keyes1
Problem: `vim.ui.open` unnecessarily invents a different success/failure convention. Its return type was changed in 57adf8c6e01d, so we might as well change it to have a more conventional form. Solution: Change the signature to use the `pcall` convention of `status, result`.
2024-04-22refactor(lua): deprecate tbl_flattenJustin M. Keyes1
Problem: Besides being redundant with vim.iter():flatten(), `tbl_flatten` has these problems: - Has `tbl_` prefix but only accepts lists. - Discards some results! Compare the following: - iter.flatten(): ``` vim.iter({1, { { a = 2 } }, { 3 } }):flatten():totable() ``` - tbl_flatten: ``` vim.tbl_flatten({1, { { a = 2 } }, { 3 } }) ``` Solution: Deprecate tbl_flatten. Note: iter:flatten() currently fails ("flatten() requires a list-like table") on this code from gen_lsp.lua: local anonym = vim.iter({ -- remove nil anonymous_num > 1 and '' or nil, '---@class ' .. anonymous_classname, }):flatten():totable() Should we enhance :flatten() to work for arrays?
2024-04-21refactor(lua): rename tbl_islist => islistJustin M. Keyes1
ref #24572
2024-04-20feat(lsp): add vim.lsp.buf.subtypes(), vim.lsp.buf.supertypes() (#28388)Yinzuo Jiang1
Co-authored-by: Mathias Fußenegger <mfussenegger@users.noreply.github.com> Co-authored-by: Maria José Solano <majosolano99@gmail.com>
2024-04-15fix(vim.ui): open() may wait indefinitely #28325Justin M. Keyes1
Problem: vim.ui.open "locks up" Nvim if the spawned process does not terminate. #27986 Solution: - Change `vim.ui.open()`: - Do not call `wait()`. - Return a `SystemObj`. The caller can decide if it wants to `wait()`. - Change `gx` to `wait()` only a short time. - Allows `gx` to show a message if the command fails, without the risk of waiting forever.
2024-03-06refactor(types): more fixes (2)Lewis Russell1