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

Running into some weird behavior with v3 #485

Closed folke closed 3 weeks ago

folke commented 3 weeks ago

Discussed in https://github.com/folke/trouble.nvim/discussions/478

Originally posted by **SchnozzleCat** June 4, 2024 Playing with the new goodies in the update, and ran into some behavior that differs from how it previously worked. This is primarily related to the LSP reference mode (e.g. `Trouble lsp_references`). If auto_refresh is on, it seems to re-fetch the references of the current cursor symbol every ~5 seconds, which is counterintuitive to my workflow, since I want to move through queried references without losing the current set. If auto_refresh is off, I need to manually call `require("trouble").refresh()`, which isn't a huge deal, but I just want to understand if the refresh mechanism is supposed to behave in this way. Something else I noticed, is that the lsp reference window does not refresh if I hover over a symbol and call `Trouble lsp_references` again, it just keeps the old references. I either need to wait for the ~5 second interval of the auto-refresh, or manually call `refresh()` after requesting the references. Is this behavior intended? Previously IIRC it used to just refresh the window, which seems more intuitive to me. Something else that is strange, is if auto_refresh is off, and is then enabled in a running session with `require("trouble").toggle_refresh()`, something like a symbol window (e.g. `Trouble symbols`) will auto-refresh, but the LSP window will lose the automatic refresh that happens every 5 seconds. This behavior is actually closer to what I would want (then I can manually refresh in my binding for LSP references), but that definitely seems inconsistent, at least with the auto_refresh setup setting, unless I am missing something. ``` NVIM v0.10.0-dev-9e1bbb9 Build type: Release LuaJIT 2.1.1693350652 ``` Turouble 3.1.0, as well as `915179759c9459b69faae90a38da6fc1ca6b90d7` had this behavior for me.
folke commented 3 weeks ago

I just pushed a change so that the trouble window will always refresh when you open it again while already being open. This should fix the issue you're having with the references not refreshing when you hover over a symbol and call Trouble lsp_references again.

Integralist commented 3 weeks ago

🥳 🥳 🥳 🥳 🥳 🥳 🥳