make it possible to change a SCMResourceGroup's label

This commit is contained in:
Ilie Halip
2017-05-05 08:36:40 +03:00
parent 76ec19f240
commit 4fce360efb
4 changed files with 28 additions and 1 deletions

View File

@@ -295,6 +295,7 @@ export abstract class MainThreadSCMShape {
$registerGroup(sourceControlHandle: number, handle: number, id: string, label: string): void { throw ni(); }
$updateGroup(sourceControlHandle: number, handle: number, features: SCMGroupFeatures): void { throw ni(); }
$updateGroupLabel(sourceControlHandle: number, handle: number, label: string): void { throw ni(); }
$updateGroupResourceStates(sourceControlHandle: number, groupHandle: number, resources: SCMRawResource[]): void { throw ni(); }
$unregisterGroup(sourceControlHandle: number, handle: number): void { throw ni(); }

View File

@@ -81,6 +81,11 @@ class ExtHostSourceControlResourceGroup implements vscode.SourceControlResourceG
return this._label;
}
set label(label: string) {
this._label = label;
this._proxy.$updateGroupLabel(this._sourceControlHandle, this._handle, label);
}
private _hideWhenEmpty: boolean | undefined = undefined;
get hideWhenEmpty(): boolean | undefined {

View File

@@ -137,6 +137,17 @@ class MainThreadSCMProvider implements ISCMProvider {
this._onDidChange.fire();
}
$updateGroupLabel(handle: number, label: string): void {
const group = this._groupsByHandle[handle];
if (!group) {
return;
}
group.label = label;
this._onDidChange.fire();
}
$updateGroupResourceStates(groupHandle: number, resources: SCMRawResource[]): void {
const group = this._groupsByHandle[groupHandle];
@@ -263,6 +274,16 @@ export class MainThreadSCM extends MainThreadSCMShape {
provider.$updateGroup(groupHandle, features);
}
$updateGroupLabel(sourceControlHandle: number, groupHandle: number, label: string): void {
const provider = this._sourceControls[sourceControlHandle];
if (!provider) {
return;
}
provider.$updateGroupLabel(groupHandle, label);
}
$updateGroupResourceStates(sourceControlHandle: number, groupHandle: number, resources: SCMRawResource[]): void {
const provider = this._sourceControls[sourceControlHandle];