Skip to content

Commit

Permalink
debug: fix repl completions and disposable leak (#241776)
Browse files Browse the repository at this point in the history
  • Loading branch information
connor4312 authored Feb 24, 2025
1 parent 45f744a commit 0ff9bfd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/vs/workbench/api/browser/mainThreadDebugService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,12 @@ export class MainThreadDebugService implements MainThreadDebugServiceShape, IDeb
}

$registerDebugVisualizerTree(treeId: string, canEdit: boolean): void {
this.visualizerService.registerTree(treeId, {
this._visualizerTreeHandles.set(treeId, this.visualizerService.registerTree(treeId, {
disposeItem: id => this._proxy.$disposeVisualizedTree(id),
getChildren: e => this._proxy.$getVisualizerTreeItemChildren(treeId, e),
getTreeItem: e => this._proxy.$getVisualizerTreeItem(treeId, e),
editItem: canEdit ? ((e, v) => this._proxy.$editVisualizerTreeItem(e, v)) : undefined
});
}));
}

$unregisterDebugVisualizerTree(treeId: string): void {
Expand Down
6 changes: 1 addition & 5 deletions src/vs/workbench/contrib/debug/browser/repl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -173,9 +173,7 @@ export class Repl extends FilterViewPane implements IHistoryNavigationWidget {
}

this._register(this.debugService.getViewModel().onDidFocusSession(session => {
if (this.isVisible()) {
this.onDidFocusSession(session);
}
this.onDidFocusSession(session);
}));
this._register(this.debugService.getViewModel().onDidEvaluateLazyExpression(async e => {
if (e instanceof Variable && this.tree?.hasNode(e)) {
Expand Down Expand Up @@ -213,8 +211,6 @@ export class Repl extends FilterViewPane implements IHistoryNavigationWidget {
const focusedSession = this.debugService.getViewModel().focusedSession;
if (this.tree && this.tree.getInput() !== focusedSession) {
this.onDidFocusSession(focusedSession);
} else {
this.selectSession();
}

this.setMode();
Expand Down

0 comments on commit 0ff9bfd

Please sign in to comment.