-
-
Notifications
You must be signed in to change notification settings - Fork 22k
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 warning if non-@tool
class extends @tool
class
#78178
GDScript: Add warning if non-@tool
class extends @tool
class
#78178
Conversation
dalexeev
commented
Jun 13, 2023
•
edited
Loading
edited
- Closes @tool script extended without @tool does not show all exported vars in inspector #78174.
- Closes Warn if script inheriting tool script isn't tool godot-proposals#754.
I support the idea in principle. One question we might want to ponder is whether there might be a valid use case for extending I guess this use case, if it exists, could be achieved the other way around by making the base script non |
Effectively I can see cases where the base script is a tool script and the extended should not. For example the base script can have some exported value that has a setter that needs to run but the current script has a lot of things happening on process which you don't want to run in the editor because of performance reasons. |
The problem is that we can't make If you propose the ability to disable Or we can replace the error with a warning and shift the responsibility to users, but we need to come up with code so that the warning can be ignored. |
|
As discussed in the GDScript team meeting, instead of adding |
7e0d773
to
2326f0d
Compare
@tool
class extends @tool
class@tool
class extends @tool
class
2326f0d
to
a107a11
Compare
Autocompletion inserts empty parentheses when there are optional arguments. We could have added an exception, but I remembered that we already have an annotation for ignoring warnings, which is most likely the first thing the user will use by clicking the "Ignore" button in the warning bar. I don't think we need any other way than |
a107a11
to
862699b
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.
Documentation for the warning looks fine but I have a feel this PR is abandoned a bit?
862699b
to
3f52871
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 personally relate to the issues the warning would address (it used to be extremely painful figuring them out on my own), but it's worth questioning if this should be in 4.3 right now, in feature freeze.
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.
Looks good to me.
Thanks! |