diff --git a/src/vs/vscode.d.ts b/src/vs/vscode.d.ts index 864f4f44386..3c08b54bce1 100644 --- a/src/vs/vscode.d.ts +++ b/src/vs/vscode.d.ts @@ -5792,7 +5792,7 @@ declare module 'vscode' { /** * A link on a terminal line. */ - export interface TerminalLink { + export class TerminalLink { /** * The start index of the link on {@link TerminalLinkContext.line}. */ @@ -5811,6 +5811,8 @@ declare module 'vscode' { * depending on OS, user settings, and localization. */ tooltip?: string; + + constructor(startIndex: number, length: number, tooltip?: string); } /** diff --git a/src/vs/workbench/api/common/extHost.api.impl.ts b/src/vs/workbench/api/common/extHost.api.impl.ts index f24fc12689f..4a905aa1602 100644 --- a/src/vs/workbench/api/common/extHost.api.impl.ts +++ b/src/vs/workbench/api/common/extHost.api.impl.ts @@ -1252,6 +1252,7 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I TaskPanelKind: extHostTypes.TaskPanelKind, TaskRevealKind: extHostTypes.TaskRevealKind, TaskScope: extHostTypes.TaskScope, + TerminalLink: extHostTypes.TerminalLink, TerminalProfile: extHostTypes.TerminalProfile, TextDocumentSaveReason: extHostTypes.TextDocumentSaveReason, TextEdit: extHostTypes.TextEdit, diff --git a/src/vs/workbench/api/common/extHostTypes.ts b/src/vs/workbench/api/common/extHostTypes.ts index 0e7a67b314e..2ed9688c95d 100644 --- a/src/vs/workbench/api/common/extHostTypes.ts +++ b/src/vs/workbench/api/common/extHostTypes.ts @@ -1707,10 +1707,31 @@ export enum SourceControlInputBoxValidationType { Information = 2 } +export class TerminalLink implements vscode.TerminalLink { + constructor( + public startIndex: number, + public length: number, + public tooltip?: string + ) { + if (typeof startIndex !== 'number') { + throw illegalArgument('startIndex'); + } + if (typeof length !== 'number') { + throw illegalArgument('length'); + } + if (tooltip !== undefined && typeof tooltip !== 'string') { + throw illegalArgument('tooltip'); + } + } +} + export class TerminalProfile implements vscode.TerminalProfile { constructor( public options: vscode.TerminalOptions | vscode.ExtensionTerminalOptions ) { + if (typeof options !== 'object') { + illegalArgument('options'); + } } }