Skip to content

Add a doc to point users to kwarg builders #876

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions godot-codegen/src/generator/default_parameters.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ pub fn make_function_definition_with_defaults(

let simple_fn_name = safe_ident(sig.name());
let extended_fn_name = format_ident!("{}_ex", simple_fn_name);
let default_parameter_usage = format!("To set the default parameters, use [`Self::{}`] and its builder methods. See [the book](https://godot-rust.github.io/book/godot-api/functions.html#default-parameters) for detailed usage instructions.", extended_fn_name);
let vis = functions_common::make_vis(sig.is_private());

let (builder_doc, surround_class_prefix) = make_extender_doc(sig, &extended_fn_name);
Expand Down Expand Up @@ -101,6 +102,7 @@ pub fn make_function_definition_with_defaults(
};

let functions = quote! {
#[doc = #default_parameter_usage]
#[inline]
#vis fn #simple_fn_name(
#receiver_param
Expand Down
Loading