提交 ff7d4095 编写于 作者: I isidor

debug: show stoppedEvent.text on hover

fixes #3101
上级 29ae86e4
......@@ -151,7 +151,7 @@ export class DebugEditorModelManager implements IWorkbenchContribution {
range: createRange(sf.lineNumber, sf.column, sf.lineNumber, sf.column + 1)
});
if (thread.stoppedReason === 'exception') {
if (thread.stoppedDetails.reason === 'exception') {
result.push({
options: DebugEditorModelManager.TOP_STACK_FRAME_EXCEPTION_DECORATION,
range: wholeLineRange
......
......@@ -252,11 +252,15 @@ class CallStackView extends viewlet.CollapsibleViewletView {
this.toDispose.push(debugModel.addListener2(debug.ModelEvents.CALLSTACK_UPDATED, () => {
this.tree.refresh().done(null, errors.onUnexpectedError);
}));
this.toDispose.push(this.debugService.getViewModel().addListener2(debug.ViewModelEvents.FOCUSED_STACK_FRAME_UPDATED, () => {
const focussedThread = this.debugService.getModel().getThreads()[this.debugService.getViewModel().getFocusedThreadId()];
if (focussedThread && focussedThread.stoppedReason && focussedThread.stoppedReason !== 'step') {
this.pauseMessageLabel.text(nls.localize('debugStopped', "Paused on {0}", focussedThread.stoppedReason));
focussedThread.stoppedReason === 'exception' ? this.pauseMessageLabel.addClass('exception') : this.pauseMessageLabel.removeClass('exception');
if (focussedThread && focussedThread.stoppedDetails && focussedThread.stoppedDetails.reason !== 'step') {
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();
......
......@@ -24,7 +24,13 @@ export interface IRawModelUpdate {
threadId: number;
thread?: DebugProtocol.Thread;
callStack?: DebugProtocol.StackFrame[];
stoppedReason?: string;
stoppedDetails?: IRawStoppedDetails;
}
export interface IRawStoppedDetails {
reason: string;
threadId?: number;
text?: string;
}
// model
......@@ -48,7 +54,7 @@ export interface IThread extends ITreeElement {
threadId: number;
name: string;
callStack: IStackFrame[];
stoppedReason: string;
stoppedDetails: IRawStoppedDetails;
}
export interface IScope extends IExpressionContainer {
......
......@@ -90,10 +90,10 @@ export function getFullExpressionName(expression: debug.IExpression, sessionType
export class Thread implements debug.IThread {
public stoppedReason: string;
public stoppedDetails: debug.IRawStoppedDetails;
constructor(public name: string, public threadId, public callStack: debug.IStackFrame[]) {
this.stoppedReason = undefined;
this.stoppedDetails = undefined;
}
public getId(): string {
......@@ -358,7 +358,7 @@ export class Model extends ee.EventEmitter implements debug.IModel {
delete this.threads[reference];
} else {
this.threads[reference].callStack = [];
this.threads[reference].stoppedReason = undefined;
this.threads[reference].stoppedDetails = undefined;
}
} else {
if (removeThreads) {
......@@ -368,7 +368,7 @@ export class Model extends ee.EventEmitter implements debug.IModel {
for (let ref in this.threads) {
if (this.threads.hasOwnProperty(ref)) {
this.threads[ref].callStack = [];
this.threads[ref].stoppedReason = undefined;
this.threads[ref].stoppedDetails = undefined;
}
}
}
......@@ -636,7 +636,7 @@ export class Model extends ee.EventEmitter implements debug.IModel {
return new StackFrame(data.threadId, rsf.id, rsf.source ? new Source(rsf.source) : new Source({ name: 'unknown' }), rsf.name, rsf.line, rsf.column);
});
this.threads[data.threadId].stoppedReason = data.stoppedReason;
this.threads[data.threadId].stoppedDetails = data.stoppedDetails;
}
this.emit(debug.ModelEvents.CALLSTACK_UPDATED);
......
......@@ -240,7 +240,7 @@ export class DebugService extends ee.EventEmitter implements debug.IDebugService
this.getThreadData(threadId).then(() => {
this.session.stackTrace({ threadId: threadId, levels: 20 }).done((result) => {
this.model.rawUpdate({ threadId: threadId, callStack: result.body.stackFrames, stoppedReason: event.body.reason });
this.model.rawUpdate({ threadId: threadId, callStack: result.body.stackFrames, stoppedDetails: event.body });
this.windowService.getWindow().focus();
const callStack = this.model.getThreads()[threadId].callStack;
if (callStack.length > 0) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册