Skip to content
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

Add expression evaluator to debugger (REPL) #97647

Merged
merged 1 commit into from
Oct 1, 2024

Conversation

KoBeWi
Copy link
Member

@KoBeWi KoBeWi commented Sep 30, 2024

Supersedes #60134
Supersedes #76736
Closes godotengine/godot-proposals#4473

For now it's just rebased branch, putting it as draft until I clean it up and fix issues.

@KoBeWi KoBeWi added this to the 4.4 milestone Sep 30, 2024
@KoBeWi KoBeWi force-pushed the yearly_REPL_pull_request branch from 2016baa to 94811f4 Compare September 30, 2024 23:27
@KoBeWi KoBeWi marked this pull request as ready for review September 30, 2024 23:27
@KoBeWi KoBeWi requested a review from a team as a code owner September 30, 2024 23:27
@KoBeWi KoBeWi force-pushed the yearly_REPL_pull_request branch from 94811f4 to 084f598 Compare October 1, 2024 02:24
Copy link
Collaborator

@Faless Faless left a comment

Choose a reason for hiding this comment

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

Looking good overall, see review comments.

As mentioned in the other PR, this feature should also be disabled in release build (and probably extracted as an EditorDebuggerPlugin), but we can do that in a separate PR.

@KoBeWi KoBeWi force-pushed the yearly_REPL_pull_request branch from 084f598 to c41a393 Compare October 1, 2024 10:09
@KoBeWi
Copy link
Member Author

KoBeWi commented Oct 1, 2024

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.

@KoBeWi KoBeWi force-pushed the yearly_REPL_pull_request branch from c41a393 to 7bb7374 Compare October 1, 2024 11:16
@KoBeWi KoBeWi requested a review from Faless October 1, 2024 11:16
@Faless
Copy link
Collaborator

Faless commented Oct 1, 2024

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

Copy link
Collaborator

@Faless Faless left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@akien-mga akien-mga left a comment

Choose a reason for hiding this comment

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

Looks great!

Co-authored-by: rohanrhu <rohanrhu2@gmail.com>
@KoBeWi KoBeWi force-pushed the yearly_REPL_pull_request branch from 7bb7374 to 645abdb Compare October 1, 2024 13:36
@Calinou
Copy link
Member

Calinou commented Oct 1, 2024

Tested locally, the UI appears to be disabled regardless of whether the project is currently running:

image

I have a GDScript open in the script tab before running the project.

("Expression to evaluate" is a read-only LineEdit.)

@KoBeWi
Copy link
Member Author

KoBeWi commented Oct 1, 2024

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.

@akien-mga
Copy link
Member

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."

@mathrick
Copy link

mathrick commented Oct 1, 2024

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"

@akien-mga akien-mga merged commit 79804a8 into godotengine:master Oct 1, 2024
19 checks passed
@KoBeWi KoBeWi deleted the yearly_REPL_pull_request branch October 1, 2024 15:49
@rohanrhu
Copy link
Contributor

rohanrhu commented Oct 1, 2024

Thank you.

@akien-mga
Copy link
Member

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!

@rxlecky
Copy link
Contributor

rxlecky commented Oct 12, 2024

Great stuff, it's amazing to see this feature finally implemented, after I was unable to do so. Thanks @rohanrhu ! ❤️

@GyuchanLim
Copy link

image

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

@KoBeWi
Copy link
Member Author

KoBeWi commented Oct 26, 2024

You should be able to see it in the inspector when you click the object.

@Musclorman
Copy link

Google translate:
Hello. Why not copy the python interpreter?

French original text:
Bonjour. Pourquoi pas copier l'interpreteur python?

image

@KoBeWi
Copy link
Member Author

KoBeWi commented Jan 21, 2025

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/

@akien-mga akien-mga changed the title Add expression evaluater to debugger (REPL) Add expression evaluator to debugger (REPL) Mar 2, 2025
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 an expression evaluator (REPL support with inspector sequent results)
10 participants