Skip to content

Commit fba9f61

Browse files
committed
Consistently name all related features register-docs
1 parent 650c2ad commit fba9f61

File tree

12 files changed

+23
-23
lines changed

12 files changed

+23
-23
lines changed

godot-core/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ homepage = "https://godot-rust.github.io"
1212

1313
[features]
1414
default = []
15-
docs = []
15+
register-docs = []
1616
codegen-rustfmt = ["godot-ffi/codegen-rustfmt", "godot-codegen/codegen-rustfmt"]
1717
codegen-full = ["godot-codegen/codegen-full"]
1818
codegen-lazy-fptrs = [

godot-core/src/init/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ unsafe fn gdext_on_level_init(level: InitLevel) {
143143
unsafe { ensure_godot_features_compatible() };
144144
}
145145
InitLevel::Editor => {
146-
#[cfg(all(since_api = "4.3", feature = "docs"))]
146+
#[cfg(all(since_api = "4.3", feature = "register-docs"))]
147147
// SAFETY: Godot binding is initialized, and this is called from the main thread.
148148
unsafe {
149149
crate::docs::register();

godot-core/src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@
1515
pub mod builder;
1616
pub mod builtin;
1717
pub mod classes;
18-
#[cfg(all(since_api = "4.3", feature = "docs"))]
18+
#[cfg(all(since_api = "4.3", feature = "register-docs"))]
1919
pub mod docs;
2020
#[doc(hidden)]
2121
pub mod possibly_docs {
22-
#[cfg(all(since_api = "4.3", feature = "docs"))]
22+
#[cfg(all(since_api = "4.3", feature = "register-docs"))]
2323
pub use crate::docs::*;
2424
}
2525
pub mod global;
@@ -35,7 +35,7 @@ pub use godot_ffi as sys;
3535
// ----------------------------------------------------------------------------------------------------------------------------------------------
3636
// Validations (see also godot/lib.rs)
3737

38-
#[cfg(all(feature = "docs", before_api = "4.3"))]
38+
#[cfg(all(feature = "register-docs", before_api = "4.3"))]
3939
compile_error!("Generating editor docs for Rust symbols requires at least Godot 4.3.");
4040

4141
// ----------------------------------------------------------------------------------------------------------------------------------------------

godot-core/src/registry/class.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ fn fill_class_info(item: PluginItem, c: &mut ClassRegistrationInfo) {
243243
is_editor_plugin,
244244
is_internal,
245245
is_instantiable,
246-
#[cfg(all(since_api = "4.3", feature = "docs"))]
246+
#[cfg(all(since_api = "4.3", feature = "register-docs"))]
247247
docs: _,
248248
} => {
249249
c.parent_class_name = Some(base_class_name);
@@ -296,7 +296,7 @@ fn fill_class_info(item: PluginItem, c: &mut ClassRegistrationInfo) {
296296
PluginItem::InherentImpl(InherentImpl {
297297
register_methods_constants_fn,
298298
register_rpcs_fn: _,
299-
#[cfg(all(since_api = "4.3", feature = "docs"))]
299+
#[cfg(all(since_api = "4.3", feature = "register-docs"))]
300300
docs: _,
301301
}) => {
302302
c.register_methods_constants_fn = Some(register_methods_constants_fn);
@@ -315,7 +315,7 @@ fn fill_class_info(item: PluginItem, c: &mut ClassRegistrationInfo) {
315315
user_free_property_list_fn,
316316
user_property_can_revert_fn,
317317
user_property_get_revert_fn,
318-
#[cfg(all(since_api = "4.3", feature = "docs"))]
318+
#[cfg(all(since_api = "4.3", feature = "register-docs"))]
319319
virtual_method_docs: _,
320320
} => {
321321
c.user_register_fn = user_register_fn;

godot-core/src/registry/plugin.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
66
*/
77

8-
#[cfg(all(since_api = "4.3", feature = "docs"))]
8+
#[cfg(all(since_api = "4.3", feature = "register-docs"))]
99
use crate::docs::*;
1010
use crate::init::InitLevel;
1111
use crate::meta::ClassName;
@@ -65,7 +65,7 @@ pub struct InherentImpl {
6565
///
6666
/// This function is called in [`UserClass::__before_ready()`](crate::obj::UserClass::__before_ready) definitions generated by the `#[derive(GodotClass)]` macro.
6767
pub register_rpcs_fn: Option<ErasedRegisterRpcsFn>,
68-
#[cfg(all(since_api = "4.3", feature = "docs"))]
68+
#[cfg(all(since_api = "4.3", feature = "register-docs"))]
6969
pub docs: InherentImplDocs,
7070
}
7171

@@ -121,7 +121,7 @@ pub enum PluginItem {
121121

122122
/// Whether the class has a default constructor.
123123
is_instantiable: bool,
124-
#[cfg(all(since_api = "4.3", feature = "docs"))]
124+
#[cfg(all(since_api = "4.3", feature = "register-docs"))]
125125
docs: Option<StructDocs>,
126126
},
127127

@@ -130,7 +130,7 @@ pub enum PluginItem {
130130

131131
/// Collected from `#[godot_api] impl I... for MyClass`.
132132
ITraitImpl {
133-
#[cfg(all(since_api = "4.3", feature = "docs"))]
133+
#[cfg(all(since_api = "4.3", feature = "register-docs"))]
134134
/// Virtual method documentation.
135135
virtual_method_docs: &'static str,
136136
/// Callback to user-defined `register_class` function.

godot-macros/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ homepage = "https://godot-rust.github.io"
1212

1313
[features]
1414
api-custom = ["godot-bindings/api-custom"]
15-
docs = ["dep:markdown"]
15+
register-docs = ["dep:markdown"]
1616
codegen-full = ["godot/__codegen-full"]
1717

1818
[lib]

godot-macros/src/class/data_models/field.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ pub struct Field {
1515
pub var: Option<FieldVar>,
1616
pub export: Option<FieldExport>,
1717
pub is_onready: bool,
18-
#[cfg(feature = "docs")]
18+
#[cfg(feature = "register-docs")]
1919
pub attributes: Vec<venial::Attribute>,
2020
}
2121

@@ -28,7 +28,7 @@ impl Field {
2828
var: None,
2929
export: None,
3030
is_onready: false,
31-
#[cfg(feature = "docs")]
31+
#[cfg(feature = "register-docs")]
3232
attributes: field.attributes.clone(),
3333
}
3434
}

godot-macros/src/class/data_models/inherent_impl.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,9 @@ pub fn transform_inherent_impl(mut impl_block: venial::Impl) -> ParseResult<Toke
7474
let (funcs, signals) = process_godot_fns(&class_name, &mut impl_block)?;
7575
let consts = process_godot_constants(&mut impl_block)?;
7676

77-
#[cfg(all(feature = "docs", since_api = "4.3"))]
77+
#[cfg(all(feature = "register-docs", since_api = "4.3"))]
7878
let docs = crate::docs::make_inherent_impl_docs(&funcs, &consts, &signals);
79-
#[cfg(not(all(feature = "docs", since_api = "4.3")))]
79+
#[cfg(not(all(feature = "register-docs", since_api = "4.3")))]
8080
let docs = quote! {};
8181

8282
let signal_registrations = make_signal_registrations(signals, &class_name_obj);

godot-macros/src/class/data_models/interface_trait_impl.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@ pub fn transform_trait_impl(original_impl: venial::Impl) -> ParseResult<TokenStr
4242
let mut virtual_method_names = vec![];
4343

4444
let prv = quote! { ::godot::private };
45-
#[cfg(all(feature = "docs", since_api = "4.3"))]
45+
#[cfg(all(feature = "register-docs", since_api = "4.3"))]
4646
let docs = crate::docs::make_virtual_impl_docs(&original_impl.body_items);
47-
#[cfg(not(all(feature = "docs", since_api = "4.3")))]
47+
#[cfg(not(all(feature = "register-docs", since_api = "4.3")))]
4848
let docs = quote! {};
4949
for item in original_impl.body_items.iter() {
5050
let method = if let venial::ImplMember::AssocFunction(f) = item {

godot-macros/src/class/derive_godot_class.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,13 @@ pub fn derive_godot_class(item: venial::Item) -> ParseResult<TokenStream> {
4646

4747
let is_internal = struct_cfg.is_internal;
4848
let base_ty = &struct_cfg.base_ty;
49-
#[cfg(all(feature = "docs", since_api = "4.3"))]
49+
#[cfg(all(feature = "register-docs", since_api = "4.3"))]
5050
let docs = crate::docs::make_definition_docs(
5151
base_ty.to_string(),
5252
&class.attributes,
5353
&fields.all_fields,
5454
);
55-
#[cfg(not(all(feature = "docs", since_api = "4.3")))]
55+
#[cfg(not(all(feature = "register-docs", since_api = "4.3")))]
5656
let docs = quote! {};
5757
let base_class = quote! { ::godot::classes::#base_ty };
5858
let base_class_name_obj = util::class_name_obj(&base_class);

0 commit comments

Comments
 (0)