🐛 remove the notion of active scm provider

introduces more changes to the SCM api

fixes #23623
fixes #23676
This commit is contained in:
Joao Moreno
2017-03-30 21:10:34 +02:00
parent ce46000fe6
commit a8b2945855
13 changed files with 253 additions and 96 deletions

View File

@@ -78,6 +78,13 @@ class MainThreadSCMProvider implements ISCMProvider {
get label(): string { return this._label; }
get contextKey(): string { return this._id; }
get commitTemplate(): string | undefined { return this.features.commitTemplate; }
get acceptInputCommand(): Command | undefined { return this.features.acceptInputCommand; }
get statusBarCommands(): Command[] | undefined { return this.features.statusBarCommands; }
private _onDidChangeCommitTemplate = new Emitter<string>();
get onDidChangeCommitTemplate(): Event<string> { return this._onDidChangeCommitTemplate.event; }
private _count: number | undefined = undefined;
get count(): number | undefined { return this._count; }
@@ -93,6 +100,10 @@ class MainThreadSCMProvider implements ISCMProvider {
$updateSourceControl(features: SCMProviderFeatures): void {
this.features = assign(this.features, features);
this._onDidChange.fire();
if (typeof features.commitTemplate !== 'undefined') {
this._onDidChangeCommitTemplate.fire(this.commitTemplate);
}
}
$registerGroup(handle: number, id: string, label: string): void {
@@ -194,7 +205,6 @@ export class MainThreadSCM extends MainThreadSCMShape {
this.scmService.onDidChangeProvider(this.onDidChangeProvider, this, this._disposables);
this.scmService.input.onDidChange(this._proxy.$onInputBoxValueChange, this._proxy, this._disposables);
this.scmService.input.onDidAccept(this._proxy.$onInputBoxAcceptChanges, this._proxy, this._disposables);
}
$registerSourceControl(handle: number, id: string, label: string): void {