aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim/lsp
Commit message (Collapse)AuthorAge
* docs: miscdundargoc2025-01-30
| | | | | | | | | Co-authored-by: Dustin S. <dstackmasta27@gmail.com> Co-authored-by: Ferenc Fejes <fejes@inf.elte.hu> Co-authored-by: Maria José Solano <majosolano99@gmail.com> Co-authored-by: Yochem van Rosmalen <git@yochem.nl> Co-authored-by: brianhuster <phambinhanctb2004@gmail.com> Co-authored-by: zeertzjq <zeertzjq@outlook.com>
* 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: completion.enable(false,...) deletes invalid augroup #32121Konrad Malik2025-01-20
| | | | | | | | | | | | | | | | Problem: vim.lsp.completion.enable(true, client.id, bufnr) vim.lsp.completion.enable(false, client.id, bufnr) Error detected while processing LspDetach Autocommands for "*": Error executing lua callback: …/lsp/completion.lua:701: Vim:E367: No such group: "vim/lsp/completion-22" stack traceback: [C]: in function 'nvim_del_augroup_by_name' …/lsp/completion.lua:701: in function 'disable_completions' …/lsp/completion.lua:724: in function 'enable' Solution: Delete the correct augroup.
* fix(lsp): set floating window filetype after setup #32112Guilherme Soares2025-01-20
| | | | | | | | | Problem: The filetype for the floating window buffer is being set before its context is fully initialized. This results in `FileType` events not receiving the correct context. Solution: Set the filetype after the floating preview window and its buffer variables are fully configured to ensure proper context is provided.
* fix(lsp): don't use completion filterText if prefix is emptyMathias Fussenegger2025-01-19
| | | | | | | | Follow up to https://github.com/neovim/neovim/pull/32072 If there is no prefix (e.g. at the start of word boundary or a line), it always used the `filterText` because the `match` function always returned false.
* fix(lsp): document_symbol uses loclist by default #32070Yochem van Rosmalen2025-01-19
| | | | | | | | | | | Problem: Not able to open document symbols for different buffers Solution: Use the location list as default. To switch back to previous behavior (qflist): vim.lsp.buf.document_symbol({ loclist = false }) Fixes: #31832
* fix(lsp): use filterText as word if textEdit/label doesn't matchMathias Fussenegger2025-01-17
| | | | | | | | | | | | | | | | | | | | | | | | | Problem: With language servers like lemminx, completing xml tags like `<mo` first shows the right candidates (`modules`) but after typing `d` the candidates disappear. This is because the server returns: [...] filterText = "<module", label = "module", textEdit = { newText = "<module>$1</module>$0", Which resulted in `module` being used as `word`, and `module` doesn't match the prefix `<mo`. Typing `d` causes the `complete()` filtering mechanism to kick in and remove the entry. Solution: Use `<module` from the `filterText` as `word` if the textEdit/label heuristic doesn't match.
* 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 autocommand groupsMaria José Solano2025-01-14
|
* refactor: use nvim.foo.bar format for namespacesMaria José Solano2025-01-14
|
* fix(lsp): minimum height for floating popup #31990Xuyuan Pang2025-01-13
| | | | | | | | | Problem: The floating window for hover and signature help always cuts off a few lines, because the `_make_floating_popup_size` function counts empty lines as having zero height. Solution: Ensure the height is at least 1.
* docs: miscdundargoc2025-01-11
| | | | | | | | | | | | | | | Co-authored-by: Axel <axelhjq@gmail.com> Co-authored-by: Colin Kennedy <colinvfx@gmail.com> Co-authored-by: Daiki Noda <sys9kdr@users.noreply.github.com> Co-authored-by: Evgeni Chasnovski <evgeni.chasnovski@gmail.com> Co-authored-by: Jean-Jacq du Plessis <1030058+jj-du-plessis@users.noreply.github.com> Co-authored-by: Juan Giordana <juangiordana@gmail.com> Co-authored-by: Lincoln Wallace <locnnil0@gmail.com> Co-authored-by: Matti Hellström <hellstrom@scm.com> Co-authored-by: Steven Locorotondo <steven.locorotondo@justeattakeaway.com> Co-authored-by: Yochem van Rosmalen <git@yochem.nl> Co-authored-by: glepnir <glephunter@gmail.com> Co-authored-by: ifish <fishioon@live.com>
* docs: misc #31867Justin M. Keyes2025-01-09
|
* Merge #31900 from luukvbaal/nvim_echoJustin M. Keyes2025-01-09
|\
| * feat(api): deprecate nvim_out/err_write(ln)Luuk van Baal2025-01-09
| |
* | feat(health): show :checkhealth in floating window #31086glepnir2025-01-07
|/ | | | Problem: health can not shown in a floating window Solution: add g:health variable
* fix(lsp): open_floating_preview() zindex relative to current window #31886luukvbaal2025-01-06
| | | | | Problem: open_floating_preview() may be hidden behind current window if that is floating and has a higher zindex. Solution: Open floating preview with zindex higher than current window.
* fix(lsp): ensure watcher cancelJaehwang Jung2025-01-02
| | | | | | | * Cancel watcher in the "force" case. * Cancel watcher outside the async callback. It seems nvim doesn't wait async jobs on quitting, leaving detached inotifywait processes. * Clean up cancelling callbacks.
* feat(lsp): return resolved config for vim.lsp.config[name]Mathias Fussenegger2024-12-31
| | | | | | | | | | Allows to retrieve the configuration as it will be used by `lsp.enable` - including the parts merged from `*` and rtp. This is useful for explicit startup control (`vim.lsp.start(vim.lsp.config[name])`) Closes https://github.com/neovim/neovim/issues/31640
* fix(lsp): check if sig_help window is focusable when configuring cycle keymapMaria José Solano2024-12-29
|
* feat(lsp): show server version in `:checkhealth` #31611Peter Lithammer2024-12-18
| | | | | | | | Problem: Language server version information missing from `:checkhealth vim.lsp`. Solution: Store `InitializeResult.serverInfo.version` from the `initialize` response and display for each client in `:checkhealth vim.lsp`.
* refactor(lsp/rpc): move transport logic to separate moduleLewis Russell2024-12-12
|
* feat(lsp): add vim.lsp.config and vim.lsp.enableLewis Russell2024-12-10
| | | | | | | | | | | | | | | | | | | | Design goals/requirements: - Default configuration of a server can be distributed across multiple sources. - And via RTP discovery. - Default configuration can be specified for all servers. - Configuration _can_ be project specific. Solution: - Two new API's: - `vim.lsp.config(name, cfg)`: - Used to define default configurations for servers of name. - Can be used like a table or called as a function. - Use `vim.lsp.confg('*', cfg)` to specify default config for all servers. - `vim.lsp.enable(name)` - Used to enable servers of name. Uses configuration defined via `vim.lsp.config()`.
* refactor(lsp): better tracking of requestsLewis Russell2024-12-08
| | | | | Not essential, but adds robustness and hardening for future changes.
* refactor: add vim._resolve_bufnrLewis Russell2024-12-07
|
* fix(lsp): cancel pending requests before refreshingtris2032024-12-07
| | | | | | | | | | | Problem: Diagnostics and inlay hints can be expensive to calculate, and we shouldn't stack them as this can cause noticeable lag. Solution: Check for duplicate inflight requests and cancel them before issuing a new one. This ensures that only the latest request is processed, improving performance and preventing potential conflicts.
* fix(lsp): check for configuration workspace folders when reusing clientsMaria José Solano2024-12-07
|
* fix(lsp): add foldingrange method support check #31463Tristan Knight2024-12-06
| | | | | | Problem: The folding_range request method assumes that the client supports the method Solution: Add a capability guard to the call
* feat(lsp): deprecate vim.lsp.start_client #31341Maria José Solano2024-12-04
| | | | | | | | Problem: LSP module has multiple "start" interfaces. Solution: - Enhance vim.lsp.start - Deprecate vim.lsp.start_client
* feat(lsp): support `textDocument/foldingRange` (#31311)Yi Ming2024-11-29
| | | | | | | | | | | | | | | | | | | * 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
* docs(lsp): update example, optional parameters #31299Yi Ming2024-11-28
|
* docs: more accurate typing for LSP references contextRiley Bruins2024-11-28
| | | | | | | **Problem:** The `context` parameter for `references()` is just typed as a table, which is unhelpful. **Solution:** Properly type it as an `lsp.ReferenceContext`!
* fix(lsp): mention function name in warning #31301glepnir2024-11-27
| | | | | | Problem: The warning message is the same in different functions. It is not convenient to locate the specific function name Solution: add function name in warning message
* fix(lsp): retrigger diagnostics request on server cancellation (#31345)Gregory Anders2024-11-25
| | | Co-authored-by: Jesse <github@jessebakker.com>
* refactor(lsp): rename `offset_encoding` to `position_encoding` #31286Yi Ming2024-11-25
| | | | | | | | Problem: LSP spec uses the term "position encoding" where we say "offset encoding". Solution: - Rename it everywhere except `vim.lsp.Client.offset_encoding` (which would be breaking). - Mention "position encoding" in the documentation for `vim.lsp.Client.offset_encoding`.
* fix(lsp): delete bufvar inside WinClosed eventglepnir2024-11-24
| | | | | | | | Problem: floaing preview window can be closed by some ex commands like `only` `fclose` which will not clean the bufvar Solution: use WinClosed event with floating_winnr for clean bufnr, and add test cases for vim.lsp.util.open_floating_preview
* fix(lsp): delete b:lsp_floating_preview buf var after win closeglepnir2024-11-22
| | | | | | Problem: After floating preview window closed the buf var still exist Solution: delete after floating window closed.
* feat(lsp): require `offset_encoding` param #31249Yi Ming2024-11-20
| | | | | | | | | | | | | | | | | | | | | | | | Problem: Since [version 3.17](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocuments), LSP supports specifying the position encoding (aka offset encoding) supported by the client through `positionEncoding`. Since #31209, Nvim fully supports `utf-8`, `utf-16`, and `utf-32` encodings. Previously, nvim assumed all clients for a buffer had the same `offset_encoding`, so: * Nvim provides `vim.lsp._get_offset_encoding()` to get `offset_encoding`, but this function is incorrect because `offset_encoding` is per-client, not per-buffer. * Based on the strategy of `vim.lsp._get_offset_encoding()`, `vim.lsp.util.make_position_params()`, `vim.lsp.util.make_range_params()`, and `vim.lsp.util.make_given_range_params()` do not require the caller to pass `offset_encoding`, which is invalid. * https://github.com/neovim/neovim/issues/25272 Solution: * Mark `vim.lsp._get_offset_encoding()` as `@deprecated`. * Change the type annotations of `vim.lsp.util.make_position_params()`, `vim.lsp.util.make_range_params()`, `vim.lsp.util.make_given_range_params()` to require the `offset_encoding` param.
* feat(lsp): deprecate non-method client functionsLewis Russell2024-11-20
| | | | | | | | | | | | | | Deprecated: - `client.request()` -> `client:request()` - `client.request_sync()` -> `client:request_sync()` - `client.notify()` -> `client:notify()` - `client.cancel_request()` -> `client:cancel_request()` - `client.stop()` -> `client:stop()` - `client.is_stopped()` `client:is_stopped()` - `client.supports_method()` -> `client:supports_method()` - `client.on_attach()` -> `client:on_attach()` Fixed docgen to link class fields to the full function doc.
* fix(lsp): restore get_language_id behaviourLewis Russell2024-11-19
| | | | | | Ensure filetype is always passed. Fixes #31262
* 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
* fix(api): only flush nvim__redraw when necessary #31250luukvbaal2024-11-18
| | | | | | | | Problem: Not possible to only set a "redraw later" type with nvim__redraw, which seems to be desired for the treesitter highlighter. Solution: Do not update the screen when "flush" is explicitly set to false and only redraw later types are present. In that case, do not call ui_flush() either.
* feat(lsp): highlight hover target/range #31110Riley Bruins2024-11-17
| | | | | | | | | | **Problem:** Despite the LSP providing the option for language servers to specify a range with a hover response (for highlighting), Neovim does not give the option to highlight this range. **Solution:** Add an option to `buf.hover()` which causes this range to be highlighted. Co-authored-by: Mathias Fußenegger <mfussenegger@users.noreply.github.com>
* fix(lsp): type-errors, other nits in vim.lsp.log #31235Maria José Solano2024-11-16
|
* feat(lsp): support utf-8 and utf-32 position encodingsLewis Russell2024-11-14
| | | | Resolves #30034
* fix(lsp): filter completion candidates based on completeopt (#30945)Kristijan Husak2024-11-13
|
* refactor(lsp): avoid redundant function wrappingNicolas Hillegeer2024-11-12
| | | | Leftover from #21026.
* perf(lsp): use faster version of str_byteindexLewis Russell2024-11-11
|
* refactor(lsp): simplify reference range logicRiley Bruins2024-11-10
|