Skip to content

Commit

Permalink
Move link handlers back to proposed
Browse files Browse the repository at this point in the history
Part of #91606
  • Loading branch information
Tyriar committed Apr 20, 2020
1 parent 5c7b6f5 commit 5578ead
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 23 deletions.
23 changes: 0 additions & 23 deletions src/vs/vscode.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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<boolean>;
}

/**
* A location in the editor at which progress information can be shown. It depends on the
* location how progress is visually represented.
Expand Down
31 changes: 31 additions & 0 deletions src/vs/vscode.proposed.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<boolean>;
}

//#endregion

//#region Contribute to terminal environment https://github.com/microsoft/vscode/issues/46696

export enum EnvironmentVariableMutatorType {
Expand Down
1 change: 1 addition & 0 deletions src/vs/workbench/api/common/extHost.api.impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<any>): vscode.Disposable {
Expand Down

0 comments on commit 5578ead

Please sign in to comment.