Visual Studio Code

Visual Studio Code is a free cross-platform code editor by Microsoft (not to be confused with Visual Studio).

Importing the project

  • official documentation. Alternatively, clangd can be used instead.
  • scons compiledb=yes.
  • File > Open Folder….
  • Configure Task.
  • Create tasks.json file from template option.
  • Others.
  • tasks.json file find the "tasks" array and add a new section to it: Linux/X11Windows
    1. { "label": "build", "group": "build", "type": "shell", "command": "scons", "args": [ "-j $(nproc)" ], "problemMatcher": "$msCompile"}
    1. { "label": "build", "group": "build", "type": "shell", "command": "scons", "args": [ // Use this when your default shell is Command Prompt (cmd.exe). "-j %NUMBER_OF_PROCESSORS%", // Use this when your default shell is PowerShell. "-j $env:NUMBER_OF_PROCESSORS" ], "problemMatcher": "$msCompile"}
    tasks.json. Introduction to the buildsystem for a full list of arguments.

    Debugging the project

    launch.json file.
  • Press Ctrl + Shift + D to open the Run panel.
  • launch.json file is missing you will be prompted to create a new one.
  • C++ (GDB/LLDB). There may be another platform specific option here. If selected, adjust the configuration example provided accordingly.
  • launch.json file find the "configurations" array and add a new section to it: X11X11_gdbWindows
    1. { "name": "Launch Project", "type": "lldb", "request": "launch", // Change to godot.x11.tools.64.llvm for llvm-based builds. "program": "${workspaceFolder}/bin/godot.x11.tools.64", // Change the arguments below for the project you want to test with. // To run the project instead of editing it, remove the "--editor" argument. "args": [ "--editor", "--path", "path-to-your-godot-project-folder" ], "stopAtEntry": false, "cwd": "${workspaceFolder}", "environment": [], "externalConsole": false, "preLaunchTask": "build"}
    1. { "name": "Launch Project", "type": "cppdbg", "request": "launch", // Change to godot.x11.tools.64.llvm for llvm-based builds. "program": "${workspaceFolder}/bin/godot.x11.tools.64", // Change the arguments below for the project you want to test with. // To run the project instead of editing it, remove the "--editor" argument. "args": [ "--editor", "--path", "path-to-your-godot-project-folder" ], "stopAtEntry": false, "cwd": "${workspaceFolder}", "environment": [], "externalConsole": false, "setupCommands": [ { "description": "Enable pretty-printing for gdb", "text": "-enable-pretty-printing", "ignoreFailures": true } ], "preLaunchTask": "build"}
    1. { "name": "Launch Project", "type": "cppvsdbg", "request": "launch", "program": "${workspaceFolder}/bin/godot.windows.tools.64.exe", // Change the arguments below for the project you want to test with. // To run the project instead of editing it, remove the "--editor" argument. "args": [ "--editor", "--path", "path-to-your-godot-project-folder" ], "stopAtEntry": false, "cwd": "${workspaceFolder}", "environment": [], "console": "internalConsole", "visualizerFile": "${workspaceFolder}/platform/windows/godot.natvis", "preLaunchTask": "build"}
    launch.json. Note CodeLLDB extension is installed. If you encounter issues with lldb, you may consider using gdb (see the X11_gdb configuration). Compiling for X11 (Linux, *BSD) for further information. program depends on your build configuration, e.g. godot.x11.tools.64 for 64-bit X11 platform with tools enabled. Godot’s community channels.