Closed michaelpj closed 3 months ago
This should let us get rid of a decent chunk of https://github.com/haskell/haskell-language-server/blob/b91c9076367123e983087ed305d183288a23f494/ghcide/src/Development/IDE/Core/ProgressReporting.hs#L108
Okay, I'm going to work on this for a little.
Sounds good
This is slightly annoying with the way it's currently done. In particular, at the moment we only do things when we get an update from the updater function, but once there are delays in the picture we probably need to wake up and send the last update that we saw every now and again, otherwise we might get quite bad behaviour. Which I think necessitates another thread handling that. So I need to refactor a bit.
I did this
At the moment we send progress start messages as soon as we can, and updates whenever we get them.
This means that:
We could potentially handle this generically: only send progress messages after a fixed interval has passed (should be configurable). In particular, if the operation terminates before we hit the first interval, we could send nothing.
This would let people declare most handlers to support progress and automatically get nice behaviour where progress is shown only if it takes a noticeable amount of time.