X Tutup
Skip to content

Add step out to script debugger#97758

Merged
Repiteo merged 1 commit intogodotengine:masterfrom
TsFreddie:debugger-stepout
Nov 14, 2025
Merged

Add step out to script debugger#97758
Repiteo merged 1 commit intogodotengine:masterfrom
TsFreddie:debugger-stepout

Conversation

@TsFreddie
Copy link
Contributor

@TsFreddie TsFreddie commented Oct 3, 2024

Implementation for proposal godotengine/godot-proposals#2815

image

The debugger and gdscript vm are already setup to be able to handle step out. This PR adds the appropriate debugger protocol, the corresponding button, icon, and key-bind (default to Shift+F11).

edit, key-bind now defaults to Alt+F11 see #97758 (comment)

@TsFreddie TsFreddie requested review from a team as code owners October 3, 2024 08:02
@TsFreddie
Copy link
Contributor Author

Just realized Shift+F11 conflicted with "Toggle Fullscreen".

Since Shift+F11 contrasting step into's F11 is pretty universal across different editors and IDEs, can we move "Toggle Fullscreen" to Ctrl + Shift + F similar to MacOS or Ctrl + F11?

We can also use Ctrl+F11 as "step out", breaking the convention a little bit.

If someone in the team can make the decision, I'm happy to implement either.

@tetrapod00
Copy link
Contributor

tetrapod00 commented Oct 9, 2024

F11 or Shift+F11 are very common keybinds for toggling fullscreen, too. I might argue that toggling fullscreen should have priority over stepping the debugger, since it's a slightly more common action, and used by all users of the engine, not just programmers. I definitely don't think that toggling fullscreen should be on a three-key shortcut like Ctrl+Shift+F.

@TsFreddie
Copy link
Contributor Author

i've moved the default keybind for step out to Alt+F11 to completely avoid the Shift/Ctrl + F11 family of fullscreen keys.

also rebased.

@arkology
Copy link
Contributor

arkology commented Mar 17, 2025

Most likely this PR will be ignored until formal things like CI fails and branch conflicts will be fixed.

@TsFreddie could you please resolve the conflicts and fix the code for passing CI?
Thanks!

@TsFreddie TsFreddie force-pushed the debugger-stepout branch 2 times, most recently from a44b28c to 50f937d Compare March 17, 2025 09:14
@TsFreddie
Copy link
Contributor Author

@arkology Thanks for the heads up!

I wasn't aware of the style check changes since CI passed 3 months ago. And I wasn't running pre-commit for rebases. Should be good now.

@arkology
Copy link
Contributor

arkology commented Mar 17, 2025

Thanks for resolving conflicts!
I've done some basic tests, and it seems to be working fine. But I don't have a review "power", so I asked in the Godot chat if it was possible to put this PR in the review queue.

@ridilculous
Copy link

what did the chat say @arkology ? the PR seems tiny enough to not need too much effort.

@arkology
Copy link
Contributor

@ridilculous if I remember correctly - nothing :(
I completely agree that this PR is tiny but at the same time solid debugger improvement.

@arkology
Copy link
Contributor

@akien-mga could you please request a review from specific contributor for this PR? Thank you!
The code is pretty simple, and the function itself is basic to any IDE I've used before.

out = memnew(Button);
out->set_theme_type_variation("FlatButton");
hbc->add_child(out);
out->set_tooltip_text(TTR("Step Out"));
Copy link
Contributor

Choose a reason for hiding this comment

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

BTW if this PR will get a review, TTR most likely should be replaced with TTRC.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The entire ScriptEditorDebugger still uses TTR. If TTRC is preferred in this context it should probably be done separately with another PR.

Singling out this call to be TTRC while every other calls are still using TTR under the same context is probably messy.

If that happened separately I can rebase again. I usually check back here every few months.

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 it's better that new code uses TTRC even if old code uses TTR still. We can fix the old code later but we don't know when that will happen.

@Ivorforce Ivorforce requested a review from a team July 10, 2025 09:36
Copy link
Member

@vnen vnen left a comment

Choose a reason for hiding this comment

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

LGTM

@Ivorforce Ivorforce modified the milestones: 4.x, 4.6 Jul 10, 2025
@arkology
Copy link
Contributor

Can't believe! @Ivorforce thank you!❤️

@Ivorforce
Copy link
Member

Thank TsFreddie vnen, all i did was forward your request 😄

@Repiteo Repiteo merged commit 90413da into godotengine:master Nov 14, 2025
20 checks passed
@Repiteo
Copy link
Contributor

Repiteo commented Nov 14, 2025

Thanks! Congratulations on your first merged contribution! 🎉

adparker added a commit to TransitionMatrix/godot that referenced this pull request Nov 17, 2025
Implements the DAP stepOut request by bridging to the existing
editor debugger's debug_step_out() method (added in PR godotengine#97758).

This will enable external DAP clients (Neovim, Zed, etc.) to step
out of functions, matching the capability available in the Godot
editor since version 4.6.

Implementation follows the existing pattern used by req_next() and
req_stepIn(), requiring minimal code changes to the DAP parser.

Addresses DAP portion of godotengine/godot-proposals#2815
adparker added a commit to TransitionMatrix/godot that referenced this pull request Nov 18, 2025
Implements the DAP stepOut request by bridging to the existing
editor debugger's debug_step_out() method (added in PR godotengine#97758).

This will enable external DAP clients (Neovim, Zed, etc.) to step
out of functions, matching the capability available in the Godot
editor since version 4.6.

Implementation follows the existing pattern used by req_next() and
req_stepIn(), requiring minimal code changes to the DAP parser.

Addresses DAP portion of godotengine/godot-proposals#2815
adparker added a commit to TransitionMatrix/godot that referenced this pull request Nov 18, 2025
Implements the DAP stepOut request by bridging to the existing
editor debugger's debug_step_out() method (added in PR godotengine#97758).

This will enable external DAP clients (Neovim, Zed, etc.) to step
out of functions, matching the capability available in the Godot
editor since version 4.6.

Implementation follows the existing pattern used by req_next() and
req_stepIn(), requiring minimal code changes to the DAP parser.

Addresses DAP portion of godotengine/godot-proposals#2815
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a Step Out button to the script debugger

8 participants

X Tutup