From 3cb7208546b4e1f0c5e492cbcfccd083a1c89351 Mon Sep 17 00:00:00 2001 From: Liam Dyer Date: Sat, 21 Dec 2024 14:04:26 -0500 Subject: [PATCH] fix: type signature for enabled indicating ctx could be passed Closes #695 --- lua/blink/cmp/config/sources.lua | 2 +- lua/blink/cmp/sources/lib/types.lua | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/blink/cmp/config/sources.lua b/lua/blink/cmp/config/sources.lua index 358c5ab0..42c0cbcc 100644 --- a/lua/blink/cmp/config/sources.lua +++ b/lua/blink/cmp/config/sources.lua @@ -26,7 +26,7 @@ --- @class blink.cmp.SourceProviderConfig --- @field name string --- @field module string ---- @field enabled? boolean | fun(ctx?: blink.cmp.Context): boolean Whether or not to enable the provider +--- @field enabled? boolean | fun(): boolean Whether or not to enable the provider --- @field opts? table --- @field async? boolean | fun(ctx: blink.cmp.Context): boolean Whether blink should wait for the source to return before showing the completions --- @field timeout_ms? number | fun(ctx: blink.cmp.Context): number How long to wait for the provider to return before showing completions and treating it as asynchronous diff --git a/lua/blink/cmp/sources/lib/types.lua b/lua/blink/cmp/sources/lib/types.lua index e9900c03..b2bd7080 100644 --- a/lua/blink/cmp/sources/lib/types.lua +++ b/lua/blink/cmp/sources/lib/types.lua @@ -20,7 +20,7 @@ --- @field reload? fun(self: blink.cmp.Source): nil --- @class blink.cmp.SourceOverride ---- @field enabled? fun(self: blink.cmp.Source, context: blink.cmp.Context): boolean +--- @field enabled? fun(self: blink.cmp.Source): boolean --- @field get_trigger_characters? fun(self: blink.cmp.Source): string[] --- @field get_completions? fun(self: blink.cmp.Source, context: blink.cmp.Context, callback: fun(response: blink.cmp.CompletionResponse | nil)): (fun(): nil) | nil --- @field should_show_completions? fun(self: blink.cmp.Source, context: blink.cmp.Context, response: blink.cmp.CompletionResponse): boolean