-
Notifications
You must be signed in to change notification settings - Fork 45
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
Refine registration annotation handling #727
Open
chippmann
wants to merge
18
commits into
master
Choose a base branch
from
feature/refine-registration-annotation-handling
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Refine registration annotation handling #727
chippmann
wants to merge
18
commits into
master
from
feature/refine-registration-annotation-handling
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CedNaru
previously approved these changes
Oct 14, 2024
…n in the symbol processor
…recursive registration annotations resolving
…a including interfaces and fix treating of signals as properties when a registration annotation is present
chippmann
force-pushed
the
feature/refine-registration-annotation-handling
branch
from
November 2, 2024 11:22
6324fae
to
76fe8ab
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #606
This refines how we register annotations according to the linked proposal (specifically this comment and refined by this comment)
It includes the following changes:
RegisterClass
is renamed toGodotScript
RegisterSignal
is droppedRegisterProperty
,RegisterConstructor
andRegisterFunction
are combined intoGodotMember
To summarize the implemented registration changes from the proposal:
All
If a fine grained annotation is used (like
Export
, a type hint annotation,Rpc
orTool
) a class or member does not have to be registered explicitly anymore. Annotations inherit from each other nowClasses
Classes still need to be registered manually (reason for this is outlined in this comment).
Signals
Signals no longer need to be registered at all. As they are only of use in Godot anyway, their sole existence in code is already documentation and hint enough that they should be exposed to godot
Properties
Still need to be annotated explicitly. If a property is registered in a parent class, it "inherits" that registration status even if not explicitly registered again in a child class (no matter if the child class overrides the property or not).
Functions
User defined functions still need to be registered manually. Like properties, they inherit their registration status from parent classes.
Godot api functions which are overridden in child classes (like
_ready
or_process
) do not need to be registered explicitly anymore. They are godot api functions and thus are always relevant to godot.