Skip to content

Commit 46a5f0b

Browse files
authored
fix(types): allow resolving empty response from blink.cmd.Source (#254)
Right now it looks like the code does nil checks perfectly, and there is no actual issue in resolving a nil value. However, the types still specify that a response must always be present.
1 parent a94bbaf commit 46a5f0b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lua/blink/cmp/sources/lib/types.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
--- @field new fun(config: blink.cmp.SourceProviderConfig): blink.cmp.Source
1313
--- @field enabled? fun(self: blink.cmp.Source, context: blink.cmp.Context): boolean
1414
--- @field get_trigger_characters? (fun(self: blink.cmp.Source): string[]) | nil
15-
--- @field get_completions? fun(self: blink.cmp.Source, context: blink.cmp.Context, callback: fun(response: blink.cmp.CompletionResponse)): (fun(): nil) | nil
15+
--- @field get_completions? fun(self: blink.cmp.Source, context: blink.cmp.Context, callback: fun(response: blink.cmp.CompletionResponse | nil)): (fun(): nil) | nil
1616
--- @field filter_completions? (fun(self: blink.cmp.Source, response: blink.cmp.CompletionResponse): blink.cmp.CompletionItem[]) | nil
1717
--- @field should_show_completions? (fun(self: blink.cmp.Source, context: blink.cmp.Context, response: blink.cmp.CompletionResponse): boolean) | nil
1818
--- @field resolve? (fun(self: blink.cmp.Source, item: blink.cmp.CompletionItem, callback: fun(resolved_item: lsp.CompletionItem | nil)): ((fun(): nil) | nil)) | nil

0 commit comments

Comments
 (0)