Skip to content

Commit 74ea30b

Browse files
committed
Finalize registerTerminalLinkHandler API
Fixes microsoft#91606
1 parent 7ca8791 commit 74ea30b

3 files changed

Lines changed: 17 additions & 23 deletions

File tree

src/vs/vscode.d.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7622,6 +7622,13 @@ declare module 'vscode' {
76227622
*/
76237623
export function createTerminal(options: ExtensionTerminalOptions): Terminal;
76247624

7625+
/**
7626+
* Register a [TerminalLinkHandler](#TerminalLinkHandler) that can be used to intercept and
7627+
* handle links that are activated within terminals.
7628+
* @param handler The link handler being registered.
7629+
*/
7630+
export function registerTerminalLinkHandler(handler: TerminalLinkHandler): Disposable;
7631+
76257632
/**
76267633
* Register a [TreeDataProvider](#TreeDataProvider) for the view contributed using the extension point `views`.
76277634
* This will allow you to contribute data to the [TreeView](#TreeView) and update if the data changes.
@@ -8182,6 +8189,16 @@ declare module 'vscode' {
81828189
readonly code: number | undefined;
81838190
}
81848191

8192+
export interface TerminalLinkHandler {
8193+
/**
8194+
* Handles a link that is activated within the terminal.
8195+
*
8196+
* @return Whether the link was handled, if the link was handled this link will not be
8197+
* considered by any other extension or by the default built-in link handler.
8198+
*/
8199+
handleLink(terminal: Terminal, link: string): ProviderResult<boolean>;
8200+
}
8201+
81858202
/**
81868203
* A location in the editor at which progress information can be shown. It depends on the
81878204
* location how progress is visually represented.

src/vs/vscode.proposed.d.ts

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -895,28 +895,6 @@ declare module 'vscode' {
895895

896896
//#endregion
897897

898-
//#region Terminal link handlers https://github.com/microsoft/vscode/issues/91606
899-
900-
export namespace window {
901-
/**
902-
* Register a [TerminalLinkHandler](#TerminalLinkHandler) that can be used to intercept and
903-
* handle links that are activated within terminals.
904-
*/
905-
export function registerTerminalLinkHandler(handler: TerminalLinkHandler): Disposable;
906-
}
907-
908-
export interface TerminalLinkHandler {
909-
/**
910-
* Handles a link that is activated within the terminal.
911-
*
912-
* @return Whether the link was handled, if the link was handled this link will not be
913-
* considered by any other extension or by the default built-in link handler.
914-
*/
915-
handleLink(terminal: Terminal, link: string): ProviderResult<boolean>;
916-
}
917-
918-
//#endregion
919-
920898
//#region Contribute to terminal environment https://github.com/microsoft/vscode/issues/46696
921899

922900
export enum EnvironmentVariableMutatorType {

src/vs/workbench/api/common/extHost.api.impl.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -570,7 +570,6 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I
570570
return extHostTerminalService.createTerminal(nameOrOptions, shellPath, shellArgs);
571571
},
572572
registerTerminalLinkHandler(handler: vscode.TerminalLinkHandler): vscode.Disposable {
573-
checkProposedApiEnabled(extension);
574573
return extHostTerminalService.registerLinkHandler(handler);
575574
},
576575
registerTreeDataProvider(viewId: string, treeDataProvider: vscode.TreeDataProvider<any>): vscode.Disposable {

0 commit comments

Comments
 (0)