aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim/lsp
Commit message (Collapse)AuthorAge
* fix(lsp): handle non-existent configs in lsp.config/enableLewis Russell2025-03-12
|
* refactor(lsp): rename `on_publish_diagnostics` parameter #32776Will Lillis2025-03-11
| | | | * fix(lsp): rename `on_publish_diagnostics` parameter: result->params * fix(colors): specify local var type to address lint failure
* fix(lsp): improve LSP floating preview window cleanup #31353glepnir2025-03-11
| | | | | Problem: The current implementation creates a unique autocommand group for each floating preview window, which is inefficient and can lead to numerous autocommand groups. Solution: Use a single shared autocommand group with improved window validation to properly clean up LSP floating preview windows.
* fix(lsp): wrapped ctx in opts before passed to vim.lsp.completion.trigger #32837glepnir2025-03-11
| | | | | Problem: ctx is passed directly to M.trigger. In fact, it is a field of opts. Solution: wrapped in a table and passed to M.trigger.
* feat(lsp): support completion context #32793Maria José Solano2025-03-10
| | | | | | | | | 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.
* fix(lsp): use unresolved code action when `codeAction/resolve` failsMaria José Solano2025-03-07
|
* feat(lsp): support for resolving code action command (#32704)Maria José Solano2025-03-06
| | | | | * fix(lsp): don't call codeAction_resolve with commands * feat(lsp): support for resolving code action command
* fix(lsp): open_floating_preview() ignores max_height (#32716)Robert Muir2025-03-04
| | | | | | | Problem: After 47aaddfa the max_height option is no longer respected. Hover documentation and Signature help windows take up the entire text height. Solution: Compare to window's current height and only modify the height if it would reduce the height, not enlarge it.
* docs: misc #31996Justin M. Keyes2025-03-02
|
* doc: clarify window-id, tab-id, nvim_set_current_x #32528David Briscoe2025-02-27
| | | | | | | | | | | | | | Problem: Descriptions are somewhat vague. nvim_set_current_line modifies contents but nvim_set_current_buf does not, etc. Solution: - Make it clear that these functions accept or return a winid/tabid by linking to that concept in help. - Only these few files use the term "handles", so replace them with the more conventional terminology. - Add a new help section for tab-ID. This concept is unique to neovim because vim exposes tabnr, but not tab handles. This section is modelled after `:h winid`.
* fix(lsp): resize hover window for concealed linesLuuk van Baal2025-02-25
| | | | | | | | Problem: Height of a (markdown) `vim.lsp.util.open_floating_preview()` window can be reduced to account for concealed lines (after #31324). Solution: Set the window height to the text height of the preview window. Set 'concealcursor' to avoid unconcealing the cursorline when entering the hover window.
* fix(lsp): reset the applied hints on `refresh` request #32446Yi Ming2025-02-23
|
* Merge #32503 feat(lsp): use the meta model to generate server capability mapJustin M. Keyes2025-02-23
|\
| * feat(lsp): use the meta model to generate server capability mapMaria José Solano2025-02-21
| |
| * feat(lsp): update LSP typesMaria José Solano2025-02-17
| |
* | fix(float): ensure floating window width can fit titleMaria José Solano2025-02-23
| |
* | fix(lsp): unify get_completion_word for textEdits/insertTextMathias Fussenegger2025-02-22
|/ | | | | | | | | | | | | | Problem: After https://github.com/neovim/neovim/pull/32377 selecting snippets provided by luals inserted the multi-line text before accepting the candidates. That's inconsistent with servers who provide `textEdit` instead of `insertText` and having lines shift up/down while cycling through the completion candidates is a bit irritating. Solution: Use the logic used for `textEdit` snippets also for `insertText`
* fix(docs): update context type in `vim.lsp.LocationOpts.OnList`Maria José Solano2025-02-16
|
* feat(lsp): add support for completionItem.command resolvingMathias Fussenegger2025-02-14
| | | | | | | | `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
* feat(lsp): add select kind in showMessageRequest #32387Maria José Solano2025-02-13
|
* Merge #32426 fix(lsp): reset active request when reporting an errorJustin M. Keyes2025-02-13
|\
| * refactor(lsp): handling errors and nil responses togetherYi Ming2025-02-13
| |
| * fix(lsp): reset active request when reporting an errorYi Ming2025-02-13
| |
| * fix(lsp): missing method parameter when canceling requestsYi Ming2025-02-13
| |
* | fix(lsp): clear word when expand multi-lines word (#32393)glepnir2025-02-13
| | | | | | | | | | Problem: When expanding a completion item that contains a multi-line word, the word is not deleted correctly. Solution: If the word contains a line break, delete the text from Context.cursor to the current cursor position.
* | fix(lsp): autotrigger should only trigger on client's triggerCharacters (#32266)Robert Muir2025-02-13
|/ | | | | | | | | | | | Problem: autotrigger option of vim.lsp.completion.enable() would trigger all clients, as long as it matched at least one client's triggerCharacters. Solution: trigger only the clients with triggerCharacters matching the character. overtriggering still happens if any client returns isIncomplete=true (this case is more involved). Co-authored-by: Mathias Fussenegger <f.mathias@zignar.net>
* fix(lsp): on detach, cancel pending foldingRange requests #31509Yi Ming2025-02-12
| | | | | | | | | | | | | | | | | | | Problem: 1. Open a relatively large file (so the server needs some time to process the request). 2. Then immediately execute `:bdelete`. 3. Once the request is completed, the handler will obtain the bufstate of a buffer already unloaded. Error executing vim.schedule lua callback: ...7841_1/share/nvim/runtime/lua/vim/lsp/_folding_range.lua:119: assertion failed! stack traceback: [C]: in function 'assert' ...7841_1/share/nvim/runtime/lua/vim/lsp/_folding_range.lua:119: in function 'multi_handler' ...7841_1/share/nvim/runtime/lua/vim/lsp/_folding_range.lua:140: in function 'handler' ...HEAD-c137841_1/share/nvim/runtime/lua/vim/lsp/client.lua:669: in function '' vim/_editor.lua: in function <vim/_editor.lua:0> Solution: On detach, cancel all pending textDocument_foldingRange requests.
* feat(lsp)!: `symbol_to_item` requires `offset_encoding`Yi Ming2025-02-11
|
* feat(lsp): include `end_col` and `end_lnum` in `vim.lsp.buf.symbols_to_items`Yi Ming2025-02-11
|
* fix(lsp): signature_help highlights wrong parameter #32382Shantanu Raj2025-02-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: With some LSP servers, `vim.lsp.buf.signature_help` (CTRL-s in insert-mode) highlights the first parameter regardless of the current cursor position. - On some lsps the `textDocument/signatureHelp` response only includes the `activeParameter` field on the `lsp.SignatureHelp` object. ```lua { { result = { activeParameter = 2, signatures = { { documentation = { kind = "markdown", value = "" }, label = "getBuyers(ctx context.Context, orderDB boil.ContextExecutor, supplierID string) ([]*BuyerWithLocation, error)", parameters = { { label = "ctx context.Context" }, { label = "orderDB boil.ContextExecutor" }, { label = "supplierID string" } } } } } } } ``` Solution: Ensure we retain this information before showing the signature information. Closes #32381
* fix(lsp): check for valid buf before processing semantic tokens responseEvgeni Chasnovski2025-02-07
| | | | | | | | | | | | | | Problem: There is no check for buffer validity before processing semantic tokens response. This can lead to `Invalid buffer id` error if processing request takes a long time and the buffer is wiped out. For example, this can happen after by accident navigating to a buffer from different project which leads to first loading project's workspace and *then* processing semantic tokens. During that time a buffer can be wiped out, as navigation to it was by accident. Solution: Add extra check for buffer validity before processing semantic tokens response.
* 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.