folke / trouble.nvim

🚦 A pretty diagnostics, references, telescope results, quickfix and location list to help you solve all the trouble your code is causing.
Apache License 2.0
5.44k stars 177 forks source link

bug: lsp_incoming_calls doesn't give the caller function name #529

Closed cpcopy closed 3 months ago

cpcopy commented 3 months ago

Did you check docs and existing issues?

Neovim version (nvim -v)

NVIM v0.9.5

Operating system/version

ubuntu 22.04

Describe the bug

Run command lua require('trouble').open('lsp_incoming_calls'), I get the result as below. It doesn't give the incoming call function name. It is similar to lsp_references. image

The result of command 'lua vim.lsp.buf.incoming_calls()' is more reasonable. The result is posted to trouble. image

Steps To Reproduce

C code project with clangd setup. Run command lua require('trouble').open('lsp_incoming_calls')

Expected Behavior

Shall same as image

Repro

-- DO NOT change the paths and don't remove the colorscheme
local root = vim.fn.fnamemodify("./.repro", ":p")

-- set stdpaths to use .repro
for _, name in ipairs({ "config", "data", "state", "cache" }) do
  vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
end

-- bootstrap lazy
local lazypath = root .. "/plugins/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
  vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", lazypath, })
end
vim.opt.runtimepath:prepend(lazypath)

-- install plugins
local plugins = {
  "folke/tokyonight.nvim",
  "folke/trouble.nvim",
  -- add any other plugins here
}
require("lazy").setup(plugins, {
  root = root .. "/plugins",
})

vim.cmd.colorscheme("tokyonight")
-- add anything else here