diff options
author | Mathias Fussenegger <f.mathias@zignar.net> | 2025-01-19 21:49:02 +0100 |
---|---|---|
committer | Mathias Fußenegger <mfussenegger@users.noreply.github.com> | 2025-01-19 22:11:20 +0100 |
commit | 5f527f24f0ea89e9071e065530cbed449507df5c (patch) | |
tree | 2639038c512f8ba40b7ab6fe7a51b499dd3fcc16 /test/functional/plugin | |
parent | d56ba71af11c9048c9085e4f66a47947770bdb29 (diff) | |
download | rneovim-5f527f24f0ea89e9071e065530cbed449507df5c.tar.gz rneovim-5f527f24f0ea89e9071e065530cbed449507df5c.tar.bz2 rneovim-5f527f24f0ea89e9071e065530cbed449507df5c.zip |
fix(lsp): don't use completion filterText if prefix is empty
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.
Diffstat (limited to 'test/functional/plugin')
-rw-r--r-- | test/functional/plugin/lsp/completion_spec.lua | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/test/functional/plugin/lsp/completion_spec.lua b/test/functional/plugin/lsp/completion_spec.lua index 84c8f5864a..4e90c2fd1b 100644 --- a/test/functional/plugin/lsp/completion_spec.lua +++ b/test/functional/plugin/lsp/completion_spec.lua @@ -239,13 +239,18 @@ describe('vim.lsp.completion: item conversion', function() }, }, } - local expected = { + assert_completion_matches('<mo', items, { { abbr = 'module', word = '<module', }, - } - assert_completion_matches('<mo', items, expected) + }) + assert_completion_matches('', items, { + { + abbr = 'module', + word = 'module', + }, + }) end) it('fuzzy matches on label when filterText is missing', function() |