mirror of
https://github.com/microsoft/vscode.git
synced 2026-07-10 16:58:55 -05:00
fixes #42626
This commit is contained in:
@@ -153,7 +153,7 @@ export class FileStat implements IFileStat {
|
||||
* exists locally.
|
||||
*/
|
||||
public static mergeLocalWithDisk(disk: FileStat, local: FileStat): void {
|
||||
if (!disk || !local || disk.resource.toString() !== local.resource.toString()) {
|
||||
if (disk.resource.toString() !== local.resource.toString()) {
|
||||
return; // Merging only supported for stats with the same resource
|
||||
}
|
||||
|
||||
|
||||
@@ -798,7 +798,11 @@ export class ExplorerView extends TreeViewsViewletPanel implements IExplorerView
|
||||
return errorFileStat(targetsToResolve[index].resource, targetsToResolve[index].root);
|
||||
});
|
||||
// Subsequent refresh: Merge stat into our local model and refresh tree
|
||||
modelStats.forEach((modelStat, index) => FileStat.mergeLocalWithDisk(modelStat, this.model.roots[index]));
|
||||
modelStats.forEach((modelStat, index) => {
|
||||
if (index < this.model.roots.length) {
|
||||
FileStat.mergeLocalWithDisk(modelStat, this.model.roots[index]);
|
||||
}
|
||||
});
|
||||
|
||||
const statsToExpand: FileStat[] = this.explorerViewer.getExpandedElements().concat(targetsToExpand.map(expand => this.model.findClosest(expand)));
|
||||
if (input === this.explorerViewer.getInput()) {
|
||||
@@ -817,7 +821,9 @@ export class ExplorerView extends TreeViewsViewletPanel implements IExplorerView
|
||||
.then(result => FileStat.create(result, target.root, target.options.resolveTo), err => errorFileStat(target.resource, target.root))
|
||||
.then(modelStat => {
|
||||
// Subsequent refresh: Merge stat into our local model and refresh tree
|
||||
FileStat.mergeLocalWithDisk(modelStat, this.model.roots[index]);
|
||||
if (index < this.model.roots.length) {
|
||||
FileStat.mergeLocalWithDisk(modelStat, this.model.roots[index]);
|
||||
}
|
||||
|
||||
let toExpand: FileStat[] = this.explorerViewer.getExpandedElements().concat(targetsToExpand.map(target => this.model.findClosest(target)));
|
||||
if (input === this.explorerViewer.getInput()) {
|
||||
|
||||
Reference in New Issue
Block a user