Skip to content
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 by Bors] - Mention world_query(ignore) attribute for WorldQuery derivation #6309

Closed
wants to merge 2 commits into from

Conversation

x3ro
Copy link
Contributor

@x3ro x3ro commented Oct 19, 2022

Objective

Add documentation #[world_query(ignore)]. Fixes #6283.


I've only described it's behavior so far (which appears to be the same as with system_param). Is there another use-case for this besides with PhantomData? I could only find a single usage of this construct on GitHub, which is here.

I was also wondering if it would make sense to add a usage example to the custom_query_example? 🤔 That's why it's currently still in there.

///
/// * also implements `WorldQuery`, or
/// * is marked with `#[world_query(ignore)]`. Fields decorated with this attribute
/// will be created with the default value upon realisation.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please explicitly mention that Default is both required to be implemented and used in this case.

Copy link
Contributor Author

@x3ro x3ro Oct 24, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not 100% sure what you mean by Default is [...] required to be [...] used. Can you elaborate? For now I've only added that it needs to be implemented for the type.

@james7132 james7132 added C-Docs An addition or correction to our documentation A-ECS Entities, components, systems, and events labels Oct 19, 2022
@x3ro x3ro force-pushed the document-world-query-ignore branch from 87cdfbe to 3f22ac9 Compare October 24, 2022 09:35
@x3ro x3ro force-pushed the document-world-query-ignore branch from 3f22ac9 to 1bc1949 Compare October 25, 2022 22:10
@x3ro
Copy link
Contributor Author

x3ro commented Oct 29, 2022

Hey :) Do you think the PR can be merged like this, or should I make additional changes?

Copy link
Member

@james7132 james7132 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM otherwise.

crates/bevy_ecs/src/query/fetch.rs Outdated Show resolved Hide resolved
Co-authored-by: James Liu <contact@jamessliu.com>
@alice-i-cecile alice-i-cecile added the S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it label Nov 1, 2022
@alice-i-cecile
Copy link
Member

bors r+

bors bot pushed a commit that referenced this pull request Nov 1, 2022
# Objective

Add documentation `#[world_query(ignore)]`. Fixes #6283.

---

I've only described it's behavior so far (which appears to be the same as with `system_param`). Is there another use-case for this besides with `PhantomData`? I could only find a single usage of this construct on GitHub, which is [here](https://github.com/tqwewe/bevy-editor-2/blob/ffcb816927a1bbdcf1cb0136ce47864e5040f9fb/bevy/examples/ecs/custom_query_param.rs#L102). 

I was also wondering if it would make sense to add a usage example to the `custom_query_example`? 🤔 That's why it's currently still in there.




Co-authored-by: Lucas Jenß <243719+x3ro@users.noreply.github.com>
@bors bors bot changed the title Mention world_query(ignore) attribute for WorldQuery derivation [Merged by Bors] - Mention world_query(ignore) attribute for WorldQuery derivation Nov 1, 2022
@bors bors bot closed this Nov 1, 2022
ItsDoot pushed a commit to ItsDoot/bevy that referenced this pull request Feb 1, 2023
…engine#6309)

# Objective

Add documentation `#[world_query(ignore)]`. Fixes bevyengine#6283.

---

I've only described it's behavior so far (which appears to be the same as with `system_param`). Is there another use-case for this besides with `PhantomData`? I could only find a single usage of this construct on GitHub, which is [here](https://github.com/tqwewe/bevy-editor-2/blob/ffcb816927a1bbdcf1cb0136ce47864e5040f9fb/bevy/examples/ecs/custom_query_param.rs#L102). 

I was also wondering if it would make sense to add a usage example to the `custom_query_example`? 🤔 That's why it's currently still in there.




Co-authored-by: Lucas Jenß <243719+x3ro@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-ECS Entities, components, systems, and events C-Docs An addition or correction to our documentation S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it
Projects
None yet
Development

Successfully merging this pull request may close these issues.

WorldQuery docs do not mention #[world_query(ignore)] behaviour
4 participants