godot icon indicating copy to clipboard operation
godot copied to clipboard

Expression Evaluator (REPL support with inspector sequent results)

Open rohanrhu opened this issue 3 years ago • 63 comments
trafficstars

Meoowww... I made an expression evaluator.

Looks like this: image

I overloaded

void GDScriptLanguage::debug_get_stack_level_locals(int p_level, List<String> *p_locals, List<Variant> *p_values, int p_max_subitems, int p_max_depth)

definitions with

void GDScriptLanguage::debug_get_stack_level_locals(int p_level, Vector<String> *p_locals, Array *p_values, int p_max_subitems, int p_max_depth)

because Expression methods accepts Vector<String> and Array soo I didn't copy List<String> and List<Variant> datas into Vector<String> and Array.

I connected EditorDebuggerInspector's object_selected to inspect objects from evaluater result to inspector bar.

Fixes godotengine/godot-proposals#4473

rohanrhu avatar Apr 11 '22 07:04 rohanrhu

Thanks for opening a pull request!

Please amend the commit to use a human-readable commit message (git commit --amend). This way, people reading the Git log can easily figure out what's going on :slightly_smiling_face:

PS: It's "evaluator", not "evaluater".

Calinou avatar Apr 11 '22 13:04 Calinou

PS: It's "evaluator", not "evaluater".

Hiiii @Calinou I refactored the typo.

rohanrhu avatar Apr 12 '22 12:04 rohanrhu

Please squash commits together as required by our pipeline (https://docs.godotengine.org/en/latest/community/contributing/pr_workflow.html).

Chaosus avatar Apr 12 '22 12:04 Chaosus

Hiiii @Chaosus I squashed commits.

rohanrhu avatar Apr 12 '22 13:04 rohanrhu

Hiii, I added missing overloading of virtual method for C# bindings, trimmed trailing spaces and squashed commits.

rohanrhu avatar Apr 13 '22 11:04 rohanrhu

I ordered includes for format checker and squashed commits again. 🙀

rohanrhu avatar Apr 13 '22 13:04 rohanrhu

Meow.. @Chaosus @Calinou clang-format is acting interesting. I ran clang_format.sh in my local and it ordered the includes but it still wants a different order in Github workflow. 🙀

rohanrhu avatar Apr 13 '22 13:04 rohanrhu

@rohanrhu Make sure your clang-format version matches the one we're using. As of this comment, that would be version 13: https://github.com/godotengine/godot/blob/8fee88947e7c5ac7171b056088c3ac5ae20e954e/.github/workflows/static_checks.yml#L27

neikeq avatar Apr 13 '22 17:04 neikeq

Can someone help @rohanrhu write a proposal for this so we can all meow.

fire avatar Apr 13 '22 18:04 fire

Can someone help @rohanrhu write a proposal for this so we can all meow.

Yesss I want to meoowww.

rohanrhu avatar Apr 13 '22 19:04 rohanrhu

I meowed a proposal: https://github.com/godotengine/godot-proposals/issues/4473

rohanrhu avatar Apr 30 '22 11:04 rohanrhu

Meoowwww can anyone review this PR?? 🙀

rohanrhu avatar May 04 '22 13:05 rohanrhu

Hi! This is really nice work! Just for reference, we discussed that feature a while ago and had a working implementation but because the codebase changed too much it was never implemented (#26219). It also supported watchpoints and usability was more ironed out. Would you be interested in following up that work? We could go with just evals (what your PR does) and wachpoints can be implemented later on.

reduz avatar Jul 12 '22 13:07 reduz

Hi! This is really nice work!

Oh Reduzz.... thank you 🙀

Would you be interested in following up that work?

Yess sure. 🙂

rohanrhu avatar Jul 12 '22 23:07 rohanrhu

This is one of the features I am waiting for, I hope It will make into Godot 4

atsd34 avatar Oct 21 '22 12:10 atsd34

This is one of the features I am waiting for, I hope It will make into Godot 4

I think there is no reason not to merge this.. I will resolve conflicts in latest revision. I'm very busy right now.

rohanrhu avatar Oct 22 '22 16:10 rohanrhu

Hewwwoooo, let's merge this plss it just works like a charm 😊

rohanrhu avatar Nov 07 '22 15:11 rohanrhu

Btw I will work on more features on this when I have timeeee

rohanrhu avatar Nov 09 '22 20:11 rohanrhu

Bump, this would be a useful feature to have and I almost made a duplicate.

PoolloverNathan avatar Jan 07 '23 01:01 PoolloverNathan

This PR is neither mergeable nor reviewable with 803 commits wrongly added during rebase. It would need to be rebased again to remove the duplicated commits, or redone.

akien-mga avatar Jan 07 '23 16:01 akien-mga

@akien-mga I willl meoowww about ittt 🙀

rohanrhu avatar Jan 07 '23 19:01 rohanrhu

Is there any chance of this getting cleaned up and finalized for 4.1? This would be awesome for new users

RyanCross avatar Mar 03 '23 23:03 RyanCross

Is there any chance of this getting cleaned up and finalized for 4.1? This would be awesome for new users

akien-mga's comment above still stands. This PR needs to be rebased before it can be reviewed.

Calinou avatar Mar 04 '23 00:03 Calinou

Judging from the OP's activity with other PRs, this is not going to happen unless someone else takes over.

KoBeWi avatar Mar 04 '23 00:03 KoBeWi

Judging from the OP's activity with other PRs, this is not going to happen unless someone else takes over.

Oh sorryyy I'm working so much.. I will rebase it soon.

rohanrhu avatar Mar 04 '23 04:03 rohanrhu

I have rebased this PR again in https://github.com/godotengine/godot/compare/master...LinqLover:godot:expression-evaluater (based on the last commit of @rohanrhu, 57c8a0d855e2a792004d66606fbafbf879a60f23). Not sure whether this helps, but at least it should facilitate the review (13 changed files with 3,476 additions and 0 deletions) ... Anyway, this PR was previously approved by @atsd34, and the ancestry problem is now solved. I would (too) be glad to see this feature come to life in Godot, meow!

LinqLover avatar May 04 '23 19:05 LinqLover

Can you remake the pull request to godot engine?

fire avatar May 04 '23 19:05 fire

@fire See https://github.com/godotengine/godot/pull/76736

LinqLover avatar May 04 '23 19:05 LinqLover

I rebased the PR. Thank you very much to @LinqLover for extracting my commit from broken branch.

Since Godot PRs are being merged in a very slow progress, I think I can add more features to this, please let me know what you would like to have with the evaluator. I already have some ideas to add.

I'll take care of format checking too. I forgot how to run it locally lol.

rohanrhu avatar Jun 11 '23 22:06 rohanrhu

I forgot how to run it locally lol.

See https://docs.godotengine.org/en/stable/contributing/development/code_style_guidelines.html#pre-commit-hook :slightly_smiling_face:

Calinou avatar Jun 11 '23 22:06 Calinou