godotengine / godot-csharp-vscode

Debugger and utilities for working with Godot C# projects in VSCode
https://marketplace.visualstudio.com/items?itemName=neikeq.godot-csharp-vscode
MIT License
145 stars 27 forks source link

Running from vscode doesn't work #23

Closed tapir closed 2 years ago

tapir commented 3 years ago

To configure a project for debugging open the Godot project folder in VS Code. Go to the Run tab and click on create a launch.json file. Select C# Godot from the dropdown menu. Now, when you start the debugger in VS Code your Godot project will run.

This is from the official website however there is no option of "C# Godot" in launch.json options. Everything else works ok.

jiriks74 commented 3 years ago

I have the same issue. Any fix found yet?

jiriks74 commented 3 years ago

@tapir I have temporary fix: I took the launch.json from this image:

``` { "version": "0.2.0", "configurations": [ { "name": "Play in Editor", "type": "godot-mono", "mode": "playInEditor", "request": "launch" }, { "name": "Launch", "type": "godot-mono", "request": "launch", "mode": "executable", "executable": "${workspaceRoot}/Godot.exe", "executableArguments": [ "--path", "${workspaceRoot}" ] }, { "name": "Attach", "type": "godot-mono", "request": "attach", "address": "localhost", "port": 23685 } ] } ```
raulsntos commented 2 years ago

The launch.json options are context dependent, which means you will get different options based on which file is currently open and focused. Try following the README.md steps without any file opened in VSCode.

PR #22 should fix the package.json configuration so the context dependent option shows up for C# files. It also adds a command to generate launch.json from the command palette (Ctrl + P) which may be useful.