ADD: formatting.expandable_indicator to show the expandable indicator (#1207)
* ADD: formatting.expandable_indicator to show the `expandable` indicator * UPDATA: doc/cmp.txt lua/cmp/entry.lua lua/cmp/typed/cmp.lua
This commit is contained in:
@@ -236,16 +236,17 @@ entry.get_vim_item = function(self, suggest_offset)
|
||||
local abbr = str.oneline(completion_item.label)
|
||||
|
||||
-- ~ indicator
|
||||
local is_snippet = false
|
||||
local is_expandable = false
|
||||
local expandable_indicator = config.get().formatting.expandable_indicator
|
||||
if #(misc.safe(completion_item.additionalTextEdits) or {}) > 0 then
|
||||
is_snippet = true
|
||||
is_expandable = true
|
||||
elseif completion_item.insertTextFormat == types.lsp.InsertTextFormat.Snippet then
|
||||
is_snippet = self:get_insert_text() ~= word
|
||||
is_expandable = self:get_insert_text() ~= word
|
||||
elseif completion_item.kind == types.lsp.CompletionItemKind.Snippet then
|
||||
is_snippet = true
|
||||
is_expandable = true
|
||||
end
|
||||
if is_snippet then
|
||||
abbr = abbr .. '~'
|
||||
if expandable_indicator and is_expandable then
|
||||
abbr = abbr .. '~'
|
||||
end
|
||||
|
||||
-- append delta text
|
||||
|
||||
Reference in New Issue
Block a user