Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement DAP-compliant middleware to interact with Editor Debugger #2494

Closed
Faless opened this issue Mar 22, 2021 · 1 comment
Closed

Implement DAP-compliant middleware to interact with Editor Debugger #2494

Faless opened this issue Mar 22, 2021 · 1 comment

Comments

@Faless
Copy link

Faless commented Mar 22, 2021

Describe the problem

Godot does support external editors for scripts, and with the added support for the Language Server Protocol (see godotengine/godot#29780 and godotengine/godot#35864) it also provides a standardized way for those external editors to support autocompletion and the like, greatly improving usability.

There is still no way though to debug your game from the external editor, and this proposal aims to provide minimal debugging capabilities to those editors, via the Debugger Adapter Protocol (DAP)

Describe the feature

The idea is to provide a Godot Debug Adapter integrated in the editor like the GDScript language server that is able to at least:

  • start the editor debug server (EditorDebuggerNode::start).
  • run an instance of the currently opened project (hooking up EditorNode::_run I guess, and possibly more than one instance, now that the editor debugger supports it)
  • set breakpoints debugging them (ScriptEditorDebugger methods and signals).

For the conceptual placement of the middleware consider same level of the Python debug adapter.
Our editor will not use the DAP protocol itself only expose it to external tools:

with-DAP-small

In protocol terms, this boils down to supporting initialize, set_breakpoints, launch, attach, stacktrace and stack info related requests, basic attached/detached/break signals, handling termination.

Can it be worked around with a few lines of script? Why not an add-on in the asset library?

While this is not in the basic user workflow, it would be a great quality improvement for most of the people using external editors, and while this is mostly doable in GDScript via an EditorDebuggerPlugin, including this in Godot Editor would complement well the LSP implementation already in-place, and do it in a standard way (that until a new standard comes out ;-) ).

Supersedes #1308

Note: I didn't add the GDScript tag, because this could conceptually be language independent, being also beneficial to users of other scripting language which will most likely use external editors.
We will have to see during the implementation how actually feasible it is, but I'm confident it will come natural.

@Faless Faless added this to the 4.0 milestone Mar 22, 2021
@Calinou Calinou changed the title Implement DAP-complaint middlewere to interact with Editor Debugger. Implement DAP-compliant middleware to interact with Editor Debugger Mar 22, 2021
Faless added a commit to Faless/godot-roadmap that referenced this issue Mar 22, 2021
@Faless
Copy link
Author

Faless commented Feb 17, 2022

This was implemented via godotengine/godot#50454 and godotengine/godot#51639

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants