-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Closed
Labels
A-ECSEntities, components, systems, and eventsEntities, components, systems, and eventsC-DocsAn addition or correction to our documentationAn addition or correction to our documentationC-FeatureA new feature, making something new possibleA new feature, making something new possibleX-BlessedHas a large architectural impact or tradeoffs, but the design has been endorsed by decision makersHas a large architectural impact or tradeoffs, but the design has been endorsed by decision makers
Milestone
Description
What problem does this solve or what need does it fill?
As a user of components with Required Components (#14791),
I want to see what other components are going to be inserted easily.
What solution would you like?
Adding the #[required(…)] attribute should also add a doc comment.
This will be shown by many IDEs when hovering (or similar) over the type.
Example
/// Makes entity behave like a button by adding sparkle effects on hover.
#[derive(Component)]
#[require(Node, UiImage)]
struct Button;generates
/// Makes entity behave like a button by adding sparkle effects on hover.
///
/// # Automatically added components
///
/// When inserting this component,
/// [`Node`], and [`UiImage`]
// are also inserted if not already present.
struct Button;What alternative(s) have you considered?
- Telling people to do this manually
- Hoping that IDEs will do something else to show this
Additional context
#14791 is only proposed as of writing this.
This issue may become invalid if it not accepted in its current state.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
A-ECSEntities, components, systems, and eventsEntities, components, systems, and eventsC-DocsAn addition or correction to our documentationAn addition or correction to our documentationC-FeatureA new feature, making something new possibleA new feature, making something new possibleX-BlessedHas a large architectural impact or tradeoffs, but the design has been endorsed by decision makersHas a large architectural impact or tradeoffs, but the design has been endorsed by decision makers