GDScript to C# type mapping library for Godot Engine 4.5.1. Part of the GDShrapt project family for GDScript static analysis. Provides comprehensive type metadata that bridges GDScript type names to their C# equivalents in Godot's GodotSharp bindings. Features: - Maps 1700+ Godot types with methods, properties, signals, enums, and constants - Three data sources: embedded manifest, external JSON file, or live assembly extraction - Works standalone (CLI tools, LSP servers) or inside Godot runtime - GDTypeExtractorNode base class for in-editor data extraction - Detailed parameter info, return types, and generic type support - Metadata tracking with Godot version and extraction timestamp
$ dotnet add package GDShrapt.TypesMapA GDScript to C# type mapping library for Godot Engine. Part of the GDShrapt project family for GDScript static analysis.
GDShrapt.TypesMap provides comprehensive type metadata that bridges GDScript type names to their C# equivalents in Godot's GodotSharp bindings. It extracts and exposes information about:
| Category | Count |
|---|---|
| Types | 1,708 |
| Global Methods | 120 |
| Global Enums | 21 |
| Global Constants | 4 |
dotnet add package GDShrapt.TypesMap
Or add to your .csproj:
<PackageReference Include="GDShrapt.TypesMap" Version="4.5.1.0" />
using GDShrapt.TypesMap;
// 1. Load from embedded manifest (recommended for standalone/CLI)
// Works without Godot runtime - ideal for CLI tools and LSP servers
var data = GDTypeHelper.ExtractTypeDatasFromManifest();
// 2. Load from external JSON file
var data = GDTypeHelper.ExtractTypeDatasFromFile("path/to/AssemblyData.json");
// 3. Extract from GodotSharp assembly at runtime (requires Godot)
var data = GDTypeHelper.ExtractTypeDatasFromAssembly();
// Save to specific path
GDTypeHelper.SaveAssemblyDataToFile(data, "path/to/save.json");
// Save to default location (next to executing assembly)
GDTypeHelper.SaveAssemblyDataToFile(data);
using Godot;
using GDShrapt.TypesMap;
[Tool]
public partial class MyTypeExtractor : GDTypeExtractorNode
{
public override void _Ready()
{
if (Engine.IsEditorHint())
{
OutputPath = "res://data/AssemblyData.json";
ExtractAndSave();
}
}
}
var data = GDTypeHelper.ExtractTypeDatasFromManifest();
// Check metadata
Console.WriteLine($"Godot version: {data?.Metadata?.GodotVersion}");
Console.WriteLine($"Source: {data?.Metadata?.Source}");
// Access global methods
if (data?.GlobalData?.MethodDatas.TryGetValue("print", out var printMethods))
{
foreach (var method in printMethods)
{
Console.WriteLine($"print -> {method.CSharpName}");
}
}
// Access global constants
var pi = data?.GlobalData?.Constants["PI"];
Console.WriteLine($"PI constant: {pi?.Value}");
// Access type data
if (data?.TypeDatas.TryGetValue("Node2D", out var node2dVersions))
{
var node2d = node2dVersions.Values.First();
// Get properties
var position = node2d.PropertyDatas?["position"];
Console.WriteLine($"position -> {position?.CSharpName} ({position?.CSharpTypeName})");
}
GDAssemblyData
├── Metadata # Version and source info
│ ├── GodotVersion # e.g., "4.5.1"
│ ├── DataFormatVersion # For compatibility (currently 1)
│ ├── ExtractedAt # UTC timestamp
│ ├── Source # "Assembly", "File", or "Manifest"
│ └── SourcePath # File path (when Source is "File")
├── GlobalData # Global scope data
│ ├── MethodDatas # Global methods (print, lerp, abs, etc.)
│ ├── PropertyDatas # Global properties
│ ├── Constants # Global constants (PI, TAU, INF, NAN)
│ ├── Enums # Global enums (Error, Key, etc.)
│ └── GlobalTypes # Built-in types (int, float, Vector2, etc.)
└── TypeDatas # Per-type data indexed by GDScript name
└── GDTypeData
├── MethodDatas # Methods with GDScript→C# name mapping
├── PropertyDatas # Properties with type info
├── SignalDatas # Signals with delegate info
├── Enums # Nested enums
└── Constants # Type constants
| Type | Description |
|---|---|
GDTypeHelper | Main entry point - extraction and save methods |
GDTypeExtractorNode | Base Node class for Godot editor extraction |
GDAssemblyData | Root container with metadata |
GDAssemblyMetadata | Version and source information |
GDGlobalData | Global scope metadata |
GDTypeData | Per-class type metadata |
GDMethodData | Method signature with parameters |
GDPropertyData | Property information with types |
GDSignalData | Signal/event information |
GDParameterInfo | Detailed parameter metadata |
GDEnumTypeInfo | Enum value mappings |
GDConstantInfo | Constant metadata |
GDGlobalTypeProxyInfo | Built-in type proxies |
Properties use clear prefixes to distinguish GDScript vs C# names:
GDScriptName, GDScriptTypeName - GDScript identifiers (snake_case)CSharpName, CSharpTypeName, CSharpTypeFullName - C# identifiers (PascalCase)This library is designed to work with:
IGDRuntimeProvider)Example integration with validator:
// Create runtime provider backed by TypesMap data
var assemblyData = GDTypeHelper.ExtractTypeDatasFromManifest();
var runtimeProvider = new CustomRuntimeProvider(assemblyData);
// Use with GDShrapt.Validator
var options = new GDValidationOptions
{
RuntimeProvider = runtimeProvider
};
This library is part of the GDShrapt ecosystem:
| Package | Description | NuGet |
|---|---|---|
| GDShrapt.Reader | GDScript parser and AST | |
| GDShrapt.Converter | GDScript to C# converter | |
| GDShrapt.TypesMap | Type mapping library |
MIT License - see LICENSE for details.