Add intellisense for onOpenExternalUri activation and rename event

Fixes #115131

Also renames the activation event to `onOpenExternalUri`
This commit is contained in:
Matt Bierner 2021-02-01 19:57:54 -08:00
parent 7d5052f508
commit d9ff550d02
4 changed files with 9 additions and 4 deletions

View file

@ -19,8 +19,8 @@
"activationEvents": [
"onCommand:simpleBrowser.show",
"onCommand:simpleBrowser.api.open",
"onUriOpen:http",
"onUriOpen:https"
"onOpenExternalUri:http",
"onOpenExternalUri:https"
],
"contributes": {
"commands": [

View file

@ -2623,7 +2623,7 @@ declare module 'vscode' {
/**
* Register a new `ExternalUriOpener`.
*
* When a uri is about to be opened, an `onUriOpen:SCHEME` activation event is fired.
* When a uri is about to be opened, an `onOpenExternalUri:SCHEME` activation event is fired.
*
* @param id Unique id of the opener, such as `myExtension.browserPreview`. This is used in settings
* and commands to identify the opener.

View file

@ -56,7 +56,7 @@ export class MainThreadUriOpeners extends Disposable implements MainThreadUriOpe
return;
}
await this.extensionService.activateByEvent(`onUriOpen:${targetUri.scheme}`);
await this.extensionService.activateByEvent(`onOpenExternalUri:${targetUri.scheme}`);
for (const [id, openerMetadata] of this._registeredOpeners) {
if (openerMetadata.schemes.has(targetUri.scheme)) {

View file

@ -300,6 +300,11 @@ export const schema: IJSONSchema = {
body: 'onUri',
description: nls.localize('vscode.extension.activationEvents.onUri', 'An activation event emitted whenever a system-wide Uri directed towards this extension is open.'),
},
{
label: 'onOpenExternalUri',
body: 'onOpenExternalUri',
description: nls.localize('vscode.extension.activationEvents.onOpenExternalUri', 'An activation event emitted whenever a external uri (such as an http or https link) is being opened.'),
},
{
label: 'onCustomEditor',
body: 'onCustomEditor:${9:viewType}',