godotengine / godotengine/godot-vscode-plugin
Add Operations to Debug Console
- Dominant language
- TypeScript
- Stars
- 2.1k
- Forks
- 257
- PR merge metrics
- No merged PRs in 30d
Description
### Godot version
3.4.4.stable
### VS Code version
1.68.1
### Godot Tools VS Code extension version
1.3.1
### System information
Windows 10
### Problem statement
It's not possible to do various operations in the Debug Console after hitting a breakpoint.
See here for all the different operations possible: https://docs.godotengine.org/en/stable/tutorials/scripting/gdscript/gdscript_basics.html
For example if you hit a breakpoint in a Node2D script you might want to change the position of that Node2D.
So in the Debug Console you would type something like:
```
position.x = 10
```
You can set some values through the Inspector, but some types don't work. See: https://github.com/godotengine/godot-vscode-plugin/issues/383
This proceeds this issue: https://github.com/godotengine/godot-vscode-plugin/issues/381
Of which I have a proposed PR for: https://github.com/godotengine/godot-vscode-plugin/pull/387
### Proposed solution
Using the existing infrastructure communicating between the extension and Godot we can implement various operations.
In VS Code if you run:
```
Mediator.notify("changed_value", [
object_id,
variable_name,
value,
]);
```
That will go over to the Godot Engine and hit the following function in **script_debugger_remote.cpp**:
```
void _set_object_property(ObjectID p_id, const String &p_property, const Variant &p_value);
```
So it's merely a matter of understanding how to format the values properly for all the different types.
Contributor guide
Assessment
This issue has not been assessed yet.