pull/180/head
ray-x 2 years ago
parent e5c7d643b1
commit 5b70d93603

@ -133,9 +133,9 @@ local show_panel = function(result, pkg, rerender)
end end
end end
vim.lsp.buf_request(0, "workspace/symbol", { query = "'" .. n.symbol }, function(e, result, ctx) vim.lsp.buf_request(0, "workspace/symbol", { query = "'" .. n.symbol }, function(e, lsp_result, ctx)
local filtered = {} local filtered = {}
for _, r in pairs(result) do for _, r in pairs(lsp_result) do
local container = r.containerName local container = r.containerName
if pkg == container and r.name == n.symbol then if pkg == container and r.name == n.symbol then
table.insert(filtered, r) table.insert(filtered, r)
@ -144,11 +144,11 @@ local show_panel = function(result, pkg, rerender)
log("filtered", filtered) log("filtered", filtered)
if #filtered == 0 then if #filtered == 0 then
log("nothing found fallback to result", pkg, n.symbol) log("nothing found fallback to result", pkg, n.symbol)
filtered = result filtered = lsp_result
end end
if vfn.empty(filtered) == 1 then if vfn.empty(filtered) == 1 then
log(e, result, ctx) log(e, lsp_result, ctx)
vim.notify("no symbol found for " .. vim.inspect(pkg)) vim.notify("no symbol found for " .. vim.inspect(pkg))
return false return false
end end
@ -288,8 +288,8 @@ render = function(bufnr)
log("no packege info data " .. e .. tostring(data)) log("no packege info data " .. e .. tostring(data))
return return
end end
bufnr, fname = render_outline(result) local buf, fname = render_outline()
log(bufnr, fname) log(buf, fname)
end, end,
}) })
return defs return defs

Loading…
Cancel
Save