提交 8601a848 编写于 作者: I isidor

debug: select foccused stack frame on call stack change

fixes #4519
上级 a6bbbf58
......@@ -276,28 +276,27 @@ export class CallStackView extends viewlet.CollapsibleViewletView {
}));
this.toDispose.push(debugModel.onDidChangeCallStack(() => {
this.tree.refresh().done(null, errors.onUnexpectedError);
}));
this.toDispose.push(this.debugService.getViewModel().onDidFocusStackFrame(sf => {
const focussedThread = sf ? this.debugService.getModel().getThreads()[sf.threadId] : null;
if (!focussedThread) {
this.pauseMessage.hide();
return;
}
this.tree.expand(focussedThread);
this.tree.setFocus(this.debugService.getViewModel().getFocusedStackFrame());
if (focussedThread.stoppedDetails && focussedThread.stoppedDetails.reason) {
this.pauseMessageLabel.text(nls.localize('debugStopped', "Paused on {0}", focussedThread.stoppedDetails.reason));
if (focussedThread.stoppedDetails.text) {
this.pauseMessageLabel.title(focussedThread.stoppedDetails.text);
this.tree.refresh().done(() => {
const focussedThread = this.debugService.getModel().getThreads()[this.debugService.getViewModel().getFocusedThreadId()];
if (!focussedThread) {
this.pauseMessage.hide();
return;
}
focussedThread.stoppedDetails.reason === 'exception' ? this.pauseMessageLabel.addClass('exception') : this.pauseMessageLabel.removeClass('exception');
this.pauseMessage.show();
} else {
this.pauseMessage.hide();
}
return this.tree.expand(focussedThread).then(() => {
this.tree.setSelection([this.debugService.getViewModel().getFocusedStackFrame()]);
if (focussedThread.stoppedDetails && focussedThread.stoppedDetails.reason) {
this.pauseMessageLabel.text(nls.localize('debugStopped', "Paused on {0}", focussedThread.stoppedDetails.reason));
if (focussedThread.stoppedDetails.text) {
this.pauseMessageLabel.title(focussedThread.stoppedDetails.text);
}
focussedThread.stoppedDetails.reason === 'exception' ? this.pauseMessageLabel.addClass('exception') : this.pauseMessageLabel.removeClass('exception');
this.pauseMessage.show();
} else {
this.pauseMessage.hide();
}
});
}, errors.onUnexpectedError);
}));
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册