-
Notifications
You must be signed in to change notification settings - Fork 9
Configuring VSCode
Valk edited this page Sep 28, 2024
·
20 revisions
- Install Visual Studio Code
- In VSCode > Open Folder >
Template\GodotProject
- Install the extensions that should automatically get recommended to you
- Press
F1
and typeC# Godot: Select Project
and select the Godot project (a bit buggy but seems to resolve itself after some time)
These are my user settings, use them if you want.
{
"editor.fontSize": 24,
"editor.renderWhitespace": "none",
"editor.autoClosingDelete": "always",
"editor.mouseWheelScrollSensitivity": 1.5,
"editor.formatOnPaste": true,
"editor.formatOnType": true,
"workbench.colorTheme": "Tokyo Night Storm",
"explorer.confirmDelete": false,
"explorer.confirmDragAndDrop": false,
"breakpointHighlight.backgroundColor": "#742527"
}
Create a launch.json
with the following contents. Replace all program paths with the path to your Godot executable.
{
"version": "0.2.0",
"configurations": [
// For these launch configurations to work, you need to setup a GODOT
// environment variable. On mac or linux, this can be done by adding
// the following to your .zshrc, .bashrc, or .bash_profile file:
// export GODOT="/Applications/Godot.app/Contents/MacOS/Godot"
{
"name": "🕹 Debug Game",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "C:/Users/VALK-DESKTOP/Downloads/Godot_v4.3-stable_mono_win64/Godot_v4.3-stable_mono_win64.exe",
"args": [],
"cwd": "${workspaceFolder}",
"stopAtEntry": false,
"console": "integratedTerminal"
},
// Debug the scene that matches the name of the currently open *.cs file
// (if there's a scene with the same name in the same directory).
{
"name": "🎭 Debug Current Scene",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "C:/Users/VALK-DESKTOP/Downloads/Godot_v4.3-stable_mono_win64/Godot_v4.3-stable_mono_win64.exe",
"args": [
"${fileDirname}/${fileBasenameNoExtension}.tscn"
],
"cwd": "${workspaceFolder}",
"stopAtEntry": false,
"console": "integratedTerminal"
},
{
"name": "🧪 Debug Tests",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "C:/Users/VALK-DESKTOP/Downloads/Godot_v4.3-stable_mono_win64/Godot_v4.3-stable_mono_win64.exe",
"args": [
// These command line flags are used by GoDotTest to run tests.
"--run-tests",
"--quit-on-finish"
],
"cwd": "${workspaceFolder}",
"stopAtEntry": false,
"console": "integratedTerminal"
},
{
"name": "🔬 Debug Current Test",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "C:/Users/VALK-DESKTOP/Downloads/Godot_v4.3-stable_mono_win64/Godot_v4.3-stable_mono_win64.exe",
"args": [
// These command line flags are used by GoDotTest to run tests.
"--run-tests=${fileBasenameNoExtension}",
"--quit-on-finish"
],
"cwd": "${workspaceFolder}",
"stopAtEntry": false,
"console": "integratedTerminal"
},
]
}
Create a tasks.json
file with the following contents. Replace all program paths with the path to your Godot executable.
{
"version": "2.0.0",
"tasks": [
{
"label": "build",
"command": "dotnet",
"type": "process",
"args": [
"build",
"${workspaceFolder}/Template.csproj"
],
"problemMatcher": "$msCompile",
"presentation": {
"echo": true,
"reveal": "silent",
"focus": false,
"panel": "shared",
"showReuseMessage": false,
"clear": false
}
},
{
"label": "coverage",
"group": "test",
"command": "${workspaceFolder}/coverage.sh",
"type": "shell",
"options": {
"cwd": "${workspaceFolder}"
},
"presentation": {
"echo": true,
"reveal": "always",
"focus": false,
"panel": "shared",
"showReuseMessage": false,
"clear": true
},
},
{
"label": "build-solutions",
"group": "test",
"command": "dotnet restore; C:/Users/VALK-DESKTOP/Downloads/Godot_v4.3-stable_mono_win64/Godot_v4.3-stable_mono_win64.exe --headless --build-solutions --quit || exit 0",
"type": "shell",
"options": {
"cwd": "${workspaceFolder}"
},
"presentation": {
"echo": true,
"reveal": "silent",
"focus": false,
"panel": "shared",
"showReuseMessage": false,
"clear": false
}
},
]
}