mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-26 19:44:25 +01:00
💄 SourceControlInputBox.visible API
This commit is contained in:
@@ -535,7 +535,6 @@ export interface SCMProviderFeatures {
|
||||
commitTemplate?: string;
|
||||
acceptInputCommand?: modes.Command;
|
||||
statusBarCommands?: modes.Command[];
|
||||
hideInputBox?: boolean;
|
||||
}
|
||||
|
||||
export interface SCMGroupFeatures {
|
||||
@@ -580,6 +579,7 @@ export interface MainThreadSCMShape extends IDisposable {
|
||||
|
||||
$setInputBoxValue(sourceControlHandle: number, value: string): void;
|
||||
$setInputBoxPlaceholder(sourceControlHandle: number, placeholder: string): void;
|
||||
$setInputBoxVisibility(sourceControlHandle: number, visible: boolean): void;
|
||||
$setValidationProviderIsEnabled(sourceControlHandle: number, enabled: boolean): void;
|
||||
}
|
||||
|
||||
|
||||
@@ -198,6 +198,18 @@ export class ExtHostSCMInputBox implements vscode.SourceControlInputBox {
|
||||
this._proxy.$setValidationProviderIsEnabled(this._sourceControlHandle, !!fn);
|
||||
}
|
||||
|
||||
private _visible: boolean = true;
|
||||
|
||||
get visible(): boolean {
|
||||
return this._visible;
|
||||
}
|
||||
|
||||
set visible(visible: boolean | undefined) {
|
||||
visible = !!visible;
|
||||
this._visible = visible;
|
||||
this._proxy.$setInputBoxVisibility(this._sourceControlHandle, visible);
|
||||
}
|
||||
|
||||
constructor(private _extension: IExtensionDescription, private _proxy: MainThreadSCMShape, private _sourceControlHandle: number) {
|
||||
// noop
|
||||
}
|
||||
@@ -439,17 +451,6 @@ class ExtHostSourceControl implements vscode.SourceControl {
|
||||
return this._selected;
|
||||
}
|
||||
|
||||
private _hideInputBox: boolean = false;
|
||||
|
||||
get hideInputBox(): boolean {
|
||||
return this._hideInputBox;
|
||||
}
|
||||
|
||||
set hideInputBox(hideInputBox: boolean | undefined) {
|
||||
this._hideInputBox = hideInputBox;
|
||||
this._proxy.$updateSourceControl(this.handle, { hideInputBox: !!hideInputBox });
|
||||
}
|
||||
|
||||
private _onDidChangeSelection = new Emitter<boolean>();
|
||||
readonly onDidChangeSelection = this._onDidChangeSelection.event;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user