Adds scm action button

Refs: #110882
This commit is contained in:
Eric Amodio
2021-09-27 01:01:00 -04:00
parent 53c5d3cb4a
commit 55c726b53e
10 changed files with 214 additions and 13 deletions

View File

@@ -509,6 +509,19 @@ class ExtHostSourceControl implements vscode.SourceControl {
this._proxy.$updateSourceControl(this.handle, { acceptInputCommand: internal });
}
private _actionButtonDisposables = new MutableDisposable<DisposableStore>();
private _actionButton: vscode.Command | undefined;
get actionButton(): vscode.Command | undefined { return this._actionButton; }
set actionButton(actionButton: vscode.Command | undefined) {
this._actionButtonDisposables.value = new DisposableStore();
this._actionButton = actionButton;
const internal = actionButton !== undefined ? this._commands.converter.toInternal(this._actionButton, this._actionButtonDisposables.value) : undefined;
this._proxy.$updateSourceControl(this.handle, { actionButton: internal ?? null });
}
private _statusBarDisposables = new MutableDisposable<DisposableStore>();
private _statusBarCommands: vscode.Command[] | undefined = undefined;
@@ -630,6 +643,7 @@ class ExtHostSourceControl implements vscode.SourceControl {
dispose(): void {
this._acceptInputDisposables.dispose();
this._actionButtonDisposables.dispose();
this._statusBarDisposables.dispose();
this._groups.forEach(group => group.dispose());