Skip to content

Commit

Permalink
fix(lsp): early return on completionItem/resolve (#1055)
Browse files Browse the repository at this point in the history
Closes #1048
  • Loading branch information
soifou authored Jan 22, 2025
1 parent 5b83998 commit 80dab4d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lua/blink/cmp/sources/lsp/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,10 @@ function lsp:resolve(item, callback)
item = require('blink.cmp.sources.lib.utils').blink_item_to_lsp_item(item)

local success, request_id = client.request('completionItem/resolve', item, function(error, resolved_item)
if error or resolved_item == nil then callback(item) end
if error or resolved_item == nil then
callback(item)
return
end

-- Snippet with no detail, fill in the detail with the snippet
if resolved_item.detail == nil and resolved_item.insertTextFormat == vim.lsp.protocol.InsertTextFormat.Snippet then
Expand Down

0 comments on commit 80dab4d

Please sign in to comment.