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

Implement @no_storage annotation #101117

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Synzorasize
Copy link

@Synzorasize Synzorasize commented Jan 4, 2025

Closes godotengine/godot-proposals#2539. This adds a new export annotation, @no_storage, that must go after an @export annotation to be used. It will remove the PROPERTY_USAGE_STORAGE flag from the exported variable, allowing it to be editor-only.

I used suggestions from the above issue and from related issues in this commit, including those by @dalexeev. Feel free to request changes. I wrote the documentation for @no_storage based on @export and @export_storage, but it can possibly be improved.

Due to a limitation of my implementation, I could not entirely prevent @export_custom from being used along with @no_storage, so I put it in a note in the documentation that it is not recommended to use them together. Edit: I fixed this issue with @dalexeev's solution, so I removed that note. Also, since the documentation is listed alphabetically, @no_storage appears separately from the other export annotations. It may be fine since it is a special one, but still something to note.

@Synzorasize Synzorasize requested review from a team as code owners January 4, 2025 03:42
@Synzorasize Synzorasize changed the title Implement @no_storage annotation Implement @no_storage annotation Jan 4, 2025
@dalexeev dalexeev added this to the 4.x milestone Jan 4, 2025
@Synzorasize Synzorasize force-pushed the implement_2539 branch 2 times, most recently from 37f2ae5 to e015de2 Compare January 4, 2025 07:59
modules/gdscript/gdscript_parser.cpp Outdated Show resolved Hide resolved
modules/gdscript/gdscript_parser.cpp Outdated Show resolved Hide resolved
modules/gdscript/gdscript_parser.h Outdated Show resolved Hide resolved
modules/gdscript/gdscript_parser.cpp Outdated Show resolved Hide resolved
modules/gdscript/doc_classes/@GDScript.xml Outdated Show resolved Hide resolved
modules/gdscript/doc_classes/@GDScript.xml Outdated Show resolved Hide resolved
modules/gdscript/gdscript_parser.cpp Show resolved Hide resolved
@Synzorasize Synzorasize requested a review from a team as a code owner January 5, 2025 00:16
@Synzorasize Synzorasize force-pushed the implement_2539 branch 3 times, most recently from 7e6f03b to 866ce63 Compare January 5, 2025 01:16
@Synzorasize
Copy link
Author

Sorry for spamming the workflow runs, I didn't see where I could run the checks locally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add @no_storage property usage annotation
2 participants