From b5e157c8ae23425b41cf7f99b1916845b48cb916 Mon Sep 17 00:00:00 2001 From: hrsh7th Date: Mon, 9 Aug 2021 14:40:59 +0900 Subject: [PATCH] Support chained completion --- lua/cmp_path/init.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lua/cmp_path/init.lua b/lua/cmp_path/init.lua index 4c9db63..98e8213 100644 --- a/lua/cmp_path/init.lua +++ b/lua/cmp_path/init.lua @@ -107,7 +107,9 @@ source._candidates = function(_, context, dirname, offset, callback) if accept then if type == 'directory' then table.insert(items, { + word = '/' .. name, label = '/' .. name, + insertText = '/' .. name .. '/', kind = cmp.lsp.CompletionItemKind.Folder, }) elseif type == 'link' then @@ -115,7 +117,9 @@ source._candidates = function(_, context, dirname, offset, callback) if stat then if stat.type == 'directory' then table.insert(items, { + word = '/' .. name, label = '/' .. name, + insertText = '/' .. name .. '/', kind = cmp.lsp.CompletionItemKind.Folder, }) else