Skip to content

Propagate asExternalUri resolver errors#325925

Open
NgoQuocViet2001 wants to merge 1 commit into
microsoft:mainfrom
NgoQuocViet2001:fix-162770-as-external-uri-errors
Open

Propagate asExternalUri resolver errors#325925
NgoQuocViet2001 wants to merge 1 commit into
microsoft:mainfrom
NgoQuocViet2001:fix-162770-as-external-uri-errors

Conversation

@NgoQuocViet2001

Copy link
Copy Markdown

Fixes #162770

This change distinguishes an unhandled external URI from a resolver failure. HTTP and HTTPS URIs still fall back to the original URI when no resolver handles them, while actual resolver errors now propagate back to the extension. Resolver failures also do not prevent a later resolver from succeeding.

Tests cover the main-thread fallback and error path, plus multi-resolver success, failure, and unhandled cases.

Testing:

  • npm run typecheck-client
  • npm run gulp compile-client
  • scripts\test.bat --grep MainThreadWindow (2 passing)
  • scripts\test.bat --grep OpenerService (20 passing)
  • npm run eslint
  • npm run valid-layers-check

Copilot AI review requested due to automatic review settings July 15, 2026 09:56

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Distinguishes unhandled external URIs from resolver failures so genuine errors reach extensions while HTTP(S) fallback remains intact.

Changes:

  • Adds a dedicated unhandled-resolver error.
  • Continues through failing resolvers and propagates the last failure.
  • Moves HTTP(S) fallback to the main thread and adds coverage.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/vs/platform/opener/common/opener.ts Defines the unhandled-resolver error.
src/vs/editor/browser/services/openerService.ts Preserves resolver failures while trying subsequent resolvers.
src/vs/workbench/api/browser/mainThreadWindow.ts Applies HTTP(S)-only fallback.
src/vs/workbench/api/common/extHost.api.impl.ts Allows resolver failures to reach extensions.
src/vs/editor/test/browser/services/openerService.test.ts Tests resolver outcomes and error propagation.
src/vs/workbench/api/test/browser/mainThreadWindow.test.ts Tests fallback and propagation behavior.

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.

errors thrown by openerService.resolveExternalUri not surfaced to MainThreadWindow.$asExternalUri in VS Code Web

2 participants