godot
godot copied to clipboard
Add expression evaluater to debugger (REPL)
Supersedes #60134 Supersedes #76736 Closes https://github.com/godotengine/godot-proposals/issues/4473
For now it's just rebased branch, putting it as draft until I clean it up and fix issues.
this feature should also be disabled in release build
This feature is a part of debugger. Does it even exist in release builds?
probably extracted as an EditorDebuggerPlugin
I can do that in a follow-up.
This feature is a part of debugger. Does it even exist in release builds?
Yes the debugger is not fully disabled in release builds, only parts of it (like live scene editing), it's historically always been like that, but of course this should be re-evaluated
Tested locally, the UI appears to be disabled regardless of whether the project is currently running:
I have a GDScript open in the script tab before running the project.
("Expression to evaluate" is a read-only LineEdit.)
You can only evaluate when the game is breaked (at breakpoint, error etc.). Maybe this should be more obvious, but it can be improved later.
Maybe the LineEdit could have a centered message in this case that says "To evaluate expressions, the project must be running with the execution interrupted by a breakpoint or error."
Maybe the LineEdit could have a centered message in this case that says "To evaluate expressions, the project must be running with the execution interrupted by a breakpoint or error."
Wording suggestion: "Expressions can only be evaluated when a running project is paused in the debugger"
Thank you.
I forgot to say thanks when merging this, I had wrongly closed the tab /o\
Thanks to everyone involved in implementing this feature, @rohanrhu, @rxlecky and @KoBeWi!
Great stuff, it's amazing to see this feature finally implemented, after I was unable to do so. Thanks @rohanrhu ! ❤️
Hello, I've been using this feature on the Godot 4.4 dev 3 snapshot and I am loving this feature.
And I have a potential newbie question.
Is there a way to see the Object value of Display.dealer_total just like how you can with dealt_card
You should be able to see it in the inspector when you click the object.
Google translate: Hello. Why not copy the python interpreter?
French original text: Bonjour. Pourquoi pas copier l'interpreteur python?
Because it serves a different purpose. It's a tool for debugging a running project.
If you want a GDScript interpreter, you can use one available online, like https://gd.tumeo.space/
This bug seems to have not been completely fixed 👀. Adding this comment here instead of opening a new PR since maybe we would like to simply re-open this PR :).
I've seen the following behaviors in Godot 4.5.beta1 (which supposedly includes this PR):
(1) When evaluating expressions while inside a static function, the evaluator does not evaluate.
(2) Additionally, not only does the evaluator not evaluate, but the debugger itself immediately continues running as if the user pressed "Continue".
Here is a test project to check it on: (as mentioned, please run this on Godot 4.5.beta1).
godot-evaluator-static-bugs.zip
Behavior (1) is an important feature I believe should exist, but behavior (2) is especially concerning as I have also observed it when triggering the bug that this PR fixed (happened to me in Godot 4.4.1.stable) meaning that possibly any bug other users will encounter with the evaluator might have unintended side effects.
Adding this comment here instead of opening a new PR since maybe we would like to simply re-open this PR :).
That's what issues are for.
Adding this comment here instead of opening a new PR since maybe we would like to simply re-open this PR :).
That's what issues are for.
Then I shall be opening one pronto :)