-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
GDScript: Add some checks for @tool
and @icon
#76065
GDScript: Add some checks for @tool
and @icon
#76065
Conversation
Should probably add tests for those cases. |
a9e97b5
to
93f54c5
Compare
Done. |
Thanks! Btw, why err if a non-global class has an icon? We can still use them in the editor. I even has a PR adding support for those. |
At least it doesn't currently work. This is even written in the docs, but there is no check in the parser.
Probably because the editor reads this data from the |
Yes, in my PR I add a way to get it directly from the script. |
Okay, then I will remove that part. I will not delete the obsolete note in the docs, please do it within #75656. |
93f54c5
to
9c4a8e2
Compare
9c4a8e2
to
dbc3c82
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.
I think this check is a good idea, even though it is fixing a very minor problem.
@@ -3686,6 +3686,12 @@ bool GDScriptParser::validate_annotation_arguments(AnnotationNode *p_annotation) | |||
} | |||
|
|||
bool GDScriptParser::tool_annotation(const AnnotationNode *p_annotation, Node *p_node) { | |||
#ifdef DEBUG_ENABLED | |||
if (this->_is_tool) { |
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.
this->
is redundant but it's consistent with the below, so I guess it's OK.
Thanks! |
Closes #76059.