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

haskell-language-server is chatty about progress #3577

Open
mitchellwrosen opened this issue May 6, 2023 · 6 comments
Open

haskell-language-server is chatty about progress #3577

mitchellwrosen opened this issue May 6, 2023 · 6 comments
Labels
type: enhancement New feature or request

Comments

@mitchellwrosen
Copy link

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!

@michaelpj
Copy link
Collaborator

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.

@Anrock
Copy link
Contributor

Anrock commented May 6, 2023

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 😅

@mitchellwrosen
Copy link
Author

@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 ;)

@July541
Copy link
Collaborator

July541 commented May 6, 2023

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

start id = LSP.sendNotification LSP.SProgress $
LSP.ProgressParams
{ _token = id
, _value = LSP.Begin $ WorkDoneProgressBeginParams
{ _title = "Processing"
, _cancellable = Nothing
, _message = Nothing
, _percentage = Nothing
}
}

@michaelpj
Copy link
Collaborator

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 michaelpj added level: easy The issue is suited for beginners and removed status: needs triage labels May 17, 2023
@michaelpj michaelpj changed the title haskell-language-server is chatty haskell-language-server is chatty about progress May 17, 2023
@mortezadadgar
Copy link

any progress on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants