Closed chemzqm closed 2 years ago
VSCode's withProgress
support location, which controls the notification window position.
In addition to being annoying, it prevents seeing completion docs (the documentation modal that appears next to the completion list) when using C-n to browse through the completions, at least in rust-analyzer:
It does not happen with the arrow keys, as they move through the completion list but does not change the buffer.
workspace.progressTarget to statusline solves it.
Yes, this feature is especially annoying when diagnostic.refreshOnInsertMode
is on. Every time I press a key, the notification from the rust analyzer pops up then disappears. Would be a pretty cool feature if it were less obtrusive, though.
EDIT: By the way, is there a way to disable this notification feature for now?
Nevermind, I just set notification.maxWidth
to 0
, and now they're gone.
this becomes quite annoying while coding substrate projects, since rust-analyzer reports also build-script-fail
of wasm
A crazy one can be like, wondering if it's possible to turn off it totally util rust-analyzer gives a fix @chemzqm @fannheyward
As my comment in https://github.com/fannheyward/coc-rust-analyzer/issues/763, how should the client to improve this? LS, here is rust-analyzer, sends notifications and coc/coc-rust-analyzer displays them, if the client side hides them, you won't know what's wrong.
Maybe we can hide the cargo check failed
error message from coc-rust-analyzer in hard code, but it's still not a good solution for this, because rust-analyzer abuses the notifications.
@fannheyward I think we can have a parameter to turn off notifications. No notification is still better than unable to code.
Currently it just never ends, it disappears and then re-appears, I know it's maybe a rust-analyzer issue, but maybe we can have a way in coc.nvim to prevent this from appearing, at least the users can then focus on coding
This should be done in coc-rust-analyzer, not coc.
I think we can have a parameter to turn off notifications. No notification is still better than unable to code.
No, we won't, hack the code if you need that.
Use "coc.preferences.enableMessageDialog": false
@chemzqm I just tried to use coc.preferences.enableMessageDialog: false
but it seems the notifications are still there:
if it arrives one by one, I think it's ok, but two or three just arrives at the same time
Reproduce steps:
:CocInstall coc-rust-analyzer
cd ~
cargo new hello-world
vim ~/Cargo.toml
and put the following content
workspace.members = ["project-on-moon"]
~/hello-world/src/main.rs
, you should then see this:
https://user-images.githubusercontent.com/33961674/130188375-09c0f5f1-b24b-4a8b-9dfb-9d7d07d8adf5.pngI know it's maybe good to be aware of errors, but we also don't want to have this notification everytime when I open a rust file in the project, sometimes error can come from 3rd parties libraries
@GopherJ why do you vim ~/Cargo.toml
and vim ~/hello-world/src/main.rs
? You didn't enter the hello-world
root?
Can't reproduce in my tests:
cd /tmp/
cargo new hello-world && cd hello-world
vim Cargo.toml
and add workspace.members = ["project-on-moon"]
under [dependencies]
vim src/main.rs
, no errors@fannheyward I would assume workspace.members
under dependencies doesn't make sense.
workspace Cargo.toml should contain child cargo project. That's why I did like https://github.com/neoclide/coc.nvim/issues/2702#issuecomment-902458031, ~/Cargo.toml
contain child project, but if there is one small error, then I'll get ugly notifications
New notification works like VSCode, notifications with same options would be replaced.
Is it possible to disable progress notifications? coc.preferences.enableMessageDialog
only has an effect on non-progress notifications.
No it may have actions, you can hack the code
@chemzqm I tried living with progress notifications to see if I start liking them after a week, but I still utterly despise them.
This is quite a bloated feature and I think there should be an upstream option to turn it off completely.
Also depending on the LSP used, it can be outright buggy, for example with the Texlab language server, I now have a permanent notification down there, because I start texlab
with -interaction=nonstopmode
to automatically build again when I write the file:
This notification never disappears! But I didn't want to see that notification in the first place, there should be an option to disable all notifications.
You can add progress
to disabledFeatures
in your languageserver configuration.
Or use :h coc-config-notification-disabledProgressSources
Or use
:h coc-config-notification-disabledProgressSources
Thanks, "notification.disabledProgressSources": ["*"],
in :CocConfig
did the trick.
Compare to statusline progress, user could cancel the action with progress window by simply close it, but current notification window could be annoying.
Create a small window without border at right bottom region of screen seems better.