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

Make the spinner spin when the LSP doen't sent progress report #9787

Closed

Conversation

ArmanSoltani
Copy link

This PR is a proposition to make the spinner more smooth (#8704).

I understand that efficiency is important for Helix (#6446 (comment)) and I fully agree with that. What I propose is to automatically redraw the view every 100ms if there are a lsp job in progress. So ether:

  • The hardware or the lsp server are super fast and the lsp progress reports will anyway trigger a redraw 30 times/s (with the de-bouncing)
  • Or, some times, the lsp doesn't send anything while processing, and in that case we automatically redraw the view 10 times/s

When the lsp job is completed there should be no overhead.

For a quick "benchmark" on my average pc when opening helix project I see currently 70 calls to terminal::draw vs 123 calls using the auto redraw. After that the number of draw calls are the same.

The spinner also keep the current annimation frame idx so, if it is stopped
and restart then the animation is smoother.
@the-mikedavis the-mikedavis added the S-waiting-on-review Status: Awaiting review from a maintainer. label Mar 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from a maintainer.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants