Question: vscodium+netcoredbg?
Closed this issue · 9 comments
Hello there Joanna, this repo looks so handy, I just grabed some vscode config files :) Thanks a ton!
Im wondering if you have tried a similar setup but using VSCodium? The debugger provided with Microsoft's C# extension is highly restrictive, licensed only to work with the official vscode build. A workaround for debugging C# projects in vscodium is to use Samsung's opensource netcoredbg package.
Do you, or anyone of your knowledge was able to make such setup work for Godot C# projects?
This was discussed in the Chickensoft discord. It seems possible in theory, but doesn't actually work yet afaik. See here and here
I have commented here trying to get more information, as well: godotengine/godot#87595
This is awesome, thanks a ton for the info. I've joined the discord, will close this issue now.
We can actually keep this open — it would be nice to support it as soon as it's possible.
Here's a PR on the VSCodium C# extension that would enable this:
Thank you! Once muhammadsammy/free-vscode-csharp#69 is merged in, we'll be able to proceed with creating launch.json options for this project and https://github.com/chickensoft-games/GodotGame
Update: now waiting on muhammadsammy/free-vscode-csharp#72
Looks like that just got merged =D.
I tried grabbing & building the .vsix (following the process dgokcin used in that issue ^^^), installed it, and tried the launch.json examples graniterocky put in the same PR (in Godot).
It launched, which it wouldn't have done before the extension update, but it didn't hit a breakpoint. Also, the game itself didn't "really" launch. Very strange, it launches the editor--so I have 2 Godot editors open, but not the game. Not sure what's going on there.
I just used the vanilla C# tasks.json:
{
"label": "build",
"group": "build",
"type": "shell",
"command": "dotnet",
"args": [
"build",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"problemMatcher": "$msCompile"
}
For clarity on on Linux (Garuda).
UPDATE
Nevermind, it works! The -e argument (I didn't realize) is for the editor instead of running the game.
I got rid of that and added -d (debug) and -b (breakpoints) to the pipe args and it hit a breakpoint & ran =D
UPDATE 2 - Don't actually need the arguments, which makes sense, those are Godot's, not .NET's.
@GeneralProtectionFault would you mind sharing the working launch.json? Feel free to sanitize any hardcoded paths. That will give me something to reference when updating launch configs and documentation.
@definitelyokay Sure, like I said, I just used what graniterocky put in the PR you linked above (muhammadsammy/free-vscode-csharp#72) -- except remove "-e" from the pipe args, that opens the Godot editor instead of running the project. Also, the debug arguments I put in here are Godot's and are not necessary. I assume you'd just put any relevant arguments for running Godot there if there are any.
"configurations": [
{
"name": "🕹 Run/Debug Game",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "",
"cwd": "${workspaceFolder}",
"internalConsoleOptions": "openOnSessionStart",
"pipeTransport": {
"pipeCwd": "${workspaceFolder}",
"pipeProgram": "/usr/bin/godot",
"pipeArgs": [
"--debug",
"--breakpoints"
]
}
}
]