Skip to content

Commit 23ecd15

Browse files
committed
Add a doc to point users to kwarg builders
A frequent issue that comes up with people that are first using the library is that they don't know about gdext's unique model for Gdscript's default function arguments. This gently points users to the builder functions. Documenting every method this way is a little spammy since users only need to learn about this API once, but it's only one line, so I don't think it impacts scrolling distances much on the doc site.
1 parent 7634fe7 commit 23ecd15

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

godot-codegen/src/generator/default_parameters.rs

+3
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,9 @@ pub fn make_function_definition_with_defaults(
9797
};
9898

9999
let functions = quote! {
100+
#[doc = "To set the default parameters, use [`"]
101+
#[doc = stringify!(Self::#extended_fn_name)]
102+
#[doc = "`] and its builder methods."]
100103
#[inline]
101104
#vis fn #simple_fn_name(
102105
#receiver_param

0 commit comments

Comments
 (0)