mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2025-08-31 02:07:21 +00:00
Parse doc comments on node parameters (#2163)
Parse doc comments from node arguments Co-authored-by: Keavon Chambers <keavon@keavon.com>
This commit is contained in:
parent
6c3c2e8529
commit
1639a2afba
3 changed files with 36 additions and 0 deletions
|
@ -59,6 +59,13 @@ pub(crate) fn generate_node_code(parsed: &ParsedNodeFn) -> syn::Result<TokenStre
|
|||
})
|
||||
.collect();
|
||||
|
||||
let input_descriptions: Vec<_> = fields
|
||||
.iter()
|
||||
.map(|field| match field {
|
||||
ParsedField::Regular { description, .. } | ParsedField::Node { description, .. } => description,
|
||||
})
|
||||
.collect();
|
||||
|
||||
let struct_fields = field_names.iter().zip(struct_generics.iter()).map(|(name, gen)| {
|
||||
quote! { pub(super) #name: #gen }
|
||||
});
|
||||
|
@ -263,6 +270,7 @@ pub(crate) fn generate_node_code(parsed: &ParsedNodeFn) -> syn::Result<TokenStre
|
|||
#(
|
||||
FieldMetadata {
|
||||
name: #input_names,
|
||||
description: #input_descriptions,
|
||||
exposed: #exposed,
|
||||
value_source: #value_sources,
|
||||
number_min: #number_min_values,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue