mirror of
https://github.com/neovim/neovim.git
synced 2026-05-24 05:40:08 +00:00
fix(lsp): preserve trigger chars on completion #39850
Problem:
After 767fbd8, typing trigger chars would open completion but the
chars were removed.
Solution:
Use filterText fallback so selected item respects typed trigger chars.
This commit is contained in:
@@ -457,10 +457,14 @@ describe('vim.lsp.completion: item conversion', function()
|
||||
|
||||
it('works on non word prefix', function()
|
||||
local completion_list = {
|
||||
{ label = ' foo', insertText = '->foo' },
|
||||
{ label = ' foo', insertText = '->foo', sortText = '1' },
|
||||
{ label = ' bar', insertText = '->bar', filterText = 'bar', sortText = '2' },
|
||||
}
|
||||
local result = complete('wp.|', completion_list, 0, 2)
|
||||
eq({ { abbr = ' foo', word = '->foo' } }, extract_word_abbr(result.items))
|
||||
eq({
|
||||
{ abbr = ' foo', word = '->foo' },
|
||||
{ abbr = ' bar', word = '->bar' },
|
||||
}, extract_word_abbr(result.items))
|
||||
end)
|
||||
|
||||
it('trims trailing newline or tab from textEdit', function()
|
||||
|
||||
Reference in New Issue
Block a user