Skip to content

Configuring A Development Environment

George L. Albany edited this page Mar 25, 2026 · 5 revisions

Visual Studio Code

Creating Build Task

  1. Make sure the C/C++ extension is installed. You can find instructions in the official documentation. Alternatively, clangd can be used instead.

  2. From the Visual Studio Code's main screen open the OpenVic root folder with File > Open Folder....

  3. Press Ctrl + Shift + P to open the command prompt window and enter Configure Task.

  4. Select the Create tasks.json file from template option.

  5. Then select Others.

  6. If there is no such option as Create tasks.json file from template available, either delete the file if it already exists in your folder or create a .vscode/tasks.json file manually. See Tasks in Visual Studio Code for more details on tasks.

  7. Within the tasks.json file find the "tasks" array and add a new section to it:

    {
      "label": "dev_build",
      "group": "build",
      "type": "shell",
      "command": "scons",
      "args": [
        // enable for debugging with breakpoints
        "dev_build=yes",
      ],
      "problemMatcher": "$msCompile"
    }

Arguments can be different based on your own setup and needs. See Build With Scons for a full list of arguments.

Debugging the GDExtension

To run and debug the project you need to create a new configuration in the launch.json file.

  1. Press Ctrl + Shift + D to open the Run panel.

    • If launch.json file is missing you will be prompted to create a new one.
  2. Select C++ (GDB/LLDB). There may be another platform-specific option here. If selected, adjust the configuration example provided accordingly.

  3. Within the launch.json file find the "configurations" array and add a new section to it:

    Windows
    {
        "name": "Launch Project",
        "type": "cppvsdbg",
        "request": "launch",
        // Change to godot binary path
        "program": "godot.exe",
        // Change the arguments below for the project you want to test with.
        // To run the project in the editor, add the "--editor" argument.
        "args": [],
        "stopAtEntry": false,
        "cwd": "${workspaceFolder}\\game",
        "environment": [],
        "console": "internalConsole",
        "preLaunchTask": "dev_build"
    }
    Linux (GDB)
    {
        "name": "Launch Project",
        "type": "cppdbg",
        "request": "launch",
        // Change to godot binary path
        "program": "/bin/godot",
        // Change the arguments below for the project you want to test with.
        // To run the project in the editor, add the "--editor" argument.
        "args": [],
        "stopAtEntry": false,
        "cwd": "${workspaceFolder}/game",
        "environment": [],
        "externalConsole": false,
        "setupCommands":
        [
            {
            "description": "Enable pretty-printing for gdb",
            "text": "-enable-pretty-printing",
            "ignoreFailures": true
            }
        ],
        "preLaunchTask": "dev_build"
    }
    Linux (LLDB)
    {
        "name": "Launch Project",
        "type": "lldb",
        "request": "launch",
        // Change to godot binary path
        "program": "/bin/godot",
        // Change the arguments below for the project you want to test with.
        // To run the project in the editor, add the "--editor" argument.
        "args": [],
        "stopAtEntry": false,
        "cwd": "${workspaceFolder}/game",
        "environment": [],
        "externalConsole": false,
        "preLaunchTask": "dev_build"
    }

Clone this wiki locally