chickensoft-games / GameDemo

The Chickensoft Game Demo — a fully tested, third-person 3D game built with Godot and C#. Now with saving and loading!
https://chickensoft.games
MIT License
308 stars 19 forks source link

Question: vscodium+netcoredbg? #15

Open Novack opened 3 months ago

Novack commented 3 months ago

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?

jolexxa commented 3 months ago

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: https://github.com/godotengine/godot/pull/87595

Novack commented 3 months ago

This is awesome, thanks a ton for the info. I've joined the discord, will close this issue now.

jolexxa commented 3 months ago

We can actually keep this open — it would be nice to support it as soon as it's possible.

granitrocky commented 2 months ago

Here's a PR on the VSCodium C# extension that would enable this:

https://github.com/muhammadsammy/free-vscode-csharp/pull/68

jolexxa commented 2 months ago

Thank you! Once https://github.com/muhammadsammy/free-vscode-csharp/issues/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

jolexxa commented 2 months ago

Update: now waiting on https://github.com/muhammadsammy/free-vscode-csharp/pull/72

GeneralProtectionFault commented 2 months ago

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.

jolexxa commented 2 months ago

@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.

GeneralProtectionFault commented 2 months ago

@definitelyokay Sure, like I said, I just used what graniterocky put in the PR you linked above (https://github.com/muhammadsammy/free-vscode-csharp/pull/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"
                ]
            }
        }
    ]