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.11k stars 173 forks source link

feature: Can nvim-treesitter-context be applied to preview window? #469

Closed cpcopy closed 1 month ago

cpcopy commented 1 month ago

Did you check the docs?

Is your feature request related to a problem? Please describe.

When go through the reference, if I know the name of function in which the reference is used, it would be helpful for me to quickly find out whether it is the one I want to check.

Describe the solution you'd like

I am working on C projects. In cscope way, each reference item has the caller function name showed above. After switching to LSP, I don't find a plugin can do similar thing. It seems that Clangd doesn't support returning such information. Then, I find nvim-treesitter-context is a convenient way to show the function name when the function name is out of window. If it can be applied to preview window, at least I can check the caller function name in preview window.

Describe alternatives you've considered

  1. Previewing the reference items in telescope preview window and scrolling to check the function name.
  2. With trouble.nvim v2, I rely on inactive winbar to show the function name from 'require('nvim-treesitter.statusline').statusline(opts)'. But it doesn't work with V3.

Additional context

No response