diff --git a/src/vs/vscode.d.ts b/src/vs/vscode.d.ts index 2f041c2b29f..d15d2856ad6 100644 --- a/src/vs/vscode.d.ts +++ b/src/vs/vscode.d.ts @@ -7656,14 +7656,6 @@ declare module 'vscode' { */ export function createTerminal(options: ExtensionTerminalOptions): Terminal; - /** - * Register a [TerminalLinkHandler](#TerminalLinkHandler) that can be used to intercept and - * handle links that are activated within terminals. - * @param handler The link handler being registered. - * @return A disposable that unregisters the link handler. - */ - export function registerTerminalLinkHandler(handler: TerminalLinkHandler): Disposable; - /** * Register a [TreeDataProvider](#TreeDataProvider) for the view contributed using the extension point `views`. * This will allow you to contribute data to the [TreeView](#TreeView) and update if the data changes. @@ -8224,21 +8216,6 @@ declare module 'vscode' { readonly code: number | undefined; } - /** - * Describes how to handle terminal links. - */ - export interface TerminalLinkHandler { - /** - * Handles a link that is activated within the terminal. - * - * @param terminal The terminal the link was activated on. - * @param link The text of the link activated. - * @return Whether the link was handled, if the link was handled this link will not be - * considered by any other extension or by the default built-in link handler. - */ - handleLink(terminal: Terminal, link: string): ProviderResult; - } - /** * A location in the editor at which progress information can be shown. It depends on the * location how progress is visually represented. diff --git a/src/vs/vscode.proposed.d.ts b/src/vs/vscode.proposed.d.ts index 66297865982..a91b77cdcd5 100644 --- a/src/vs/vscode.proposed.d.ts +++ b/src/vs/vscode.proposed.d.ts @@ -880,6 +880,37 @@ declare module 'vscode' { //#endregion + + + //#region Terminal link handlers https://github.com/microsoft/vscode/issues/91606 + + export namespace window { + /** + * Register a [TerminalLinkHandler](#TerminalLinkHandler) that can be used to intercept and + * handle links that are activated within terminals. + * @param handler The link handler being registered. + * @return A disposable that unregisters the link handler. + */ + export function registerTerminalLinkHandler(handler: TerminalLinkHandler): Disposable; + } + + /** + * Describes how to handle terminal links. + */ + export interface TerminalLinkHandler { + /** + * Handles a link that is activated within the terminal. + * + * @param terminal The terminal the link was activated on. + * @param link The text of the link activated. + * @return Whether the link was handled, if the link was handled this link will not be + * considered by any other extension or by the default built-in link handler. + */ + handleLink(terminal: Terminal, link: string): ProviderResult; + } + + //#endregion + //#region Contribute to terminal environment https://github.com/microsoft/vscode/issues/46696 export enum EnvironmentVariableMutatorType { diff --git a/src/vs/workbench/api/common/extHost.api.impl.ts b/src/vs/workbench/api/common/extHost.api.impl.ts index 24801aeab21..37cfd826110 100644 --- a/src/vs/workbench/api/common/extHost.api.impl.ts +++ b/src/vs/workbench/api/common/extHost.api.impl.ts @@ -570,6 +570,7 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I return extHostTerminalService.createTerminal(nameOrOptions, shellPath, shellArgs); }, registerTerminalLinkHandler(handler: vscode.TerminalLinkHandler): vscode.Disposable { + checkProposedApiEnabled(extension); return extHostTerminalService.registerLinkHandler(handler); }, registerTreeDataProvider(viewId: string, treeDataProvider: vscode.TreeDataProvider): vscode.Disposable {