Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix tree error from telemetry #155719

Merged
merged 1 commit into from Jul 20, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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