Support chained completion

This commit is contained in:
hrsh7th 2021-08-09 14:40:59 +09:00
parent ad85ac623d
commit b5e157c8ae

View File

@ -107,7 +107,9 @@ source._candidates = function(_, context, dirname, offset, callback)
if accept then if accept then
if type == 'directory' then if type == 'directory' then
table.insert(items, { table.insert(items, {
word = '/' .. name,
label = '/' .. name, label = '/' .. name,
insertText = '/' .. name .. '/',
kind = cmp.lsp.CompletionItemKind.Folder, kind = cmp.lsp.CompletionItemKind.Folder,
}) })
elseif type == 'link' then elseif type == 'link' then
@ -115,7 +117,9 @@ source._candidates = function(_, context, dirname, offset, callback)
if stat then if stat then
if stat.type == 'directory' then if stat.type == 'directory' then
table.insert(items, { table.insert(items, {
word = '/' .. name,
label = '/' .. name, label = '/' .. name,
insertText = '/' .. name .. '/',
kind = cmp.lsp.CompletionItemKind.Folder, kind = cmp.lsp.CompletionItemKind.Folder,
}) })
else else