microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
162.27k stars 28.57k forks source link

Need a UI message when an extension fails to initialize #179633

Open sergten opened 1 year ago

sergten commented 1 year ago

Currently if the activate() extension function throw an exception, the VS Code behavior in reporting this error is different depending on whether the extension is in the retail or development environment. Here is the code line that produces the error message upon activation failure:

https://github.com/microsoft/vscode/blob/b547b58db642cac86c6a869cd025713f4e2cac9f/src/vs/workbench/api/browser/mainThreadExtensionService.ts#L107

In the development environment, a UI message is displayed, while in retail mode the message is recorded to the Development Tools Console.

vscode_error_in_console

Activating_extension_failure_message

This makes it difficult to troubleshoot for customers, as they don't normally have the Development Tools Console opened, and the user experience is as if the extension has been activated but doesn't do anything.

Please consider unifying the experience by always displaying the UI message.

A sample extension (with only one line throw new Error('Inducing activation failure') is attached. sample_extension.zip

alexdima commented 1 year ago

Today, I think we render this error message also in the Extensions viewlet next to the extension and also in the Running Extensions view. The reason we are not showing this as an error notification is because of feedback we've received where users thought that this is a problem with vs code, not with the extension. But we took that decision at a time when our notifications looked very different.

@isidorn @sandy081 @bpasero Do you have any thoughts here?

isidorn commented 1 year ago

@alexdima thanks for the ping. I think a UI showing this in the Extensions view is the way to go here - maybe we need to make it more prominent? In the future if we have an "extension notification center" this is a great candidate to go there.

I am worried that we drown users in error notifications if we start using notifications for this. Do we have telemetry for this event - so we know how often extension fail to activate?

What do you think?

fyi @hbons

alexdima commented 1 year ago

Do we have telemetry for this event - so we know how often extension fail to activate?

No.

I'm OK to wait for the new extension UI.