godotengine / godot-proposals

Godot Improvement Proposals (GIPs)
MIT License
1.07k stars 69 forks source link

Add "pass/verification" points to the editor Errors panel #9556

Open Torguen opened 2 months ago

Torguen commented 2 months ago

Describe the project you are working on

not important here

Describe the problem or limitation you are having in your project

Add the option to create a "pass/verification" point. A complement to breakpoints.

With breakpoints the execution stops, it can be annoying if you just want to check that the code is executing. So the alternative is to do a "print()", sometimes it is heavy, then you have to delete it etc...

The new "pass/verification" point prints a circle of a customizable color in the console, the execution does not stop and you do not have to use prints, currently colored circles are already printed for warnings and errors:

Captura4

The "pass/verification" point is set in the same way as a breakpoint but allows you to choose a color, that color will be printed in the console when the line marked with the "pass/verification" point is executed.

Describe the feature / enhancement and how it helps to overcome the problem or limitation

It's about streamlining the code checking process, it's about not having to stop execution and not having to use prints to check when what is executed or in what order. If you put 3 "pass/verification" points of different colored values, you will know in what order those lines are being executed. Without stopping the execution and without using prints.

A "pass/verification" point could be activated as follows:

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

...

If this enhancement will not be used often, can it be worked around with a few lines of script?

I don't think so

Is there a reason why this should be core and not an add-on in the asset library?

I'm not sure if it can be achieved with an addon

RedMser commented 2 months ago

Browser developer tools have "log points" which are basically temporary print statements that can be added/removed like breakpoints but only run when debugger is attached. It seems to be similar to the idea you're proposing, but the UX should maybe be oriented towards how other tools do it (e.g. instead of picking a color, it could open a dialog for customizing the print expression - there would be some message by default so that you don't need to enter one yourself).