Skip to content

Commit

Permalink
Fix tree error from telemetry (#155719)
Browse files Browse the repository at this point in the history
Fixes #155496
  • Loading branch information
alexr00 committed Jul 20, 2022
1 parent e88e580 commit 3d12b57
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions src/vs/workbench/browser/parts/views/treeView.ts
Expand Up @@ -226,7 +226,8 @@ abstract class AbstractTreeView extends Disposable implements ITreeView {
@IViewDescriptorService private readonly viewDescriptorService: IViewDescriptorService,
@IHoverService private readonly hoverService: IHoverService,
@IContextKeyService contextKeyService: IContextKeyService,
@IActivityService private readonly activityService: IActivityService
@IActivityService private readonly activityService: IActivityService,
@ILogService private readonly logService: ILogService
) {
super();
this.root = new Root();
Expand Down Expand Up @@ -799,7 +800,14 @@ abstract class AbstractTreeView extends Disposable implements ITreeView {
const tree = this.tree;
if (tree && this.visible) {
this.refreshing = true;
await Promise.all(elements.map(element => tree.updateChildren(element, true, true)));
try {
await Promise.all(elements.map(element => tree.updateChildren(element, true, true)));
} catch (e) {
// When multiple calls are made to refresh the tree in quick succession,
// we can get a "Tree element not found" error. This is expected.
// Ideally this is fixable, so log instead of ignoring so the error is preserved.
this.logService.error(e);
}
this.refreshing = false;
this._onDidCompleteRefresh.fire();
this.updateContentAreas();
Expand Down Expand Up @@ -1283,9 +1291,10 @@ export class CustomTreeView extends AbstractTreeView {
@IHoverService hoverService: IHoverService,
@IExtensionService private readonly extensionService: IExtensionService,
@IActivityService activityService: IActivityService,
@ITelemetryService private readonly telemetryService: ITelemetryService
@ITelemetryService private readonly telemetryService: ITelemetryService,
@ILogService logService: ILogService,
) {
super(id, title, themeService, instantiationService, commandService, configurationService, progressService, contextMenuService, keybindingService, notificationService, viewDescriptorService, hoverService, contextKeyService, activityService);
super(id, title, themeService, instantiationService, commandService, configurationService, progressService, contextMenuService, keybindingService, notificationService, viewDescriptorService, hoverService, contextKeyService, activityService, logService);
}

protected activate() {
Expand Down

0 comments on commit 3d12b57

Please sign in to comment.