Fix #75: The error handling code of implementation_handler() does not work (#76)

Co-authored-by: Jinsong Zhang <spindensity@gmail.com>
neovim_0.6
spindensity 3 years ago committed by GitHub
parent a2ddb1ff4b
commit 5391bf6aec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -10,14 +10,14 @@ local log = util.log
-- dataformat should be same as reference
local function location_handler(err, locations, ctx, cfg, msg)
if err ~= nil then
print("ERROR: " .. tostring(err) .. msg)
print("ERROR: " .. tostring(err) .. " " .. msg)
return
end
return locations_to_items(locations)
end
local function implementation_handler(bang, err, result, ctx, cfg)
local results = location_handler(err, result, ctx, "Implementation not found")
local results = location_handler(err, result, ctx, cfg, "Implementation not found")
local ft = vim.api.nvim_buf_get_option(ctx.bufnr, "ft")
gui.new_list_view({items = results, ft = ft, api = 'Implementation'})
end

Loading…
Cancel
Save