Skip to content

Commit 08bb5a1

Browse files
committed
use toInternal2
related to microsoft#74846
1 parent 4e7545b commit 08bb5a1

1 file changed

Lines changed: 12 additions & 3 deletions

File tree

src/vs/workbench/api/common/extHostSCM.ts

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import { URI, UriComponents } from 'vs/base/common/uri';
77
import { Event, Emitter } from 'vs/base/common/event';
88
import { debounce } from 'vs/base/common/decorators';
9-
import { dispose, IDisposable } from 'vs/base/common/lifecycle';
9+
import { dispose, IDisposable, DisposableStore, MutableDisposable } from 'vs/base/common/lifecycle';
1010
import { asPromise } from 'vs/base/common/async';
1111
import { ExtHostCommands } from 'vs/workbench/api/common/extHostCommands';
1212
import { MainContext, MainThreadSCMShape, SCMRawResource, SCMRawResourceSplice, SCMRawResourceSplices, IMainContext, ExtHostSCMShape, CommandDto } from './extHost.protocol';
@@ -415,19 +415,23 @@ class ExtHostSourceControl implements vscode.SourceControl {
415415
this._proxy.$updateSourceControl(this.handle, { commitTemplate });
416416
}
417417

418+
private _acceptInputDisposables = new MutableDisposable<DisposableStore>();
418419
private _acceptInputCommand: vscode.Command | undefined = undefined;
419420

420421
get acceptInputCommand(): vscode.Command | undefined {
421422
return this._acceptInputCommand;
422423
}
423424

424425
set acceptInputCommand(acceptInputCommand: vscode.Command | undefined) {
426+
this._acceptInputDisposables.value = new DisposableStore();
427+
425428
this._acceptInputCommand = acceptInputCommand;
426429

427-
const internal = this._commands.converter.toInternal(acceptInputCommand);
430+
const internal = this._commands.converter.toInternal2(acceptInputCommand, this._acceptInputDisposables.value);
428431
this._proxy.$updateSourceControl(this.handle, { acceptInputCommand: internal });
429432
}
430433

434+
private _statusBarDisposables = new MutableDisposable<DisposableStore>();
431435
private _statusBarCommands: vscode.Command[] | undefined = undefined;
432436

433437
get statusBarCommands(): vscode.Command[] | undefined {
@@ -439,9 +443,11 @@ class ExtHostSourceControl implements vscode.SourceControl {
439443
return;
440444
}
441445

446+
this._statusBarDisposables.value = new DisposableStore();
447+
442448
this._statusBarCommands = statusBarCommands;
443449

444-
const internal = (statusBarCommands || []).map(c => this._commands.converter.toInternal(c)) as CommandDto[];
450+
const internal = (statusBarCommands || []).map(c => this._commands.converter.toInternal2(c, this._statusBarDisposables.value!)) as CommandDto[];
445451
this._proxy.$updateSourceControl(this.handle, { statusBarCommands: internal });
446452
}
447453

@@ -519,6 +525,9 @@ class ExtHostSourceControl implements vscode.SourceControl {
519525
}
520526

521527
dispose(): void {
528+
this._acceptInputDisposables.dispose();
529+
this._statusBarDisposables.dispose();
530+
522531
this._groups.forEach(group => group.dispose());
523532
this._proxy.$unregisterSourceControl(this.handle);
524533
}

0 commit comments

Comments
 (0)