Theia API Documentation v1.65.0
    Preparing search index...

    Handles opening uris to external resources, such as http(s) links.

    Extensions can implement an ExternalUriOpener to open http links to a webserver inside of the editor instead of having the link be opened by the web browser.

    Currently openers may only be registered for http and https uris.

    interface ExternalUriOpener {
        canOpenExternalUri(
            uri: Uri,
            token: CancellationToken,
        ): ExternalUriOpenerPriority | Thenable<ExternalUriOpenerPriority>;
        openExternalUri(
            resolvedUri: Uri,
            ctx: OpenExternalUriContext,
            token: CancellationToken,
        ): void | Thenable<void>;
    }
    Index

    Methods

    • Open a uri.

      This is invoked when:

      • The user clicks a link which does not have an assigned opener. In this case, first canOpenExternalUri is called and if the user selects this opener, then openExternalUri is called.
      • The user sets the default opener for a link in their settings and then visits a link.

      Parameters

      • resolvedUri: Uri

        The uri to open. This uri may have been transformed by port forwarding, so it may not match the original uri passed to canOpenExternalUri. Use ctx.originalUri to check the original uri.

      • ctx: OpenExternalUriContext

        Additional information about the uri being opened.

      • token: CancellationToken

        Cancellation token indicating that opening has been canceled.

      Returns void | Thenable<void>

      Thenable indicating that the opening has completed.