Skip to content

Re-export deprecated dict! macro #1247

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 22, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions godot-core/src/builtin/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ pub mod __prelude_reexport {

pub use super::{EulerOrder, Side, VariantOperator, VariantType};
pub use crate::{array, real, reals, varray, vdict, vslice};

#[allow(deprecated)]
pub use crate::dict;
}

pub use __prelude_reexport::*;
Expand Down
1 change: 1 addition & 0 deletions godot-macros/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ api-custom-json = ["godot-bindings/api-custom-json"]
codegen-full = ["godot/__codegen-full"]
experimental-wasm = []
register-docs = ["dep:markdown", "dep:litrs"]
trace = []

[lib]
proc-macro = true
Expand Down
4 changes: 4 additions & 0 deletions godot-macros/src/class/derive_godot_class.rs
Original file line number Diff line number Diff line change
Expand Up @@ -667,14 +667,18 @@ fn parse_fields(
parser.finish()?;
}

// TODO(v0.3.5): re-enable groups. Currently enabled in tests.

// #[export_group(name = ..., prefix = ...)]
#[cfg(feature = "trace")]
if let Some(mut parser) = KvParser::parse(&named_field.attributes, "export_group")? {
let group = FieldGroup::new_from_kv(&mut parser)?;
field.group = Some(group);
parser.finish()?;
}

// #[export_subgroup(name = ..., prefix = ...)]
#[cfg(feature = "trace")]
if let Some(mut parser) = KvParser::parse(&named_field.attributes, "export_subgroup")? {
let subgroup = FieldGroup::new_from_kv(&mut parser)?;
field.subgroup = Some(subgroup);
Expand Down
15 changes: 12 additions & 3 deletions godot-macros/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,7 @@ use crate::util::{bail, ident, KvParser};
/// }
/// ```
///
/*
/// It is possible to group your exported properties inside the Inspector with the `#[export_group(name = "...", prefix = "...")]` attribute.
/// Every exported property after this attribute will be added to the group. Start a new group or use `#[export_group(name = "")]` (with an empty name) to break out.
///
Expand Down Expand Up @@ -357,6 +358,7 @@ use crate::util::{bail, ident, KvParser};
///```
///
///
*/
/// ## Low-level property hints and usage
///
/// You can specify custom property hints, hint strings, and usage flags in a `#[var]` attribute using the `hint`, `hint_string`
Expand Down Expand Up @@ -539,9 +541,16 @@ use crate::util::{bail, ident, KvParser};
alias = "tool",
alias = "rename"
)]
#[proc_macro_derive(
GodotClass,
attributes(class, base, hint, var, export, export_group, export_subgroup, init)
#[cfg_attr(
feature = "trace",
proc_macro_derive(
GodotClass,
attributes(class, init, base, hint, var, export, export_group, export_subgroup)
)
)]
#[cfg_attr(
not(feature = "trace"),
proc_macro_derive(GodotClass, attributes(class, init, base, hint, var, export))
)]
pub fn derive_godot_class(input: TokenStream) -> TokenStream {
translate(input, class::derive_godot_class)
Expand Down
2 changes: 1 addition & 1 deletion godot/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ default = ["__codegen-full"]
# Private features, they are under no stability guarantee
__codegen-full = ["godot-core/codegen-full", "godot-macros/codegen-full"]
__debug-log = ["godot-core/debug-log"]
__trace = ["godot-core/trace"]
__trace = ["godot-core/trace", "godot-macros/trace"]

[dependencies]
godot-core = { path = "../godot-core", version = "=0.3.3" }
Expand Down
Loading