Skip to content

Commit 141c9e8

Browse files
committed
feat(completion): rely on kind_icon instead of deducing it
1 parent 52c8e09 commit 141c9e8

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

lua/opencode/ui/completion/engines/blink_cmp.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ function Source:get_completions(ctx, callback)
5959
for i, item in ipairs(source_items) do
6060
table.insert(items, {
6161
label = item.label,
62-
kind = item.kind == 'file' and 17 or item.kind == 'folder' and 19 or 1, -- 17: File, 19: Folder, 1: Text
62+
kind = item.kind,
6363
kind_icon = item.kind_icon,
6464
detail = item.detail,
6565
documentation = item.documentation,

lua/opencode/ui/completion/engines/nvim_cmp.lua

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,7 @@ function M.setup(completion_sources)
5555
for j, item in ipairs(source_items) do
5656
table.insert(items, {
5757
label = item.label,
58-
kind = item.kind == 'file' and cmp.lsp.CompletionItemKind.File
59-
or item.kind == 'folder' and cmp.lsp.CompletionItemKind.Folder
60-
or cmp.lsp.CompletionItemKind.Text,
58+
kind = item.kind,
6159
cmp = {
6260
kind_text = item.kind_icon,
6361
},

0 commit comments

Comments
 (0)