Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running into some weird behavior with v3 #485

Closed
folke opened this issue Jun 6, 2024 Discussed in #478 · 2 comments
Closed

Running into some weird behavior with v3 #485

folke opened this issue Jun 6, 2024 Discussed in #478 · 2 comments

Comments

@folke
Copy link
Owner

folke commented Jun 6, 2024

Discussed in #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
Copy link
Owner Author

folke commented Jun 6, 2024

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
Copy link

🥳 🥳 🥳 🥳 🥳 🥳 🥳

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants