@@ -301,7 +301,7 @@ use crate::util::{bail, ident, KvParser};
301
301
/// ```
302
302
///
303
303
/// To declare groups and subgroups append `group` key to a `#[export]` attribute. Fields without group will be exported first,
304
- /// followed by properties with subgroup only, tailed by ones with group declaration.
304
+ /// followed by properties with group only, tailed by ones with group & subgroup declarations. Relative order of fields is being preserved
305
305
///
306
306
///```
307
307
/// # use godot::prelude::*;
@@ -316,17 +316,30 @@ use crate::util::{bail, ident, KvParser};
316
316
/// #[export]
317
317
/// will_be_displayed_as_1st: i64,
318
318
///
319
- /// #[export(subgroup = "my_other_subgroup_with_no_group ")]
320
- /// will_be_displayed_as_the_2nd : i64,
319
+ /// #[export(group = "my_other_group ")]
320
+ /// will_be_displayed_as_the_3rd : i64,
321
321
///
322
322
/// #[export(range = (0.0, MAX_HEALTH), group = "my_group")]
323
- /// will_be_displayed_as_3rd : f64,
323
+ /// will_be_displayed_as_2nd : f64,
324
324
///
325
325
/// #[export(group = "last_group")]
326
326
/// will_be_displayed_last: i64
327
327
/// }
328
328
///```
329
329
///
330
+ /// Using subgroup with no group specified is not allowed and will result in compile error.
331
+ ///
332
+ /// ```compile_fail
333
+ /// # use godot::prelude::*;
334
+ ///
335
+ /// #[derive(GodotClass)]
336
+ /// # #[class(init)]
337
+ /// struct MyStruct {
338
+ /// #[export(subgroup = "my_subgroup")]
339
+ /// illegal: u32
340
+ /// }
341
+ /// ```
342
+ ///
330
343
/// ## Low-level property hints and usage
331
344
///
332
345
/// You can specify custom property hints, hint strings, and usage flags in a `#[var]` attribute using the `hint`, `hint_string`
0 commit comments