mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-26 11:38:51 +01:00
Merge pull request #126053 from microsoft/tyriar/126040
Convert TerminalLink to class, add TerminalProfile validation
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user