mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-24 02:28:34 +01:00
scm: don't send events if nothing has changed
This commit is contained in:
@@ -310,12 +310,22 @@ class ExtHostSourceControl implements vscode.SourceControl {
|
||||
|
||||
@debounce(100)
|
||||
eventuallyUpdateResourceStates(): void {
|
||||
const resources: SCMRawResourceSplices[] = [];
|
||||
const splices: SCMRawResourceSplices[] = [];
|
||||
|
||||
this.updatedResourceGroups
|
||||
.forEach(group => resources.push([group.handle, group._snapshot()]));
|
||||
this.updatedResourceGroups.forEach(group => {
|
||||
const snapshot = group._snapshot();
|
||||
|
||||
if (snapshot.length === 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
splices.push([group.handle, snapshot]);
|
||||
});
|
||||
|
||||
if (splices.length > 0) {
|
||||
this._proxy.$spliceResourceStates(this.handle, splices);
|
||||
}
|
||||
|
||||
this._proxy.$spliceResourceStates(this.handle, resources);
|
||||
this.updatedResourceGroups.clear();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user