Skip to content

fix(exthost): show activation failures as VS Code does - #55

Merged
BartvHelvert merged 3 commits into
masterfrom
fix/activation-failure-notice
Nov 4, 2026
Merged

BartvHelvert merged 3 commits into
masterfrom
fix/activation-failure-notice

Conversation

@BartvHelvert

@BartvHelvert BartvHelvert commented Nov 4, 2026 •

Copy link
Copy Markdown
Owner

What this changes

When an extension failed to activate, CodeBridge always showed an error notification with the host's message. Extensions usually explain the failure themselves and then reject activate() without a reason. golang.go without Go installed shows its own "Failed to find the "go" binary" message, and CodeBridge added "Activating extension 'golang.go' failed: undefined." on top of it.

This now does what VS Code's release build does (MainThreadExtensionService.$onExtensionActivationError and the Extensions view's runtime status):

  • No notification for an ordinary failure. Every failure is logged. Only a missing dependency still notifies, with the existing "Install and enable ..." detail.
  • The failure is shown on the VS Code Extensions page instead. The extension's row gets an error icon and "Activation failed" in its metrics line, and its details show "Activation failed: <the host's reason>". Without this, a failure would only be in the log, since CodeBridge has no equivalent of VS Code's always-visible Extensions view.

How the page gets the failures:

  • HostedActivationFailures, a new project service, keeps the failures the project's host reports and clears them when the host stops, as VS Code's status lasts until a reload.
  • MarketplaceApi.activationFailures(projectId) streams them to the page, which updates while it's open. BackendRequests.watch is the generic form of the existing watchExtensions.

Fixes #54

How it was tested

  • ExtensionActivationsTest: one new test checks that a plain failure doesn't notify the user, and the missing-dependency test checks that it does. :shared:test --tests '*ExtensionActivationsTest' passed (6 tests).
  • SplitModeActivationFailureTest (new UI test) installs a new fixture, activation-failure-extension, whose activate() throws, then opens one of its files. In the split-mode client it checks the "Activation failed" mark on the row and the reason in the details. It passed in WSL (1 test, 0 failures).
  • Not run: the full test suite, and a manual check with golang.go in a sandbox IDE.

Checklist

  • Nothing is special-cased for one extension.
  • A new feature has a UI test.
  • No internal, override-only, obsolete or deprecated platform API.
  • docs/ is updated where behaviour changed, docs/status.md especially.
  • Third-party material keeps its notice and is listed in NOTICE.md. None added.

@BartvHelvert BartvHelvert changed the title fix(exthost): notify only when a dependency is missing fix(exthost): show activation failures as VS Code does Nov 4, 2026
An extension that fails to activate usually says why itself and then
rejects activate() with no reason. golang.go without Go installed shows
its own "Failed to find the go binary" message, and CodeBridge added
"Activating extension 'golang.go' failed: undefined." on top.

VS Code's release build only logs such failures and notifies only when
a dependency is missing. Do the same.

Refs #54
With the notification gone, a failure was visible only in the log.
VS Code's release build marks such an extension in the Extensions view
and shows the error under its runtime status. Do the same on the VS
Code Extensions page: the row says "Activation failed" and the details
give the host's reason, for as long as the project's host runs.

Refs #54
@BartvHelvert
BartvHelvert force-pushed the fix/activation-failure-notice branch from 855cece to 973493a Compare November 4, 2026 23:04
@BartvHelvert
BartvHelvert merged commit 69d5b73 into master Nov 4, 2026
5 of 6 checks passed
@BartvHelvert
BartvHelvert deleted the fix/activation-failure-notice branch November 4, 2026 23:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Activation failures show "failed: undefined" notifications

1 participant