godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
91.32k stars 21.24k forks source link

Debugger Evaluator format issue on division #98714

Open kitbdev opened 3 weeks ago

kitbdev commented 3 weeks ago

Tested versions

4.4.dev (since it was added https://github.com/godotengine/godot/pull/97647)

System information

Windows 10.0.22631 - Multi-window, 1 monitor - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 2070 (NVIDIA; 32.0.15.6603) - Intel(R) Core(TM) i7-10750H CPU @ 2.60GHz (12 threads)

Issue description

When using a forward slash / to divide in the REPL expression evaluator, a group header is created holding and separates the operands:

Screenshot 2024-10-31 200822

This can be nested as well with multiple /.

Also right clicking on a previously evaluated expression to copy it does not work as expected. Copying property path (though it isn't a property) copies Evaluated/ before the actual expression. Copying the value does not work.

image

Steps to reproduce

  1. Open the Debugger Evaluator and break on something
  2. Enter an expression with / to divide some numbers or variables, like 10/2

Minimal reproduction project (MRP)

N/A

DarkyMago commented 1 week ago

The first part is due to the way VBoxContainers are generated in the Inspector from the PropertyInfo (in editor/editor_inspector.cpp:3159:3208).

As evaluated expressions don't seem to be made to be nested (i.e. will provide an object id for a class), it could be bypassed by introducing a character for Evaluated expressions so that they are not parsed for containers. e.g. property info name would be Evaluator/%10 / 2 instead of Evaluator/10 / 2. (% to be swapped to a more appropriate character which would most probably not be used like non-breaking space or something)