提交 ff7d4095 编写于 作者: I isidor

debug: show stoppedEvent.text on hover

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