359
this.#proxy.$setInputBoxVisibility(this._sourceControlHandle, visible);
360
}
362
>
get document(): vscode.TextDocument {
363
checkProposedApiEnabled(this._extension, 'scmTextDocument');
364
365
return this.#extHostDocuments.getDocument(this._documentUri);
366
}
368
>
constructor(private _extension: IExtensionDescription, _extHostDocuments: ExtHostDocuments, proxy: MainThreadSCMShape, private _sourceControlHandle: number, private _documentUri: URI) {
369
>
this.#extHostDocuments = _extHostDocuments;
370
>
this.#proxy = proxy;
371
>
}
372
>
373
>
showValidationMessage(message: string | vscode.MarkdownString, type: vscode.SourceControlInputBoxValidationType) {
374
checkProposedApiEnabled(this._extension, 'scmValidation');
375
this.#proxy.$showValidationMessage(this._sourceControlHandle, message, SourceControlInputBoxValidationType.from(type));
376
}
378
>
$onInputBoxValueChange(value: string): void {
379
this.updateValue(value);
380
}
382
>
private updateValue(value: string): void {
383
this._value = value;
384
this._onDidChange.fire(value);
385
}
387
>
388
>
class ExtHostSourceControlResourceGroup implements vscode.SourceControlResourceGroup {
389
>
390
>
private static _handlePool: number = 0;
391
>
private _resourceHandlePool: number = 0;
392
>
private _resourceStates: vscode.SourceControlResourceState[] = [];
393
>
394
>
private _resourceStatesMap = new Map<ResourceStateHandle, vscode.SourceControlResourceState>();
395
>
private _resourceStatesCommandsMap = new Map<ResourceStateHandle, vscode.Command>();
396
>
private _resourceStatesDisposablesMap = new Map<ResourceStateHandle, IDisposable>();
397
>
398
>
private readonly _onDidUpdateResourceStates = new Emitter<void>();
399
>
readonly onDidUpdateResourceStates = this._onDidUpdateResourceStates.event;
400
>
401
>
private _disposed = false;
402
>
get disposed(): boolean { return this._disposed; }
403
>
private readonly _onDidDispose = new Emitter<void>();
404
>
readonly onDidDispose = this._onDidDispose.event;
405
>
406
>
private _handlesSnapshot: number[] = [];
407
>
private _resourceSnapshot: vscode.SourceControlResourceState[] = [];
408
>
409
>
get id(): string { return this._id; }
410
>
411
>
get label(): string { return this._label; }
412
>
set label(label: string) {
413
this._label = label;
414
this._proxy.$updateGroupLabel(this._sourceControlHandle, this.handle, label);
415
}
417
>
private _contextValue: string | undefined = undefined;
418
>
get contextValue(): string | undefined {
419
return this._contextValue;
420
}
421
>
set contextValue(contextValue: string | undefined) {
extHostSCM.ts
422
this._contextValue = contextValue;
423
this._proxy.$updateGroup(this._sourceControlHandle, this.handle, this.features);
424
}
426
>
private _hideWhenEmpty: boolean | undefined = undefined;
427
>
get hideWhenEmpty(): boolean | undefined { return this._hideWhenEmpty; }
428
>
set hideWhenEmpty(hideWhenEmpty: boolean | undefined) {
429
this._hideWhenEmpty = hideWhenEmpty;
430
this._proxy.$updateGroup(this._sourceControlHandle, this.handle, this.features);
431
}
433
>
get features(): SCMGroupFeatures {
434
return {
435
contextValue: this.contextValue,