Skip to content

Use preserveFocus when focusing stack frames #251964

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Schpoone
Copy link

Fixes #251241

Tested by running the reproduction steps listed in the issue.

When selecting different stack frames, the editor's focus stays on source if its focus was on source before and it stays on disassembly if its focus was on disassembly before.

When the debugger stops because of an instruction breakpoint or because of an instruction step, the focus will shift to the diassembly, but if different stack frames are inspected afterwards, you get the behavior above.

(threadStopReason === 'instruction breakpoint' ||
(threadStopReason === 'step' && this.thread.lastSteppingGranularity === 'instruction') ||
((threadStopReason === 'instruction breakpoint' && !preserveFocus) ||
(threadStopReason === 'step' && this.thread.lastSteppingGranularity === 'instruction' && !preserveFocus) ||
editorService.activeEditor instanceof DisassemblyViewInput)) {
return editorService.openEditor(DisassemblyViewInput.instance, { pinned: true, revealIfOpened: true });
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should just pass the preserveFocus boolean to the options argument here

Suggested change
return editorService.openEditor(DisassemblyViewInput.instance, { pinned: true, revealIfOpened: true });
return editorService.openEditor(DisassemblyViewInput.instance, { pinned: true, revealIfOpened: true, preserveFocus });

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Editor should focus on source code when clicking on stack frames if the source code is currently focused
2 participants