godotengine / godotengine/godot-dotnet

Source Generator registers classes inheriting editor time classes (plugins) too early.

Open
#26 1 comment 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area-Godot.SourceGeneration enhancement
Dominant language
C#
Stars
228
Forks
30
PR merge metrics
No merged PRs in 30d

Description

Godot version

4.4.dev.nixpkgs.77dcf97d8

Godot .NET packages version

4.4.0-dev (eff114039e)

System information

NixOS 24.11

.NET information

9.0.100-rc.1.24452.12

Issue description

Editor time classes (plugins) are only registered at an Initialization Level of Editor but the source generator will register them at Scene which will cause them to fail as their base classes have not been registered

Steps to reproduce
[GodotClass]
class SomePlugin : EditorPlugin {}

The source gen will register this class before the godot engine registers EditorPlugin

Minimal reproduction project

N/A

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the C# source-generator registration logic and the initialization-level handling for EditorPlugin and other editor-time classes. Reproduce the issue with the provided SomePlugin : EditorPlugin example and trace why it is registered at Scene instead of Editor. Done means the generated registration occurs after the base editor class is available and the example no longer fails.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
game-dev, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.