Skip to content

Conversation

@Bromeon
Copy link
Member

@Bromeon Bromeon commented Oct 22, 2025

Outlawed no_init for editor plugins

The Godot editor requires default-constructible plugins. Using no_init will cause an error and may even crash the editor:

#[derive(GodotClass)]
#[class(no_init, base = EditorPlugin, tool)]
struct CustomEditorPlugin;
image

After this change, this emits a warning. Deprecated due to SemVer, will become a hard error in v0.5.

image

Better errors for removed proc-macro APIs

This also turns some already removed proc-macro APIs into readable errors:

  • #[class(editor_plugin)]
  • #[class(hidden)]
  • #[init(default = ...)]

Before -- those were deprecated, but the referenced symbols were already removed, resulting in compile errors:
image

After:
image

The Godot editor requires default-constructible plugins. Using `no_init` will cause
an error when opened in the editor.
Concerns:
- #[class(editor_plugin)]
- #[class(hidden)]
- #[init(default = ...)]

Those already caused compile errors, since the deprecation functions no longer existed, so this
is not a breaking change. However, the new approach produces more readable errors.
@Bromeon Bromeon added bug c: register Register classes, functions and other symbols to GDScript labels Oct 22, 2025
@Bromeon Bromeon added this pull request to the merge queue Oct 22, 2025
Merged via the queue into master with commit 8f92a08 Oct 22, 2025
18 checks passed
@Bromeon Bromeon deleted the bugfix/editor-plugin-no-init branch October 22, 2025 15:31
@GodotRust
Copy link

API docs are being generated and will be shortly available at: https://godot-rust.github.io/docs/gdext/pr-1378

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug c: register Register classes, functions and other symbols to GDScript

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants