Skip to content

Commit 11ba6ee

Browse files
authored
Merge pull request #1247 from godot-rust/bugfix/reexport-dict
Re-export deprecated `dict!` macro
2 parents 8845d8e + 442283f commit 11ba6ee

File tree

5 files changed

+21
-4
lines changed

5 files changed

+21
-4
lines changed

godot-core/src/builtin/mod.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@ pub mod __prelude_reexport {
5050

5151
pub use super::{EulerOrder, Side, VariantOperator, VariantType};
5252
pub use crate::{array, real, reals, varray, vdict, vslice};
53+
54+
#[allow(deprecated)]
55+
pub use crate::dict;
5356
}
5457

5558
pub use __prelude_reexport::*;

godot-macros/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ api-custom-json = ["godot-bindings/api-custom-json"]
1616
codegen-full = ["godot/__codegen-full"]
1717
experimental-wasm = []
1818
register-docs = ["dep:markdown", "dep:litrs"]
19+
trace = []
1920

2021
[lib]
2122
proc-macro = true

godot-macros/src/class/derive_godot_class.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -667,14 +667,18 @@ fn parse_fields(
667667
parser.finish()?;
668668
}
669669

670+
// TODO(v0.3.5): re-enable groups. Currently enabled in tests.
671+
670672
// #[export_group(name = ..., prefix = ...)]
673+
#[cfg(feature = "trace")]
671674
if let Some(mut parser) = KvParser::parse(&named_field.attributes, "export_group")? {
672675
let group = FieldGroup::new_from_kv(&mut parser)?;
673676
field.group = Some(group);
674677
parser.finish()?;
675678
}
676679

677680
// #[export_subgroup(name = ..., prefix = ...)]
681+
#[cfg(feature = "trace")]
678682
if let Some(mut parser) = KvParser::parse(&named_field.attributes, "export_subgroup")? {
679683
let subgroup = FieldGroup::new_from_kv(&mut parser)?;
680684
field.subgroup = Some(subgroup);

godot-macros/src/lib.rs

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,7 @@ use crate::util::{bail, ident, KvParser};
300300
/// }
301301
/// ```
302302
///
303+
/*
303304
/// It is possible to group your exported properties inside the Inspector with the `#[export_group(name = "...", prefix = "...")]` attribute.
304305
/// 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.
305306
///
@@ -357,6 +358,7 @@ use crate::util::{bail, ident, KvParser};
357358
///```
358359
///
359360
///
361+
*/
360362
/// ## Low-level property hints and usage
361363
///
362364
/// You can specify custom property hints, hint strings, and usage flags in a `#[var]` attribute using the `hint`, `hint_string`
@@ -539,9 +541,16 @@ use crate::util::{bail, ident, KvParser};
539541
alias = "tool",
540542
alias = "rename"
541543
)]
542-
#[proc_macro_derive(
543-
GodotClass,
544-
attributes(class, base, hint, var, export, export_group, export_subgroup, init)
544+
#[cfg_attr(
545+
feature = "trace",
546+
proc_macro_derive(
547+
GodotClass,
548+
attributes(class, init, base, hint, var, export, export_group, export_subgroup)
549+
)
550+
)]
551+
#[cfg_attr(
552+
not(feature = "trace"),
553+
proc_macro_derive(GodotClass, attributes(class, init, base, hint, var, export))
545554
)]
546555
pub fn derive_godot_class(input: TokenStream) -> TokenStream {
547556
translate(input, class::derive_godot_class)

godot/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ default = ["__codegen-full"]
4848
# Private features, they are under no stability guarantee
4949
__codegen-full = ["godot-core/codegen-full", "godot-macros/codegen-full"]
5050
__debug-log = ["godot-core/debug-log"]
51-
__trace = ["godot-core/trace"]
51+
__trace = ["godot-core/trace", "godot-macros/trace"]
5252

5353
[dependencies]
5454
godot-core = { path = "../godot-core", version = "=0.3.3" }

0 commit comments

Comments
 (0)