neoclide / coc.nvim

Nodejs extension host for vim & neovim, load extensions like VSCode and host language servers.
Other
24.48k stars 960 forks source link

Make notification in float window less disturbing. #2702

Closed chemzqm closed 2 years ago

chemzqm commented 3 years ago

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.

fannheyward commented 3 years ago

VSCode's withProgress support location, which controls the notification window position.

gerardabello commented 3 years ago

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.

MonliH commented 3 years ago

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.

GopherJ commented 3 years ago

this becomes quite annoying while coding substrate projects, since rust-analyzer reports also build-script-fail of wasm

https://github.com/rust-analyzer/rust-analyzer/issues/9096

GopherJ commented 3 years ago

A crazy one can be like, wondering if it's possible to turn off it totally util rust-analyzer gives a fix @chemzqm @fannheyward

image
fannheyward commented 3 years ago

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.

GopherJ commented 3 years ago

@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

fannheyward commented 3 years ago

This should be done in coc-rust-analyzer, not coc.

chemzqm commented 3 years ago

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

GopherJ commented 3 years ago

@chemzqm I just tried to use coc.preferences.enableMessageDialog: false but it seems the notifications are still there:

https://user-images.githubusercontent.com/33961674/130187706-41af8003-ed4a-4240-939a-3b7cee222e95.png

if it arrives one by one, I think it's ok, but two or three just arrives at the same time

GopherJ commented 3 years ago

Reproduce steps:

  1. :CocInstall coc-rust-analyzer
  2. cd ~
  3. cargo new hello-world
  4. vim ~/Cargo.toml and put the following content
    workspace.members = ["project-on-moon"]
  5. vim ~/hello-world/src/main.rs, you should then see this: https://user-images.githubusercontent.com/33961674/130188375-09c0f5f1-b24b-4a8b-9dfb-9d7d07d8adf5.png

I 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

fannheyward commented 3 years ago

@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:

  1. cd /tmp/
  2. cargo new hello-world && cd hello-world
  3. vim Cargo.toml and add workspace.members = ["project-on-moon"] under [dependencies]
  4. vim src/main.rs, no errors
GopherJ commented 3 years ago

@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

chemzqm commented 2 years ago

New notification works like VSCode, notifications with same options would be replaced.

vimpostor commented 2 years ago

Is it possible to disable progress notifications? coc.preferences.enableMessageDialog only has an effect on non-progress notifications.

chemzqm commented 2 years ago

No it may have actions, you can hack the code

vimpostor commented 2 years ago

@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: Screenshot_20220610_233613

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.

chemzqm commented 2 years ago

You can add progress to disabledFeatures in your languageserver configuration. Or use :h coc-config-notification-disabledProgressSources

vimpostor commented 2 years ago

Or use :h coc-config-notification-disabledProgressSources

Thanks, "notification.disabledProgressSources": ["*"], in :CocConfig did the trick.