diff --git a/godot-core/Cargo.toml b/godot-core/Cargo.toml index 61f86213b..8b15f1ff7 100644 --- a/godot-core/Cargo.toml +++ b/godot-core/Cargo.toml @@ -12,7 +12,7 @@ homepage = "https://godot-rust.github.io" [features] default = [] -docs = [] +register-docs = [] codegen-rustfmt = ["godot-ffi/codegen-rustfmt", "godot-codegen/codegen-rustfmt"] codegen-full = ["godot-codegen/codegen-full"] codegen-lazy-fptrs = [ diff --git a/godot-core/src/init/mod.rs b/godot-core/src/init/mod.rs index df94b18dd..5a287b0a5 100644 --- a/godot-core/src/init/mod.rs +++ b/godot-core/src/init/mod.rs @@ -143,7 +143,7 @@ unsafe fn gdext_on_level_init(level: InitLevel) { unsafe { ensure_godot_features_compatible() }; } InitLevel::Editor => { - #[cfg(all(since_api = "4.3", feature = "docs"))] + #[cfg(all(since_api = "4.3", feature = "register-docs"))] // SAFETY: Godot binding is initialized, and this is called from the main thread. unsafe { crate::docs::register(); diff --git a/godot-core/src/lib.rs b/godot-core/src/lib.rs index e32a4b7e4..567d1258e 100644 --- a/godot-core/src/lib.rs +++ b/godot-core/src/lib.rs @@ -15,11 +15,11 @@ pub mod builder; pub mod builtin; pub mod classes; -#[cfg(all(since_api = "4.3", feature = "docs"))] +#[cfg(all(since_api = "4.3", feature = "register-docs"))] pub mod docs; #[doc(hidden)] pub mod possibly_docs { - #[cfg(all(since_api = "4.3", feature = "docs"))] + #[cfg(all(since_api = "4.3", feature = "register-docs"))] pub use crate::docs::*; } pub mod global; @@ -35,7 +35,7 @@ pub use godot_ffi as sys; // ---------------------------------------------------------------------------------------------------------------------------------------------- // Validations (see also godot/lib.rs) -#[cfg(all(feature = "docs", before_api = "4.3"))] +#[cfg(all(feature = "register-docs", before_api = "4.3"))] compile_error!("Generating editor docs for Rust symbols requires at least Godot 4.3."); // ---------------------------------------------------------------------------------------------------------------------------------------------- diff --git a/godot-core/src/registry/class.rs b/godot-core/src/registry/class.rs index 0a51785fb..678781b36 100644 --- a/godot-core/src/registry/class.rs +++ b/godot-core/src/registry/class.rs @@ -243,7 +243,7 @@ fn fill_class_info(item: PluginItem, c: &mut ClassRegistrationInfo) { is_editor_plugin, is_internal, is_instantiable, - #[cfg(all(since_api = "4.3", feature = "docs"))] + #[cfg(all(since_api = "4.3", feature = "register-docs"))] docs: _, } => { c.parent_class_name = Some(base_class_name); @@ -296,7 +296,7 @@ fn fill_class_info(item: PluginItem, c: &mut ClassRegistrationInfo) { PluginItem::InherentImpl(InherentImpl { register_methods_constants_fn, register_rpcs_fn: _, - #[cfg(all(since_api = "4.3", feature = "docs"))] + #[cfg(all(since_api = "4.3", feature = "register-docs"))] docs: _, }) => { c.register_methods_constants_fn = Some(register_methods_constants_fn); @@ -315,7 +315,7 @@ fn fill_class_info(item: PluginItem, c: &mut ClassRegistrationInfo) { user_free_property_list_fn, user_property_can_revert_fn, user_property_get_revert_fn, - #[cfg(all(since_api = "4.3", feature = "docs"))] + #[cfg(all(since_api = "4.3", feature = "register-docs"))] virtual_method_docs: _, } => { c.user_register_fn = user_register_fn; diff --git a/godot-core/src/registry/plugin.rs b/godot-core/src/registry/plugin.rs index 55971fcbc..db191c774 100644 --- a/godot-core/src/registry/plugin.rs +++ b/godot-core/src/registry/plugin.rs @@ -5,7 +5,7 @@ * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ -#[cfg(all(since_api = "4.3", feature = "docs"))] +#[cfg(all(since_api = "4.3", feature = "register-docs"))] use crate::docs::*; use crate::init::InitLevel; use crate::meta::ClassName; @@ -65,7 +65,7 @@ pub struct InherentImpl { /// /// This function is called in [`UserClass::__before_ready()`](crate::obj::UserClass::__before_ready) definitions generated by the `#[derive(GodotClass)]` macro. pub register_rpcs_fn: Option, - #[cfg(all(since_api = "4.3", feature = "docs"))] + #[cfg(all(since_api = "4.3", feature = "register-docs"))] pub docs: InherentImplDocs, } @@ -121,7 +121,7 @@ pub enum PluginItem { /// Whether the class has a default constructor. is_instantiable: bool, - #[cfg(all(since_api = "4.3", feature = "docs"))] + #[cfg(all(since_api = "4.3", feature = "register-docs"))] docs: Option, }, @@ -130,7 +130,7 @@ pub enum PluginItem { /// Collected from `#[godot_api] impl I... for MyClass`. ITraitImpl { - #[cfg(all(since_api = "4.3", feature = "docs"))] + #[cfg(all(since_api = "4.3", feature = "register-docs"))] /// Virtual method documentation. virtual_method_docs: &'static str, /// Callback to user-defined `register_class` function. diff --git a/godot-macros/Cargo.toml b/godot-macros/Cargo.toml index b5df22634..23fa5769b 100644 --- a/godot-macros/Cargo.toml +++ b/godot-macros/Cargo.toml @@ -12,7 +12,7 @@ homepage = "https://godot-rust.github.io" [features] api-custom = ["godot-bindings/api-custom"] -docs = ["dep:markdown"] +register-docs = ["dep:markdown"] codegen-full = ["godot/__codegen-full"] [lib] diff --git a/godot-macros/src/class/data_models/field.rs b/godot-macros/src/class/data_models/field.rs index 28173df0e..0924fae09 100644 --- a/godot-macros/src/class/data_models/field.rs +++ b/godot-macros/src/class/data_models/field.rs @@ -15,7 +15,7 @@ pub struct Field { pub var: Option, pub export: Option, pub is_onready: bool, - #[cfg(feature = "docs")] + #[cfg(feature = "register-docs")] pub attributes: Vec, } @@ -28,7 +28,7 @@ impl Field { var: None, export: None, is_onready: false, - #[cfg(feature = "docs")] + #[cfg(feature = "register-docs")] attributes: field.attributes.clone(), } } diff --git a/godot-macros/src/class/data_models/inherent_impl.rs b/godot-macros/src/class/data_models/inherent_impl.rs index 41b60dd3e..245f26ccc 100644 --- a/godot-macros/src/class/data_models/inherent_impl.rs +++ b/godot-macros/src/class/data_models/inherent_impl.rs @@ -74,9 +74,9 @@ pub fn transform_inherent_impl(mut impl_block: venial::Impl) -> ParseResult ParseResult ParseResult { let is_internal = struct_cfg.is_internal; let base_ty = &struct_cfg.base_ty; - #[cfg(all(feature = "docs", since_api = "4.3"))] + #[cfg(all(feature = "register-docs", since_api = "4.3"))] let docs = crate::docs::make_definition_docs( base_ty.to_string(), &class.attributes, &fields.all_fields, ); - #[cfg(not(all(feature = "docs", since_api = "4.3")))] + #[cfg(not(all(feature = "register-docs", since_api = "4.3")))] let docs = quote! {}; let base_class = quote! { ::godot::classes::#base_ty }; let base_class_name_obj = util::class_name_obj(&base_class); diff --git a/godot-macros/src/lib.rs b/godot-macros/src/lib.rs index 414b77176..c10e31462 100644 --- a/godot-macros/src/lib.rs +++ b/godot-macros/src/lib.rs @@ -13,7 +13,7 @@ mod bench; mod class; mod derive; -#[cfg(all(feature = "docs", since_api = "4.3"))] +#[cfg(all(feature = "register-docs", since_api = "4.3"))] mod docs; mod gdextension; mod itest; diff --git a/godot/Cargo.toml b/godot/Cargo.toml index e3aa46a6a..70e678470 100644 --- a/godot/Cargo.toml +++ b/godot/Cargo.toml @@ -24,7 +24,7 @@ codegen-rustfmt = ["godot-core/codegen-rustfmt"] lazy-function-tables = ["godot-core/codegen-lazy-fptrs"] serde = ["godot-core/serde"] -register-docs = ["godot-macros/docs", "godot-core/docs"] +register-docs = ["godot-macros/register-docs", "godot-core/register-docs"] api-custom = ["godot-core/api-custom"] # [version-sync] [[