mirror of
https://github.com/neovim/neovim.git
synced 2026-08-28 10:01:49 +00:00
fix(lsp): callHierarchy/outgoingCalls ranges are relative to caller, not callee #39336
Problem: The fromRanges field of the result of callHierarchy/outgoingCalls is documented as being relative to the caller. Using vim.lsp.buf.outgoing_calls() opened the qflist with an entry with the callee's filename, but the caller's line number. Solution: Open the qflist with the callers file (the bufnr from the request), rather than the callees (the uri from the resulting CallHierarchyItem)
This commit is contained in:
@@ -106,13 +106,14 @@ describe('vim.lsp.buf', function()
|
||||
},
|
||||
}
|
||||
local handler = require 'vim.lsp.handlers'['callHierarchy/outgoingCalls']
|
||||
handler(nil, rust_analyzer_response, {})
|
||||
local bufnr = vim.api.nvim_get_current_buf()
|
||||
handler(nil, rust_analyzer_response, { bufnr = bufnr })
|
||||
return vim.fn.getqflist()
|
||||
end)
|
||||
|
||||
local expected = {
|
||||
{
|
||||
bufnr = 2,
|
||||
bufnr = 1,
|
||||
col = 5,
|
||||
end_col = 0,
|
||||
lnum = 4,
|
||||
|
||||
Reference in New Issue
Block a user