mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-25 19:18:59 +01:00
Merge pull request #25983 from ihalip/scm-resourcegroup-label
Allow changing a SourceControlResourceGroup's label
This commit is contained in:
@@ -297,6 +297,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(); }
|
||||
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user