williamoberg / godot-dotnet-tools

Generate .NET related files for your Godot project
https://marketplace.visualstudio.com/items?itemName=woberg.godot-dotnet-tools
MIT License
9 stars 0 forks source link

Godot .NET Tools

Generate .NET-related files for your Godot project in VSCode.

Requirements

Features

Installation

Install via the extensions marketplace by searching for:

woberg.godot-dotnet-tools

Open the Command Palette (Ctrl + Shift + P) and select:

Godot .NET: Generate files for Godot project

cmd palette command

If the path to your Godot executable is not set in the user settings (More info), you will be asked to select the path to your Godot executable in a file dialog when generating the files.

#

The extension will generate 3 files inside the .vscode folder in the current workspace.

files

launch.json:

tasks.json:

ruleset.xml:

Configuration

To be able to launch your project, you first need to set the path to your Godot executable in the user settings. The settings can be found under Extensions/Godot .Net.

settings

Alternatively, you can set the executable path in your settings.json file:

settings.json

Optional

The generated ruleset.xml file contains one rule ID: (CA1050).

ruleset

This rule warns about encapsulating all your classes inside namespaces. In a Godot project this might not necessarily be wanted, so the rule is silenced by default.

namespace warning

For the ruleset to work, it is also added to the .csproj file.

The ruleset.xml file is of course not necessary and can be deleted if it's not wanted, but if it is, the .csproj file will need to be edited to resolve any issues related to omnisharp.

Simply remove the line shown below.

csproj

If the ruleset.xml is not desired at all, there is a configuration setting available to disable it's generation completely. More info

Launching and debugging

Open the debug view in your VSCode workspace and there should now be 3 options available.

debug option

You will now be able to set break points, enabling you to step through your code after launching your project.

break point

Extension Settings

There are 4 available configuration settings for the extension which enable you to set your Godot executable path and choose what files are generated:

These configurations are available in the user settings under Extensions/Godot .NET.

You can also add and edit them in your settings.json file.