Open TheKizzyDev opened 11 months ago
Unfortunately, this is the expected behavior right now. I had to prioritize making launch sessions work consistently and reliably across Godot versions, and I haven't been able to get attach sessions working to that same standard.
"debugServer"
should still work after #452, because that uses an entirely different protocol and completely bypasses the extension's debugger code. Sadly, that protocol only supports some of the debugger features, and I have not personally been able to get it to work reliably.There are disadvantages to this in that I can't configure the scene to show debug information e.g. show collisions, etc.
Of course you can, just add "additional_options": "--debug-collisions"
or similar to your debug configuration. The possible flags are available in the docs here: https://docs.godotengine.org/en/stable/tutorials/editor/command_line_tutorial.html
I just added most of the engine's debug CLI flags as explicit debug config parameters in #529. This should be merged to master soon(tm).
ex:
{
"name": "Launch",
"type": "godot",
"request": "launch",
// engine command line flags
"profiling": false,
"single_threaded_scene": false,
"debug_collisions": false,
"debug_paths": false,
"debug_navigation": false,
"debug_avoidance": false,
"debug_stringnames": false,
"frame_delay": 0,
"time_scale": 1.0,
"disable_vsync": false,
"fixed_fps": 60,
// anything else
"additional_options": ""
}
@DaelonSuzuka thanks for the quick reply, and great job so far! I missed the workaround in #389 , and I'll try what's there.
It's understandable that getting the launch feature to work first was priority. IMO, this fix is just a quality of life improvement to an already good tool.
UPDATE: The workaround works. Thank you!
Unfortunately, I still haven't gotten attach sessions to work. At this point I'm not certain it's possible.
The recommended way to use the debugger from VSCode is using a launch
session without using the debugServer
option. Using debugServer
works kind of like an attach session, but none of this extension's custom debug features will work if you do that.
@DaelonSuzuka thanks for the update!
Yeah, it's fine. Thank you for trying.
I've been working around the issue by just using the launch
session rather than attach
.
I do enjoy Godot's editor, but there are times when I want/miss/need features from another tool already provides like vscode that I can't reasonably expect Godot to implement.
Is there a feature proposal or something I can upvote to make the debugServer
more extendable for external tools?
Is there a feature proposal or something I can upvote to make the debugServer more extendable for external tools?
No idea, but the term to search for is "Debug Adapter Protocol". The usual Godot debugger uses a custom protocol, which is a particular message/packet format sent over a TCP stream. DAP is a totally different protocol, which I haven't investigated beyond understanding that it's totally incompatible with the existing debug protocol.
(DAP docs: https://microsoft.github.io/debug-adapter-protocol)
Godot version
v4.1.2.stable.mono.official [399c9dc39]
VS Code version
1.84.2
Godot Tools VS Code extension version
f65033c
System information
Windows 11
Issue description
I'd like to debug the currently selected scene in the Godot Editor from vscode. When I run it, and connect to to the debug server from vscode, it does not trigger any of the breakpoints. It seems to connect to the debug server without error though.
When I run the same scene by launching it from vscode, it works. There are disadvantages to this in that I can't configure the scene to show debug information e.g. show collisions, etc.
NOTE: I can't test whether this works in other versions of the tool since Godot 4 debugging is not supported there yet. I'm waiting on these changes to release #452
Steps to reproduce