-
-
Notifications
You must be signed in to change notification settings - Fork 97
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
Add <available-platform>
element in class reference XML
#9762
Comments
I'm not sure about it being a mixed-content XML element, it would certainly be easier to parse as either a XML attribute or (one or multiple) custom BBCode-style tag like XML schema validation could be replaced with custom validation logic like we already do for checking valid |
Mixed-content element is difficult to parse does make sense 👍 Updated the proposal. Now |
Note that this won't work for members, since they do not have a |
Somewhat related proposal about adding metadata to APIs: From the .NET/C# perspective, I'd like to know which APIs are only implemented on certain platforms so we can use the appropriate C# attributes. For example: [SupportedOSPlatform("linux")]
public void LinuxOnlyApi() { }
[SupportedOSPlatform("windows")]
[SupportedOSPlatform("ios14.0")]
public void SupportedOnWindowsAndIos14() { }
[UnsupportedOSPlatform("android")]
public void DoesNotWorkOnAndroid() { } As you can see, these attributes can also specify the platform's version. And the supported platforms can be specified in a inclusive or exclusive way (e.g.: this API is supported only in these platforms - vs - this API is supported everywhere except for these platforms). I think it's fine for this information to be in From the perspective of GDExtensions, this would need to be surfaced in the dumped |
Why not a list of comma-separated feature tags as an optional attribute of the method/property, like we do for This can also be used to denote properties/methods that are only effective in the editor or in debug builds. |
As explained in OP, valid platform names can be defined in XSD and checked by an XML validator. It's also future-proof (not included in this proposal, but could be), e.g.: <available-platform name="iOS" minimum_version="14.0" />
<available-platform name="Windows">
[param key_callback] is ignored.
</available-platform>
|
Describe the project you are working on
Translating class reference.
Describe the problem or limitation you are having in your project
Similar notes about available platform are scattered in different places.
Describe the feature / enhancement and how it helps to overcome the problem or limitation
Use a dedicated element for this kind of message.
Instead of plain text:
Use:
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
All
<available-platform>
names are used to generate a list (instead of a sentence) at the end of the description text.Generates:
This also makes it easier if someone wants to use icons instead of texts to represent this information, or wants to generate a platform specific version of documentation.
Some existing notes contain additional description about general behavior:
The general part can be kept as-is:
A good thing about using a separate element is that
name
can be enumerated. Unknown names can be found by the XML validator.If that's not a requirement, making it a comma-separated string attribute on method / member elements is also an option.
If this enhancement will not be used often, can it be worked around with a few lines of script?
No. It's about class reference XML.
Is there a reason why this should be core and not an add-on in the asset library?
Same as above.
The text was updated successfully, but these errors were encountered: