Launch.json in VS Code - can't find godot

Godot Version

4.3 mono

Question

Hello. I’m trying to use Godot mono 4.3 on my apple silicon Mac and I’m having trouble getting everything setup in VSCode.

I have most things setup. When I’m in Godot and I double click on a script, it goes to the right file in VS Code, intellisense or code suggestion also works, but what wasn’t work in debugging.

Here’s my launch.json file:

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Play",
            "type": "coreclr",
            "request": "launch",
            "preLaunchTask": "build",
            "program": "/Applications/Godot_mono.app",
            "args": [],
            "cwd": "${workspaceFolder}",
            "stopAtEntry": false
        },
    ],
    "env": {
        "GODOT4":  "/Applications/Godot_mono.app",
      },
}

And here’s my tasks.json file:

{
    "version": "2.0.0",
    "tasks": [
        {
            "label": "build",
            "command": "dotnet",
            "type": "process",
            "args": [
                "build"
            ],
            "problemMatcher": "$msCompile"
        }
    ]
}

However when I go to debug in VS Code, it says launch: program does not exist.

And I can’t even use the env variable - if I try …

program: “${env:GODOT4}” - it doesn’t like that at all.

Added this pic below from the c# tools extension - not sure if helpful to add here.

Can anyone help? Thanks.

Did you find a solution? I’m encountering the same issues.

Nah. I just decided to use VS 2022 community. That seems to work. But I still can’t get debugging to work.

why do you need to use an external program?

I figured it out, so thought I’d share the solution for future users.

The Godot_mono.app is an application package, so you need to open the package and find the executable inside. Specifically, the path to the executable assuming the package is in your root Application directory of the OS:

/Applications/Godot_mono.app/Contents/MacOS/Godot

To view the contents of the package, right click Godot_mono.app and select “Show Package Contents”

This threw me for a loop for a while since I’m a new Mac user and double clicking the app package itself runs Godot; it’s strange that you cannot run similar by specifying the app package’s path, but whatever… Hope this helps.