godot-csharp-vscode icon indicating copy to clipboard operation
godot-csharp-vscode copied to clipboard

Plugin does not rebuild project upon launching game via debug configuration

Open Pkshields opened this issue 5 years ago • 1 comments

OS/device including version: macOS 10.15.5 Godot version: v3.2.2.stable.mono.official VSCode version: 1.47.2

Reproduction details:

  1. Create a Godot C# launch.json via VSCode's debug view.
  2. Configure the Launch configuration with the correct path to the Godot executable
  3. Run the game via the Launch configuration, then close the game.
  4. Add a Console.WriteLine line to a method on any attached script in the main scene.
  5. Run the game via the Launch configuration again.

Expected: Any changes made to a script will be included when you launch the game via VSCode's debugger. Actual: The project is not rebuilt when launching the game and the contents of the Console.WriteLine will not be printed to the debug output.

Notes: The same behaviour is noticed when running the Godot via the command line. Running Godot --path <PATH_TO_PROJECT> directly does not pick up any changes to a C# script. If I run msbuild <PROJECT>.sln first however, the script changes will then be picked up by the Godot command.

Pkshields avatar Jul 26 '20 15:07 Pkshields

If anyone looking for workaround: you can create a build task and add use it as prelaunch task. My configurations for MS Windwos looks like: tasks.json { "version": "2.0.0", "tasks": [ { "label": "mybuild", "command": "dotnet.EXE", "args": [ "msbuild", "${workspaceRoot}/C Sharp.sln", "/t:Build" ], "type": "shell", "problemMatcher": [], "group": { "kind": "build", "isDefault": true } } ] } launch.json { // Use IntelliSense to learn about possible attributes. // Hover to view descriptions of existing attributes. // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 "version": "0.2.0", "configurations": [ { "name": "Play in Editor", ... }, { "name": "Launch", "type": "godot-mono", "request": "launch", "mode": "executable", "executable": "${workspaceRoot}/Godot.exe", "executableArguments": [ "--path", "${workspaceRoot}" ], "preLaunchTask": "mybuild" }, { "name": "Attach", ... } ] }

myuniquename avatar Oct 04 '20 21:10 myuniquename