From 8cd58c6e81ac4c919ae3ea70cdf1a17c265a508f Mon Sep 17 00:00:00 2001 From: James Trew <66286082+jamestrew@users.noreply.github.com> Date: Sun, 17 Mar 2024 21:09:56 -0400 Subject: [PATCH] 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. --- lua/telescope/builtin/__lsp.lua | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/lua/telescope/builtin/__lsp.lua b/lua/telescope/builtin/__lsp.lua index 90dec93..5c1a485 100644 --- a/lua/telescope/builtin/__lsp.lua +++ b/lua/telescope/builtin/__lsp.lua @@ -23,12 +23,14 @@ local function call_hierarchy(opts, method, title, direction, item) local locations = {} for _, ch_call in pairs(result) do local ch_item = ch_call[direction] - table.insert(locations, { - filename = vim.uri_to_fname(ch_item.uri), - text = ch_item.name, - lnum = ch_item.range.start.line + 1, - col = ch_item.range.start.character + 1, - }) + for _, rng in pairs(ch_call.fromRanges) do + table.insert(locations, { + filename = vim.uri_to_fname(ch_item.uri), + text = ch_item.name, + lnum = rng.start.line + 1, + col = rng.start.character + 1, + }) + end end pickers