Skip to content

Commit

Permalink
refactor: allow returning nil although lua_ls doesn't like it
Browse files Browse the repository at this point in the history
  • Loading branch information
mikavilpas committed Nov 4, 2024
1 parent 3fbe211 commit e1ec348
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions lua/blink-cmp-rg/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
---@field prefix_min_len number
---@field get_command fun(context: blink.cmp.Context, prefix: string): string[]
---@field get_prefix fun(context: blink.cmp.Context): string
---@field get_completions? fun(self: blink.cmp.Source, context: blink.cmp.Context, callback: fun(response: blink.cmp.CompletionResponse | nil)): (fun(): nil) | nil
---@field get_completions? fun(self: blink.cmp.Source, context: blink.cmp.Context, callback: fun(response: blink.cmp.CompletionResponse | nil)): nil
local RgSource = {}

---@param opts blink-cmp-rg.Options
Expand Down Expand Up @@ -44,7 +44,6 @@ function RgSource:get_completions(context, resolve)

if string.len(prefix) < self.prefix_min_len then
resolve()
---@diagnostic disable-next-line: missing-return-value
return
end

Expand Down Expand Up @@ -103,7 +102,6 @@ function RgSource:get_completions(context, resolve)
items = vim.tbl_values(items),
context = context,
})
---@diagnostic disable-next-line: missing-return
end)
end

Expand Down

0 comments on commit e1ec348

Please sign in to comment.