commit 761fbc155a87d7c0af29b5ddea8d62f939f9b403
parent 6fe68abdf5a3cc5953b16751437b0a9545cfcfae
Author: Bartłomiej Maryńczak <marynczakbartlomiej@gmail.com>
Date: Wed, 18 Feb 2026 22:13:38 +0100
test(lsp): add entire-line completion word case (#37927)
Problem:
Multiword completion items used to be cut at a first word.
Solution:
Add a test that ensures this does not regress in the future
Diffstat:
1 file changed, 35 insertions(+), 0 deletions(-)
diff --git a/test/functional/plugin/lsp/completion_spec.lua b/test/functional/plugin/lsp/completion_spec.lua
@@ -503,6 +503,41 @@ describe('vim.lsp.completion: item conversion', function()
eq(expected, result)
end)
+ it('handles multiword testEdits', function()
+ local range0 = {
+ start = { line = 0, character = 0 },
+ ['end'] = { line = 0, character = 0 },
+ }
+ local items = {
+ {
+ detail = 'abc',
+ filterText = 'abc',
+ kind = 7,
+ label = 'abc',
+ sortText = 'abc',
+ textEdit = {
+ newText = 'abc: Abc',
+ range = range0,
+ },
+ },
+ }
+ local result = complete('|', items)
+ result = vim.tbl_map(function(x)
+ return {
+ abbr = x.abbr,
+ word = x.word,
+ }
+ end, result.items)
+
+ local expected = {
+ {
+ abbr = 'abc',
+ word = 'abc: Abc',
+ },
+ }
+ eq(expected, result)
+ end)
+
it('prefers wordlike components for snippets', function()
-- There are two goals here:
--