提交 3a192e94 编写于 作者: M Michel Kaporin

Taking the top most available stack frame for exception widget. Resolves #27903

上级 91a0e044
......@@ -356,19 +356,25 @@ export class DebugEditorContribution implements IDebugEditorContribution {
// Toggles exception widget based on the state of the current editor model and debug stack frame
const model = this.editor.getModel();
const focusedSf = this.debugService.getViewModel().focusedStackFrame;
if (!model || !focusedSf || !focusedSf.source || !focusedSf.source.available) {
const callStack = focusedSf ? focusedSf.thread.getCallStack() : null;
if (!model || !focusedSf || !callStack || callStack.length === 0) {
this.closeExceptionWidget();
return;
}
const callStack = focusedSf.thread.getCallStack();
if (!callStack || callStack.length === 0) {
// First call stack frame that is available is the frame where exception has been thrown
let exceptionSf;
for (let sf of callStack) {
if (sf.source && sf.source.available) {
exceptionSf = sf;
break;
}
}
if (!exceptionSf) {
this.closeExceptionWidget();
return;
}
// First call stack frame is the frame where exception has been thrown
const exceptionSf = callStack[0];
const sameUri = exceptionSf.source.uri.toString() === model.uri.toString();
if (this.exceptionWidget && !sameUri) {
this.closeExceptionWidget();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册