fix(lsp): incoming/outgoing_call range locations (#2985)

Previous implementation uses the incorrect lsp result fields for
generating call site locations resulting in incomplete and incorrect
results.
This commit is contained in:
James Trew
2024-03-17 21:09:56 -04:00
committed by GitHub
parent 04dfe370b0
commit 8cd58c6e81

View File

@@ -23,13 +23,15 @@ local function call_hierarchy(opts, method, title, direction, item)
local locations = {} local locations = {}
for _, ch_call in pairs(result) do for _, ch_call in pairs(result) do
local ch_item = ch_call[direction] local ch_item = ch_call[direction]
for _, rng in pairs(ch_call.fromRanges) do
table.insert(locations, { table.insert(locations, {
filename = vim.uri_to_fname(ch_item.uri), filename = vim.uri_to_fname(ch_item.uri),
text = ch_item.name, text = ch_item.name,
lnum = ch_item.range.start.line + 1, lnum = rng.start.line + 1,
col = ch_item.range.start.character + 1, col = rng.start.character + 1,
}) })
end end
end
pickers pickers
.new(opts, { .new(opts, {