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

Documentation: Add support for deprecated/experimental messages #81458

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
110 changes: 100 additions & 10 deletions core/doc_data.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,9 @@ class DocData {
String qualifiers;
String description;
bool is_deprecated = false;
String deprecated_message;
bool is_experimental = false;
String experimental_message;
Vector<ArgumentDoc> arguments;
Vector<int> errors_returned;
String keywords;
Expand Down Expand Up @@ -172,13 +174,25 @@ class DocData {
doc.description = p_dict["description"];
}

#ifndef DISABLE_DEPRECATED
if (p_dict.has("is_deprecated")) {
doc.is_deprecated = p_dict["is_deprecated"];
}

if (p_dict.has("is_experimental")) {
doc.is_experimental = p_dict["is_experimental"];
}
#endif

if (p_dict.has("deprecated")) {
doc.is_deprecated = true;
doc.deprecated_message = p_dict["deprecated"];
}

if (p_dict.has("experimental")) {
doc.is_experimental = true;
doc.experimental_message = p_dict["experimental"];
}

Array arguments;
if (p_dict.has("arguments")) {
Expand Down Expand Up @@ -226,9 +240,13 @@ class DocData {
dict["description"] = p_doc.description;
}

dict["is_deprecated"] = p_doc.is_deprecated;
if (p_doc.is_deprecated) {
dict["deprecated"] = p_doc.deprecated_message;
}

dict["is_experimental"] = p_doc.is_experimental;
if (p_doc.is_experimental) {
dict["experimental"] = p_doc.experimental_message;
}

if (!p_doc.keywords.is_empty()) {
dict["keywords"] = p_doc.keywords;
Expand Down Expand Up @@ -262,7 +280,9 @@ class DocData {
bool is_bitfield = false;
String description;
bool is_deprecated = false;
String deprecated_message;
bool is_experimental = false;
String experimental_message;
String keywords;
bool operator<(const ConstantDoc &p_const) const {
return name < p_const.name;
Expand Down Expand Up @@ -293,13 +313,25 @@ class DocData {
doc.description = p_dict["description"];
}

#ifndef DISABLE_DEPRECATED
if (p_dict.has("is_deprecated")) {
doc.is_deprecated = p_dict["is_deprecated"];
}

if (p_dict.has("is_experimental")) {
doc.is_experimental = p_dict["is_experimental"];
}
#endif

if (p_dict.has("deprecated")) {
doc.is_deprecated = true;
doc.deprecated_message = p_dict["deprecated"];
}

if (p_dict.has("experimental")) {
doc.is_experimental = true;
doc.experimental_message = p_dict["experimental"];
}

if (p_dict.has("keywords")) {
doc.keywords = p_dict["keywords"];
Expand Down Expand Up @@ -329,9 +361,13 @@ class DocData {
dict["description"] = p_doc.description;
}

dict["is_deprecated"] = p_doc.is_deprecated;
if (p_doc.is_deprecated) {
dict["deprecated"] = p_doc.deprecated_message;
}

dict["is_experimental"] = p_doc.is_experimental;
if (p_doc.is_experimental) {
dict["experimental"] = p_doc.experimental_message;
}

if (!p_doc.keywords.is_empty()) {
dict["keywords"] = p_doc.keywords;
Expand All @@ -352,7 +388,9 @@ class DocData {
bool overridden = false;
String overrides;
bool is_deprecated = false;
String deprecated_message;
bool is_experimental = false;
String experimental_message;
String keywords;
bool operator<(const PropertyDoc &p_prop) const {
return name.naturalcasecmp_to(p_prop.name) < 0;
Expand Down Expand Up @@ -399,13 +437,25 @@ class DocData {
doc.overrides = p_dict["overrides"];
}

#ifndef DISABLE_DEPRECATED
if (p_dict.has("is_deprecated")) {
doc.is_deprecated = p_dict["is_deprecated"];
}

if (p_dict.has("is_experimental")) {
doc.is_experimental = p_dict["is_experimental"];
}
#endif

if (p_dict.has("deprecated")) {
doc.is_deprecated = true;
doc.deprecated_message = p_dict["deprecated"];
}

if (p_dict.has("experimental")) {
doc.is_experimental = true;
doc.experimental_message = p_dict["experimental"];
}

if (p_dict.has("keywords")) {
doc.keywords = p_dict["keywords"];
Expand Down Expand Up @@ -451,9 +501,13 @@ class DocData {
dict["overrides"] = p_doc.overrides;
}

dict["is_deprecated"] = p_doc.is_deprecated;
if (p_doc.is_deprecated) {
dict["deprecated"] = p_doc.deprecated_message;
}

dict["is_experimental"] = p_doc.is_experimental;
if (p_doc.is_experimental) {
dict["experimental"] = p_doc.experimental_message;
}

if (!p_doc.keywords.is_empty()) {
dict["keywords"] = p_doc.keywords;
Expand Down Expand Up @@ -571,21 +625,35 @@ class DocData {
struct EnumDoc {
String description;
bool is_deprecated = false;
String deprecated_message;
bool is_experimental = false;
String experimental_message;
static EnumDoc from_dict(const Dictionary &p_dict) {
EnumDoc doc;

if (p_dict.has("description")) {
doc.description = p_dict["description"];
}

#ifndef DISABLE_DEPRECATED
if (p_dict.has("is_deprecated")) {
doc.is_deprecated = p_dict["is_deprecated"];
}

if (p_dict.has("is_experimental")) {
doc.is_experimental = p_dict["is_experimental"];
}
#endif

if (p_dict.has("deprecated")) {
doc.is_deprecated = true;
doc.deprecated_message = p_dict["deprecated"];
}

if (p_dict.has("experimental")) {
doc.is_experimental = true;
doc.experimental_message = p_dict["experimental"];
}

return doc;
}
Expand All @@ -596,9 +664,13 @@ class DocData {
dict["description"] = p_doc.description;
}

dict["is_deprecated"] = p_doc.is_deprecated;
if (p_doc.is_deprecated) {
dict["deprecated"] = p_doc.deprecated_message;
}

dict["is_experimental"] = p_doc.is_experimental;
if (p_doc.is_experimental) {
dict["experimental"] = p_doc.experimental_message;
}

return dict;
}
Expand All @@ -621,7 +693,9 @@ class DocData {
Vector<MethodDoc> annotations;
Vector<ThemeItemDoc> theme_properties;
bool is_deprecated = false;
String deprecated_message;
bool is_experimental = false;
String experimental_message;
bool is_script_doc = false;
String script_path;
bool operator<(const ClassDoc &p_class) const {
Expand Down Expand Up @@ -730,13 +804,25 @@ class DocData {
doc.theme_properties.push_back(ThemeItemDoc::from_dict(theme_properties[i]));
}

#ifndef DISABLE_DEPRECATED
if (p_dict.has("is_deprecated")) {
doc.is_deprecated = p_dict["is_deprecated"];
}

if (p_dict.has("is_experimental")) {
doc.is_experimental = p_dict["is_experimental"];
}
#endif

if (p_dict.has("deprecated")) {
doc.is_deprecated = true;
doc.deprecated_message = p_dict["deprecated"];
}

if (p_dict.has("experimental")) {
doc.is_experimental = true;
doc.experimental_message = p_dict["experimental"];
}

if (p_dict.has("is_script_doc")) {
doc.is_script_doc = p_dict["is_script_doc"];
Expand Down Expand Up @@ -847,9 +933,13 @@ class DocData {
dict["theme_properties"] = theme_properties;
}

dict["is_deprecated"] = p_doc.is_deprecated;
if (p_doc.is_deprecated) {
dict["deprecated"] = p_doc.deprecated_message;
}

dict["is_experimental"] = p_doc.is_experimental;
if (p_doc.is_experimental) {
dict["experimental"] = p_doc.experimental_message;
}

dict["is_script_doc"] = p_doc.is_script_doc;

Expand Down
21 changes: 21 additions & 0 deletions doc/class.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,12 @@
</xs:sequence>
<xs:attribute type="xs:string" name="name" use="optional" />
<xs:attribute type="xs:string" name="qualifiers" use="optional" />
<!-- deprecated -->
<xs:attribute type="xs:boolean" name="is_deprecated" use="optional" />
<xs:attribute type="xs:boolean" name="is_experimental" use="optional" />
<!-- /deprecated -->
<xs:attribute type="xs:string" name="deprecated" use="optional" />
<xs:attribute type="xs:string" name="experimental" use="optional" />
<xs:attribute type="xs:string" name="keywords" use="optional" />
</xs:complexType>
</xs:element>
Expand All @@ -122,8 +126,12 @@
<xs:attribute type="xs:string" name="enum" use="optional" />
<xs:attribute type="xs:boolean" name="is_bitfield" use="optional" />
<xs:attribute type="xs:string" name="default" use="optional" />
<!-- deprecated -->
<xs:attribute type="xs:boolean" name="is_deprecated" use="optional" />
<xs:attribute type="xs:boolean" name="is_experimental" use="optional" />
<!-- /deprecated -->
<xs:attribute type="xs:string" name="deprecated" use="optional" />
<xs:attribute type="xs:string" name="experimental" use="optional" />
<xs:attribute type="xs:string" name="keywords" use="optional" />
</xs:extension>
</xs:simpleContent>
Expand Down Expand Up @@ -152,8 +160,12 @@
<xs:element type="xs:string" name="description" />
</xs:sequence>
<xs:attribute type="xs:string" name="name" use="optional" />
<!-- deprecated -->
<xs:attribute type="xs:boolean" name="is_deprecated" use="optional" />
<xs:attribute type="xs:boolean" name="is_experimental" use="optional" />
<!-- /deprecated -->
<xs:attribute type="xs:string" name="deprecated" use="optional" />
<xs:attribute type="xs:string" name="experimental" use="optional" />
</xs:complexType>
</xs:element>
</xs:sequence>
Expand All @@ -170,8 +182,12 @@
<xs:attribute type="xs:string" name="value" />
<xs:attribute type="xs:string" name="enum" use="optional" />
<xs:attribute type="xs:boolean" name="is_bitfield" use="optional" />
<!-- deprecated -->
<xs:attribute type="xs:boolean" name="is_deprecated" use="optional" />
<xs:attribute type="xs:boolean" name="is_experimental" use="optional" />
<!-- /deprecated -->
<xs:attribute type="xs:string" name="deprecated" use="optional" />
<xs:attribute type="xs:string" name="experimental" use="optional" />
<xs:attribute type="xs:string" name="keywords" use="optional" />
</xs:extension>
</xs:simpleContent>
Expand Down Expand Up @@ -279,8 +295,13 @@
</xs:sequence>
<xs:attribute type="xs:string" name="name" />
<xs:attribute type="xs:string" name="inherits" />
<!-- deprecated -->
<xs:attribute type="xs:float" name="version" use="optional" />
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<xs:attribute type="xs:boolean" name="is_deprecated" use="optional" />
<xs:attribute type="xs:boolean" name="is_experimental" use="optional" />
<!-- /deprecated -->
<xs:attribute type="xs:string" name="deprecated" use="optional" />
<xs:attribute type="xs:string" name="experimental" use="optional" />
<xs:attribute type="xs:string" name="keywords" use="optional" />
</xs:complexType>
</xs:element>
Expand Down
15 changes: 4 additions & 11 deletions doc/classes/@GlobalScope.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2889,8 +2889,7 @@
[/codeblocks]
[b]Note:[/b] The trailing colon is required for properly detecting built-in types.
</constant>
<constant name="PROPERTY_HINT_NODE_PATH_TO_EDITED_NODE" value="24" enum="PropertyHint" is_deprecated="true">
[i]Deprecated.[/i] This hint is not used anywhere and will be removed in the future.
<constant name="PROPERTY_HINT_NODE_PATH_TO_EDITED_NODE" value="24" enum="PropertyHint" deprecated="This hint is not used anywhere and will be removed in the future.">
</constant>
<constant name="PROPERTY_HINT_OBJECT_TOO_BIG" value="25" enum="PropertyHint">
Hints that an object is too big to be sent via the debugger.
Expand All @@ -2904,9 +2903,7 @@
<constant name="PROPERTY_HINT_GLOBAL_SAVE_FILE" value="28" enum="PropertyHint">
Hints that a [String] property is a path to a file. Editing it will show a file dialog for picking the path for the file to be saved at. The dialog has access to the entire filesystem. The hint string can be a set of filters with wildcards like [code]"*.png,*.jpg"[/code]. See also [member FileDialog.filters].
</constant>
<constant name="PROPERTY_HINT_INT_IS_OBJECTID" value="29" enum="PropertyHint" is_deprecated="true">
Hints that an [int] property is an object ID.
[i]Deprecated.[/i] This hint is not used anywhere and will be removed in the future.
<constant name="PROPERTY_HINT_INT_IS_OBJECTID" value="29" enum="PropertyHint" deprecated="This hint is not used anywhere and will be removed in the future.">
</constant>
<constant name="PROPERTY_HINT_INT_IS_POINTER" value="30" enum="PropertyHint">
Hints that an [int] property is a pointer. Used by GDExtension.
Expand Down Expand Up @@ -2977,9 +2974,7 @@
<constant name="PROPERTY_USAGE_UPDATE_ALL_IF_MODIFIED" value="16384" enum="PropertyUsageFlags" is_bitfield="true">
If this property is modified, all inspector fields will be refreshed.
</constant>
<constant name="PROPERTY_USAGE_SCRIPT_DEFAULT_VALUE" value="32768" enum="PropertyUsageFlags" is_bitfield="true" is_deprecated="true">
Signifies a default value from a placeholder script instance.
[i]Deprecated.[/i] This hint is not used anywhere and will be removed in the future.
<constant name="PROPERTY_USAGE_SCRIPT_DEFAULT_VALUE" value="32768" enum="PropertyUsageFlags" is_bitfield="true" deprecated="This hint is not used anywhere and will be removed in the future.">
</constant>
<constant name="PROPERTY_USAGE_CLASS_IS_ENUM" value="65536" enum="PropertyUsageFlags" is_bitfield="true">
The property is an enum, i.e. it only takes named integer constants from its associated enumeration.
Expand Down Expand Up @@ -3008,9 +3003,7 @@
<constant name="PROPERTY_USAGE_KEYING_INCREMENTS" value="16777216" enum="PropertyUsageFlags" is_bitfield="true">
Inserting an animation key frame of this property will automatically increment the value, allowing to easily keyframe multiple values in a row.
</constant>
<constant name="PROPERTY_USAGE_DEFERRED_SET_RESOURCE" value="33554432" enum="PropertyUsageFlags" is_bitfield="true" is_deprecated="true">
When loading, the resource for this property can be set at the end of loading.
[i]Deprecated.[/i] This hint is not used anywhere and will be removed in the future.
<constant name="PROPERTY_USAGE_DEFERRED_SET_RESOURCE" value="33554432" enum="PropertyUsageFlags" is_bitfield="true" deprecated="This hint is not used anywhere and will be removed in the future.">
</constant>
<constant name="PROPERTY_USAGE_EDITOR_INSTANTIATE_OBJECT" value="67108864" enum="PropertyUsageFlags" is_bitfield="true">
When this property is a [Resource] and base object is a [Node], a resource instance will be automatically created whenever the node is created in the editor.
Expand Down
3 changes: 1 addition & 2 deletions doc/classes/AStarGrid2D.xml
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,8 @@
<member name="region" type="Rect2i" setter="set_region" getter="get_region" default="Rect2i(0, 0, 0, 0)">
The region of grid cells available for pathfinding. If changed, [method update] needs to be called before finding the next path.
</member>
<member name="size" type="Vector2i" setter="set_size" getter="get_size" default="Vector2i(0, 0)" is_deprecated="true">
<member name="size" type="Vector2i" setter="set_size" getter="get_size" default="Vector2i(0, 0)" deprecated="Use [member region] instead.">
The size of the grid (number of cells of size [member cell_size] on each axis). If changed, [method update] needs to be called before finding the next path.
[i]Deprecated.[/i] Use [member region] instead.
</member>
</members>
<constants>
Expand Down
3 changes: 1 addition & 2 deletions doc/classes/AnimatedTexture.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="AnimatedTexture" inherits="Texture2D" is_deprecated="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
<class name="AnimatedTexture" inherits="Texture2D" deprecated="" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
<brief_description>
Proxy texture for simple frame-based animations.
</brief_description>
Expand All @@ -9,7 +9,6 @@
[AnimatedTexture] currently requires all frame textures to have the same size, otherwise the bigger ones will be cropped to match the smallest one.
[b]Note:[/b] AnimatedTexture doesn't support using [AtlasTexture]s. Each frame needs to be a separate [Texture2D].
[b]Warning:[/b] The current implementation is not efficient for the modern renderers.
[i]Deprecated.[/i] This class is deprecated, and might be removed in a future release.
</description>
<tutorials>
</tutorials>
Expand Down
Loading
Loading