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: include current reference in list #482

Closed Saecki closed 3 weeks ago

Saecki commented 4 weeks ago

Did you check the docs?

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

When listing references of a function, the current reference isn't included in the list. Especially when it's a call reference and not the definition of the function, I find that to be somewhat irritating.

Describe the solution you'd like

I'd like a configuration option similar to the includeDeclaration parameter that the lsp spec defines. That would also include the one currently under the cursor.

Describe alternatives you've considered

Since the current behavior is hard-coded, I think currently the only alternative would be to use vim.lsp.buf.references() instead of trouble. But the quickfix list offers a way worse user experience compared to trouble.

Additional context

No response

folke commented 3 weeks ago

This is now configurable per mode. Please refer to the update docs.