提交 430cd871 编写于 作者: I isidor

debug: polish top stack frame decoration heuristic

上级 f055e93f
......@@ -22,7 +22,7 @@ interface IDebugEditorModelData {
breakpointDecorationsAsMap: Map<string, boolean>;
currentStackDecorations: string[];
dirty: boolean;
topStackFrameLine: number;
topStackFrameRange: Range;
}
const stickiness = TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges;
......@@ -68,7 +68,7 @@ export class DebugEditorModelManager implements IWorkbenchContribution {
if (state === State.Inactive) {
this.modelDataMap.forEach(modelData => {
modelData.dirty = false;
modelData.topStackFrameLine = undefined;
modelData.topStackFrameRange = undefined;
});
}
}));
......@@ -93,7 +93,7 @@ export class DebugEditorModelManager implements IWorkbenchContribution {
breakpointDecorationsAsMap,
currentStackDecorations: currentStackDecorations,
dirty: false,
topStackFrameLine: undefined
topStackFrameRange: undefined
});
}
......@@ -121,7 +121,7 @@ export class DebugEditorModelManager implements IWorkbenchContribution {
}
// only show decorations for the currently focussed thread.
const wholeLineRange = new Range(stackFrame.lineNumber, stackFrame.column, stackFrame.lineNumber, Constants.MAX_SAFE_SMALL_INTEGER);
const columnUntilEOLRange = new Range(stackFrame.lineNumber, stackFrame.column, stackFrame.lineNumber, Constants.MAX_SAFE_SMALL_INTEGER);
const range = new Range(stackFrame.lineNumber, stackFrame.column, stackFrame.lineNumber, stackFrame.column + 1);
// compute how to decorate the editor. Different decorations are used if this is a top stack frame, focussed stack frame,
......@@ -136,23 +136,23 @@ export class DebugEditorModelManager implements IWorkbenchContribution {
if (stackFrame.thread.stoppedDetails && stackFrame.thread.stoppedDetails.reason === 'exception') {
result.push({
options: DebugEditorModelManager.TOP_STACK_FRAME_EXCEPTION_DECORATION,
range: wholeLineRange
range: columnUntilEOLRange
});
} else {
result.push({
options: DebugEditorModelManager.TOP_STACK_FRAME_DECORATION,
range: wholeLineRange
range: columnUntilEOLRange
});
if (this.modelDataMap.has(modelUriStr)) {
const modelData = this.modelDataMap.get(modelUriStr);
if (modelData.topStackFrameLine === stackFrame.lineNumber) {
if (modelData.topStackFrameRange && modelData.topStackFrameRange.startLineNumber === stackFrame.lineNumber && modelData.topStackFrameRange.startColumn !== stackFrame.column) {
result.push({
options: DebugEditorModelManager.TOP_STACK_FRAME_INLINE_DECORATION,
range: wholeLineRange
range: columnUntilEOLRange
});
}
modelData.topStackFrameLine = stackFrame.lineNumber;
modelData.topStackFrameRange = columnUntilEOLRange;
}
}
} else {
......@@ -163,7 +163,7 @@ export class DebugEditorModelManager implements IWorkbenchContribution {
result.push({
options: DebugEditorModelManager.FOCUSED_STACK_FRAME_DECORATION,
range: wholeLineRange
range: columnUntilEOLRange
});
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册