-
-
Notifications
You must be signed in to change notification settings - Fork 218
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
Validate that editor plugin classes require #[class(tool)]
#852
Validate that editor plugin classes require #[class(tool)]
#852
Conversation
#[class(tool)]
API docs are being generated and will be shortly available at: https://godot-rust.github.io/docs/gdext/pr-852 |
7f5f6de
to
24b88ea
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Related: #850
There is also the attribute key #[class(editor_plugin)]
-- should we check against that, rather than tool
?
But that is specifically for registering the |
2c88ea8
to
2501bf6
Compare
Good point. I checked the original PR #393 and there's an interesting note:
So there's already a validation that prevents I think later I'll entirely remove |
Maybe one point where But even that could be somehow encoded into the type system. And currently such intermediate classes are not supported. |
2501bf6
to
09a2a8a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot!
Editor plugin classes are editor only and thus require
#[class(tool)]
as they are not used in gameDetails on how a class might be used is available in extension_api.json under classes.*.api_type (e.g.
core
oreditor
) and should be taken from there at some point. Matching theEditor
prefix seems good enough for now, as it covers all the plugin classes. There is most likely no point extending the remaining editor only classes, but I haven't looked into it further.