mirror of
https://github.com/microsoft/vscode.git
synced 2026-09-03 16:15:28 +01:00
debug: only change call stack input when thread count changes
fixes #5784
This commit is contained in:
@@ -273,9 +273,7 @@ export class CallStackView extends viewlet.CollapsibleViewletView {
|
||||
|
||||
const model = this.debugService.getModel();
|
||||
this.toDispose.push(model.onDidChangeCallStack(() => {
|
||||
const threads = model.getThreads();
|
||||
const threadsArray = Object.keys(threads).map(ref => threads[ref]);
|
||||
this.tree.setInput(threadsArray.length === 1 ? threadsArray[0] : model).done(() => {
|
||||
this.updateTree(model).done(() => {
|
||||
const focussedThread = model.getThreads()[this.debugService.getViewModel().getFocusedThreadId()];
|
||||
if (!focussedThread) {
|
||||
this.pauseMessage.hide();
|
||||
@@ -299,6 +297,15 @@ export class CallStackView extends viewlet.CollapsibleViewletView {
|
||||
}));
|
||||
}
|
||||
|
||||
private updateTree(model: debug.IModel): TPromise<void> {
|
||||
const threads = model.getThreads();
|
||||
const threadsArray = Object.keys(threads).map(ref => threads[ref]);
|
||||
// Only show the threads in the call stack if there is more than 1 thread.
|
||||
const newTreeInput = threadsArray.length === 1 ? threadsArray[0] : model;
|
||||
|
||||
return this.tree.getInput() === newTreeInput ? this.tree.refresh() : this.tree.setInput(newTreeInput);
|
||||
}
|
||||
|
||||
public shutdown(): void {
|
||||
this.settings[CallStackView.MEMENTO] = (this.state === splitview.CollapsibleState.COLLAPSED);
|
||||
super.shutdown();
|
||||
|
||||
Reference in New Issue
Block a user