staysail / nova-dvelop

D Language Extension for Nova
MIT License
5 stars 1 forks source link

Notifications dismiss themselves #8

Open chances opened 1 year ago

chances commented 1 year ago

I use the dlang.org install script to install LDC. Nova has trouble finding my D installation in the environment. Regardless, this extension shows error notifications while trying to initialize the language server.

image

These notifications dismiss themselves after less than about 6 seconds. Notifications from Nova itself and other extensions let me read and dismiss them myself.

gdamore commented 1 year ago

Yeah, I think for error notifications like this we should do that. I think part of this is how serve-d uses the LSP API to send these notifications -- I don't think they are classed as "errors" needing to be acknowledged.

I know that for other ones, like the "Language server restarted." notification, they are meant to be auto-dismiss, because there is no further user action needed. But notices that need to be acknowledged or corrected should not automatically dismiss.

gdamore commented 1 year ago

@webfreak001 - any ideas here?

WebFreak001 commented 1 year ago

these notifications are sent as error messages / have MessageType error - so probably a bug on your end? They stay there on vscode; unless of course it comes from restarting the language server, where it might clear the notifications from the previous run (vscode doesn't do that though, although there is no specification what to do)

gdamore commented 11 months ago

Errors are displayed using nova'sworkspace.showErrorMessage API and warnings are displayed using workspace.showWarningMessage.

These don't provide any way to make the display modal. Nova claims it may bring the workspace to the foreground, but it says nothing about requiring confirmation, and there is no way to make them so using that API.

I think this is a limitation of Nova itself.

gdamore commented 11 months ago

I'm going to close this for now, because there is no way I can do anything more with it. I'll also submit this to the Nova people.

edwardloveall commented 11 months ago

One option here is to use a NotificationRequest instead of workspace.showErrorMessage. It's not documented well, but if you don't add actions the notification will auto-dismiss. But if you do add actions the alert will stay on the screen until dismissed.