haskell-language-server icon indicating copy to clipboard operation
haskell-language-server copied to clipboard

haskell-language-server is chatty about progress

Open mitchellwrosen opened this issue 2 years ago • 6 comments

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

haskell-language-server seems rather chatty with its progress updates. In particular, after the initial long load, while I'm actively editing a buffer, the server sends a huge number of very short-lived progress updates (where the "end" notification occurs a fraction of a second after the "begin" notification) that just say the word "Processing".

Describe the solution you'd like

I'm not exactly sure - on one hand, I should think that a language-server would always be in the background "processing" things, so perhaps these notifications simply shouldn't be emitted at all. Alternatively, they could be made more informative.

Thanks!

mitchellwrosen avatar May 06 '23 04:05 mitchellwrosen

Generally our progress notifications are pretty bad, I'm not sure what to do about that.

I suspect what's going on here is that we're sending progress for every module we're loading or similar. That's not a crazy thing to do, but it's perhaps unnecessary, and it would be good if the notification actually said something useful, like what the module was.

michaelpj avatar May 06 '23 11:05 michaelpj

Personally I like current progress reports. I don't know if sending lots of short-lived notifications have any detrimental effect but seeing 140/180 modules message is pretty neat in my neovim. It also gives a hint that I should split my modules further when after changing a single definition it reprocesses 40 other modules :sweat_smile:

Anrock avatar May 06 '23 14:05 Anrock

@Anrock Please note this issue is not about progress notifications in general. I also like seeing messages like "X/Y modules", especially when Y is large or getting to Y/Y takes more than a couple seconds.

However, as mentioned in the issue description there are notifications that literally just say the word "Processing" and no more.

I think whether or not there are detrimental effects of sending many notifications is mostly a function of client settings. I recently toyed around with a fancier graphical notification plugin, which is what drew my attention to hls; I'm sure you can imagine what getting a hundred toasts a minute while editing text would be like. But if you just have notifications drawn on a single line somewhere, and each notification just overwrites whatever is there, then I'm not sure it matters much either way ;)

mitchellwrosen avatar May 06 '23 16:05 mitchellwrosen

You can only see Processing from hls is here, should the text be optimized?

https://github.com/haskell/haskell-language-server/blob/41cd52e603ab4e1c7d8fcbf95140610c2a1fe04e/ghcide/src/Development/IDE/Core/ProgressReporting.hs#L137-L146

July541 avatar May 06 '23 18:05 July541

We can also tweak the frequency of the progress reports here: https://github.com/haskell/haskell-language-server/blob/master/ghcide/src/Development/IDE/Core/Shake.hs#LL635C72-L635C72

michaelpj avatar May 17 '23 11:05 michaelpj

any progress on this?

mortezadadgar avatar Nov 16 '23 14:11 mortezadadgar

I think this is hopefully fixed or at least better UX: we now have a universal delay on starting progress, so we won't show it for short-lived operations; and then updates are throttled.

michaelpj avatar May 24 '24 11:05 michaelpj