mirror of
https://github.com/LazyVim/LazyVim.git
synced 2026-07-25 14:01:06 +00:00
fix(blink): wrap user-defined transform_items when provider.kind is set
This commit is contained in:
parent
601cf7d6de
commit
946e506b4f
1 changed files with 3 additions and 0 deletions
|
|
@ -100,9 +100,12 @@ return {
|
|||
---@cast provider blink.cmp.SourceProviderConfig|{kind?:string}
|
||||
if provider.kind then
|
||||
require("blink.cmp.types").CompletionItemKind[provider.kind] = provider.kind
|
||||
---@type fun(ctx: blink.cmp.Context, items: blink.cmp.CompletionItem[]): blink.cmp.CompletionItem[]
|
||||
local transform_items = provider.transform_items
|
||||
---@param ctx blink.cmp.Context
|
||||
---@param items blink.cmp.CompletionItem[]
|
||||
provider.transform_items = function(ctx, items)
|
||||
items = transform_items and transform_items(ctx, items) or items
|
||||
for _, item in ipairs(items) do
|
||||
item.kind = provider.kind or item.kind
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue