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

Catch any errors from update and rebuild the tab model #175687

Merged
merged 2 commits into from
Feb 28, 2023
Merged
Changes from 1 commit
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
9 changes: 8 additions & 1 deletion src/vs/workbench/api/browser/mainThreadEditorTabs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,14 @@ export class MainThreadEditorTabs implements MainThreadEditorTabsShape {
this._proxy = extHostContext.getProxy(ExtHostContext.ExtHostEditorTabs);

// Main listener which responds to events from the editor service
this._dispoables.add(editorService.onDidEditorsChange((event) => this._updateTabsModel(event)));
this._dispoables.add(editorService.onDidEditorsChange((event) => {
try {
this._updateTabsModel(event);
} catch {
console.error('Failed to update model, rebuilding');
lramos15 marked this conversation as resolved.
Show resolved Hide resolved
this._createTabsModel();
}
}));

// Structural group changes (add, remove, move, etc) are difficult to patch.
// Since they happen infrequently we just rebuild the entire model
Expand Down