Add the snippet indicator for items with Snippet kind (#677)

This commit is contained in:
Dmytro Meleshko
2021-12-28 20:17:22 +02:00
committed by GitHub
parent ae708ef3a4
commit b9edce7214

View File

@@ -240,13 +240,16 @@ entry.get_vim_item = function(self, suggest_offset)
local abbr = str.oneline(completion_item.label)
-- ~ indicator
local is_snippet = false
if #(misc.safe(completion_item.additionalTextEdits) or {}) > 0 then
abbr = abbr .. '~'
is_snippet = true
elseif completion_item.insertTextFormat == types.lsp.InsertTextFormat.Snippet then
local insert_text = self:get_insert_text()
if word ~= insert_text then
abbr = abbr .. '~'
is_snippet = self:get_insert_text() ~= word
elseif completion_item.kind == types.lsp.CompletionItemKind.Snippet then
is_snippet = true
end
if is_snippet then
abbr = abbr .. '~'
end
-- append delta text