Skip to content

Commit 82106a4

Browse files
committed
feat: handle no items in source provider
1 parent 5787816 commit 82106a4

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

lua/blink/cmp/sources/lib/source.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ function source:get_completions(context)
3838
return async.task
3939
.new(function(resolve) return self.module:get_completions(context, resolve) end)
4040
:map(function(response)
41+
if response == nil then response = { is_incomplete_forward = true, is_incomplete_backward = true, items = {} } end
4142
response.context = context
42-
4343
self.last_response = response
4444

4545
-- add score offset if configured

lua/blink/cmp/sources/snippets/init.lua

+1-3
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,7 @@ end
1919

2020
function snippets:get_completions(context, callback)
2121
local filetype = vim.bo.filetype
22-
if vim.tbl_contains(self.registry.config.ignored_filetypes, filetype) then
23-
return callback({ is_incomplete_forward = false, is_incomplete_backward = false, items = {} })
24-
end
22+
if vim.tbl_contains(self.registry.config.ignored_filetypes, filetype) then return callback() end
2523

2624
if not self.cache[filetype] then
2725
local global_snippets = self.registry:get_global_snippets()

0 commit comments

Comments
 (0)