nih-plug icon indicating copy to clipboard operation
nih-plug copied to clipboard

Correct group parameter name in `Params` struct's attribute docs

Open kneitinger opened this issue 10 months ago • 0 comments

Summary

This corrects a small error in the Params struct's docs where the attribute that should be group is documented as group_name e.g. https://github.com/robbert-vdh/nih-plug/blob/400eb3156f221073fbcaf95607b56842272d134b/src/params.rs#L252

Definition of the attribute in the derive crate:

https://github.com/robbert-vdh/nih-plug/blob/400eb3156f221073fbcaf95607b56842272d134b/nih_plug_derive/src/params.rs#L135-L137

https://github.com/robbert-vdh/nih-plug/blob/400eb3156f221073fbcaf95607b56842272d134b/nih_plug_derive/src/params.rs#L179

Demo

Use of the documented attribute name fails to compile

pub struct NightgrainParams {
    #[persist = "editor-state"]
    pub editor_state: Arc<ViziaState>,

    #[nested(array, group_name = "Grain Parameters")]
    pub grain_params: [Arc<GrainParams>; GRAIN_OSC_COUNT],
}
$ cargo xtask bundle nightgrain                                                                                                                                                                                                        25-04-06 12:29:56 (1)
    Finished `release` profile [optimized] target(s) in 0.06s
     Running `target/release/xtask bundle nightgrain`
   Compiling nightgrain v0.1.0 (/home/leaf/c/music/r/nightgrain/nightgrain)
error: Unknown attribute. See the Params trait documentation for more information.
  --> nightgrain/src/params.rs:23:21
   |
23 |     #[nested(array, group_name = "Grain Parameters")]
   |                     ^^^^^^^^^^

...

Use of the correct attribute name compiles

#[derive(Params)]
pub struct NightgrainParams {
    #[persist = "editor-state"]
    pub editor_state: Arc<ViziaState>,

    #[nested(array, group = "Grain Parameters")]
    pub grain_params: [Arc<GrainParams>; GRAIN_OSC_COUNT],
}
 $ cargo xtask bundle nightgrain                                                                                                                                                                                                        25-04-06 12:33:46 (0)
    Finished `release` profile [optimized] target(s) in 0.06s
     Running `target/release/xtask bundle nightgrain`
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.08s

Created a VST3 bundle at '/home/leaf/c/music/r/nightgrain/target/bundled/nightgrain.vst3'       

kneitinger avatar Apr 06 '25 19:04 kneitinger