Improve stepping UI

This commit is contained in:
Xinyu Sui 2021-07-21 13:20:02 -07:00
parent 526e1774ed
commit 93c8ad6ecb
2 changed files with 4 additions and 6 deletions

View file

@ -51,7 +51,6 @@ import { DEBUG_CONFIGURE_COMMAND_ID, DEBUG_CONFIGURE_LABEL } from 'vs/workbench/
import { IWorkspaceTrustRequestService } from 'vs/platform/workspace/common/workspaceTrust';
import { Debugger } from 'vs/workbench/contrib/debug/common/debugger';
import { IEditorInput } from 'vs/workbench/common/editor';
import { DisassemblyView } from 'vs/workbench/contrib/debug/browser/disassemblyView';
import { DisassemblyViewInput } from 'vs/workbench/contrib/debug/common/disassemblyViewInput';
export class DebugService implements IDebugService {
@ -832,8 +831,7 @@ export class DebugService implements IDebugService {
const editor = await stackFrame.openInEditor(this.editorService, true);
if (editor) {
if (editor.input === DisassemblyViewInput.instance) {
const disassemblyView = editor as DisassemblyView;
disassemblyView.goToAddress(stackFrame.instructionPointerReference);
// Go to address is invoked via setFocus
} else {
const control = editor.getControl();
if (stackFrame && isCodeEditor(control) && control.hasModel()) {

View file

@ -219,14 +219,14 @@ export class DisassemblyView extends EditorPane {
if (index >= 0) {
// If the row is out of the viewport, reveal it
const topElement = Math.floor(this._disassembledInstructions.scrollTop / this.fontInfo.lineHeight);
const bottomElement = Math.ceil((this._disassembledInstructions.scrollTop + this._disassembledInstructions.renderHeight) / this.fontInfo.lineHeight);
const bottomElement = Math.floor((this._disassembledInstructions.scrollTop + this._disassembledInstructions.renderHeight) / this.fontInfo.lineHeight);
if (index > topElement && index < bottomElement) {
// Inside the viewport, don't do anything here
return;
} else if (index < topElement && index > topElement - 5) {
} else if (index <= topElement && index > topElement - 5) {
// Not too far from top, review it at the top
return this._disassembledInstructions.reveal(index, 0);
} else if (index > bottomElement && index < bottomElement + 5) {
} else if (index >= bottomElement && index < bottomElement + 5) {
// Not too far from bottom, review it at the bottom
return this._disassembledInstructions.reveal(index, 1);
} else {