godotengine / godot-vscode-plugin

Godot development tools for VSCode
MIT License
1.59k stars 169 forks source link

Show non-crashing errors from the debugger #748

Open m-radzikowski opened 3 days ago

m-radzikowski commented 3 days ago

Godot version

4.3.stable

VS Code version

1.95.2

Godot Tools VS Code extension version

2.3.0

System information

Windows 11

Problem statement

Some errors do not crash Godot - for example signals handlers with improper number of arguments. Those are only displayed in the Debugger -> Errors tab in the Godot editor:

image

E 0:00:00:0588 battle.gd:17 @ @selected_unit_setter(): Error calling from signal 'unit_selection_changed' to callable: 'HBoxContainer(hit_chance_bar.gd)::_on_attacker_changed': Method expected 2 arguments, but called with 1.

However, they do not show up in the VS Code, the Debug Console, or the Output -> Godot Debugger.

When you only always ever run from VS Code, you end up not seeing errors that silently break the game.

Proposed solution

Show the errors from the Godot Debugger -> Errors tab. I wouldn't mind having them in the Debug Console, mixed with my own logs, but at least very visible.

Another option would be to break on those errors, but I don't think this is possible in Godot itself.

Unless, of course, this should already work and it does not for me for some reason?

DaelonSuzuka commented 3 days ago

You are absolutely correct, errors are not being routed to the debug console! I can't believe I missed that when I rewrote the debugger (and nobody noticed until now)!

Thanks for the report.

DaelonSuzuka commented 3 days ago
IGNORE ALL OF THIS Here's what I got so far: ![image](https://github.com/user-attachments/assets/2eb63314-0cb2-472c-a684-c14aa6b5276f) I would love to find a way to make these collapsible... It's clearly possible because debugging nodejs gets you this: ![image](https://github.com/user-attachments/assets/022da8e9-3781-4aa3-aa2b-5e064aef737f)

I figured it out!

image