Merge pull request #126053 from microsoft/tyriar/126040

Convert TerminalLink to class, add TerminalProfile validation
This commit is contained in:
Daniel Imms
2021-06-15 03:50:23 -07:00
committed by GitHub
3 changed files with 39 additions and 1 deletions

View File

@@ -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,

View File

@@ -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' || startIndex < 0) {
throw illegalArgument('startIndex');
}
if (typeof length !== 'number' || length < 1) {
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');
}
}
}