Add the snippet indicator for items with Snippet kind (#677)
This commit is contained in:
@@ -240,13 +240,16 @@ entry.get_vim_item = function(self, suggest_offset)
|
|||||||
local abbr = str.oneline(completion_item.label)
|
local abbr = str.oneline(completion_item.label)
|
||||||
|
|
||||||
-- ~ indicator
|
-- ~ indicator
|
||||||
|
local is_snippet = false
|
||||||
if #(misc.safe(completion_item.additionalTextEdits) or {}) > 0 then
|
if #(misc.safe(completion_item.additionalTextEdits) or {}) > 0 then
|
||||||
abbr = abbr .. '~'
|
is_snippet = true
|
||||||
elseif completion_item.insertTextFormat == types.lsp.InsertTextFormat.Snippet then
|
elseif completion_item.insertTextFormat == types.lsp.InsertTextFormat.Snippet then
|
||||||
local insert_text = self:get_insert_text()
|
is_snippet = self:get_insert_text() ~= word
|
||||||
if word ~= insert_text then
|
elseif completion_item.kind == types.lsp.CompletionItemKind.Snippet then
|
||||||
abbr = abbr .. '~'
|
is_snippet = true
|
||||||
end
|
end
|
||||||
|
if is_snippet then
|
||||||
|
abbr = abbr .. '~'
|
||||||
end
|
end
|
||||||
|
|
||||||
-- append delta text
|
-- append delta text
|
||||||
|
|||||||
Reference in New Issue
Block a user