aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim/lsp/completion.lua
Commit message (Collapse)AuthorAge
* fix: resolve all remaining LuaLS diagnosticsLewis Russell2025-01-27
|
* 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): 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): 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.
* refactor: use nvim.foo.bar format for autocommand groupsMaria José Solano2025-01-14
|
* refactor: add vim._resolve_bufnrLewis Russell2024-12-07
|
* 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`.
* 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): filter completion candidates based on completeopt (#30945)Kristijan Husak2024-11-13
|
* refactor(lsp): drop str_byteindex/str_utfindex wrappers #30915Tristan Knight2024-10-26
| | | | | * deprecate old signatures * move to new str_byteindex/str_utfindex signature * use single-underscore name (double-underscore is reserved for Lua itself)
* feat(lsp): deprecate execute_command with client:exec_cmdLewis Russell2024-10-24
|
* docs: update autotrigger description of vim.lsp.compleiton.BufferOpts (#30796)glepnir2024-10-13
| | | Currently the behavior of autotrigger is not well documented.
* fix(lsp): fix cursor position after snippet expansion (#30659)Tomasz N2024-10-10
| | | | | | | | | | | | Problem: on `CompleteDone` cursor can jump to the end of line instead of the end of the completed word. Solution: remove only inserted word for snippet expansion instead of everything until eol. Fixes #30656 Co-authored-by: Mathias Fussenegger <f.mathias@zignar.net> Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
* vim-patch:9.1.0771: completion attribute hl_group is confusingzeertzjq2024-10-10
| | | | | | | | | | | | | Problem: Currently completion attribute hl_group is combined with all items, which is redundant and confusing with kind_hlgroup Solution: Renamed to abbr_hlgroup and combine it only with the abbr item (glepnir). closes: vim/vim#15818 https://github.com/vim/vim/commit/0fe17f8ffbd2588ecd2bf42dced556897bc64f89 Co-authored-by: glepnir <glephunter@gmail.com>
* docs: misc #28970Justin M. Keyes2024-09-01
|
* fix(lsp): when prefix is non word add all result into matches (#30044)glepnir2024-08-30
| | | | | | | Problem: prefix can be a symbol like period, the fuzzy matching can't handle it correctly. Solution: when prefix is empty or a symbol add all lsp completion result into matches.
* fix(lsp): fix isIncomplete condition in completion trigger (#30130)Mathias Fußenegger2024-08-26
| | | Follow up to https://github.com/neovim/neovim/pull/30028#discussion_r1726539370
* feat(lsp): completion opts support custom item conversion (#30060)glepnir2024-08-22
| | | | | | | Problem: Some items of completion results include function signatures that can cause the pum to be very long when a function has many params, because pum scales with the longest word/abbr. Solution: add custom covert function that can customise abbr to remove params.
* fix(lsp): suppress completion request if completion is active (#30028)glepnir2024-08-22
| | | | | | | Problem: the autotrigger mechanism could fire completion requests despite completion already being active from another completion mechanism or manual trigger Solution: add a condition to avoid an additional request.
* feat(lsp): lsp.completion support set deprecated (#29882)glepnir2024-07-31
| | | | | | Problem: CompletionItem in lsp spec mentioned the deprecated attribute Solution: when item has deprecated attribute set hl_group to DiagnosticDeprecated in complete function
* fix(lsp): fallback to `label` for completion items if all others are missing ↵Sebastian Lyng Johansen2024-07-02
| | | | (#29522)
* fix(lsp): pre-filter matches on label if filterText is missing (#29491)Mathias Fußenegger2024-06-27
| | | | | | | | | | | Although the built-in pum completion mechanism will filter anyway on the next input it is odd if the initial popup shows entries which don't match the current prefix. Using fuzzy match on the label/prefix is compatible with `completeopt+=fuzzy` and also doesn't seem to break postfix snippet cases Closes https://github.com/neovim/neovim/issues/29287
* fix(lsp): tune completion word extraction for decorated labels (#29331)Mathias Fußenegger2024-06-14
| | | | | | | | | | | | | | Problem: For snippets lsp.completion prefers the label if it is shorter than the insertText or textEdit to support postfix completion cases but clangd adds decoration characters to labels. E.g.: `•INT16_C(c)` Solution: Use parse_snippet on insertText/textEdit before checking if it is shorter than the label. Fixes https://github.com/neovim/neovim/issues/29301
* refactor(lua): use tuple syntax everywhere #29111Ilia Choly2024-06-04
|
* fix(lsp): use client.id instead of pairs index (#29143)ippachi2024-06-03
| | | | | | | Problem: Completion side effects not working randomly. Solution: When creating the table of LSP responses, the table index was used, but this is not the same as the actual client_id, so it was changed to use the client_id directly.
* fix(lsp): trim trailing whitespace from completion words (#29122)Mathias Fußenegger2024-06-02
| | | | | the `complete()` mechanism doesn't play nicely with trailing newlines or tabs. A newline causes it to insert a null character, showing up as `^@`.
* perf(lsp): avoid repeated table lookup in completion.enableMathias Fussenegger2024-06-01
|
* refactor(lsp): share completion request logic between omnifunc & triggerMathias Fussenegger2024-06-01
|
* perf(lsp): don't copy completion items in filter passMathias Fussenegger2024-06-01
|
* feat(lsp): support postfix snippets in completionMathias Fussenegger2024-05-30
|
* feat(lsp): use fuzzy match on filterText instead of prefix matchMathias Fussenegger2024-05-30
| | | | | | | | The `complete()` mechanism matches completion candidates against the typed text, so strict pre-filtering isn't necessary. This is a first step towards supporting postfix snippets (like `items@insert` in luals)
* feat(lsp): completion side effectsMaria José Solano2024-05-27