rextendr icon indicating copy to clipboard operation
rextendr copied to clipboard

Documenting struct methods

Open avhz opened this issue 8 months ago • 3 comments

Hi, thanks for the nice work here :)

Just checking, it's not currently possible to document struct methods ?

/// Return string `"Hello world!"` to R.
/// @export
#[extendr]
fn hello_world() -> &'static str {
    "Hello world!"
}

/// Foo struct.
///
/// @export
struct Foo {
    x: i32,
}

#[extendr]
impl Foo {
    /// Create a new Foo instance.
    ///
    /// @export
    fn new(x: i32) -> Self {
        Foo { x }
    }
}

hello_world gets roxygen docs, but Foo$new() does not. This is an R limitation right, or am I missing some config, etc ?

Cheers !

avhz avatar Apr 13 '25 10:04 avhz