aboutsummaryrefslogtreecommitdiff
path: root/test/functional/plugin/lsp/completion_spec.lua
Commit message (Collapse)AuthorAge
* 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.
* fix(lsp): reuse client if configs match and no root dirLewis Russell2024-12-13
| | | | | | | | | | | | Problem: An LSP configuration that creates client with no root_dir or workspace_folders can result in vim.lsp.enable attaching to it multiple times. Solution: When checking existing clients, reuse a client if it wasn't initially configured have any workspace_folders. This more closely matches the behaviour we had prior to d9235ef
* fix(lsp): filter completion candidates based on completeopt (#30945)Kristijan Husak2024-11-13
|
* 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>
* test: support upvalues in exec_luaLewis Russell2024-09-21
|
* 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.
* 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.
* 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): 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 `^@`.
* 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)
* test(lsp): add completion testsMaria José Solano2024-05-27
|
* feat(lsp): completion side effectsMaria José Solano2024-05-27
|
* test: improve test conventionsdundargoc2024-04-23
| | | | | | | | | Specifically, functions that are run in the context of the test runner are put in module `test/testutil.lua` while the functions that are run in the context of the test session are put in `test/functional/testnvim.lua`. Closes https://github.com/neovim/neovim/issues/27004.
* refactor(test): inject after_each differentlyLewis Russell2024-04-10
|
* test: improve test conventionsdundargoc2024-04-08
| | | | Work on https://github.com/neovim/neovim/issues/27004.
* feat(lsp): support completion itemDefaultsMaria José Solano2024-02-27
|
* refactor: format test/*Justin M. Keyes2024-01-03
|
* fix(lsp): fix omnicomplete in middle of the line (#25787)Lajos Koszti2023-10-26
| | | | | | | | Fixes a regression from 5e5f5174e3faa862a9bc353aa7da41487911140b Until that commit we had a logic like this: `local prefix = startbyte and line:sub(startbyte + 1) or line_to_cursor:sub(word_boundary)` The commit changed the logic and no longer cut off the line at the cursor, resulting in a prefix that included trailing characters
* fix(lsp): fix off-by-one error for omnifunc word boundaryMathias Fussenegger2023-10-23
Fixes https://github.com/neovim/neovim/issues/25177 I initially wanted to split this into a refactor commit to make it more testable, but it appears that already accidentally fixed the issue by normalizing lnum/col to 0-indexing