Skip to content

Commit b088305

Browse files
committed
Refactor #[godot_api] macro handler
1 parent 033a131 commit b088305

File tree

4 files changed

+413
-246
lines changed

4 files changed

+413
-246
lines changed

godot-codegen/src/models/domain_mapping.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,6 @@ impl ClassMethod {
458458
}
459459

460460
let is_private = special_cases::is_method_private(class_name, &method.name);
461-
462461
let godot_method_name = method.name.clone();
463462

464463
let qualifier = {

godot-codegen/src/special_cases/special_cases.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121

2222
// NOTE: the methods are generally implemented on Godot types (e.g. AABB, not Aabb)
2323

24+
// This file is deliberately private -- all checks must go through `special_cases`.
25+
2426
#![allow(clippy::match_like_matches_macro)] // if there is only one rule
2527

2628
use crate::conv::to_enum_type_uncached;
@@ -29,7 +31,6 @@ use crate::models::json::{JsonBuiltinMethod, JsonClassMethod, JsonUtilityFunctio
2931
use crate::special_cases::codegen_special_cases;
3032
use crate::Context;
3133
use proc_macro2::Ident;
32-
// Deliberately private -- all checks must go through `special_cases`.
3334

3435
#[rustfmt::skip]
3536
pub fn is_class_method_deleted(class_name: &TyName, method: &JsonClassMethod, ctx: &mut Context) -> bool {
@@ -62,7 +63,7 @@ pub fn is_class_method_deleted(class_name: &TyName, method: &JsonClassMethod, ct
6263
| ("VisualShaderNodeComment", "set_description")
6364
| ("VisualShaderNodeComment", "get_description")
6465
=> true,
65-
66+
6667
// Workaround for methods unexposed in Release mode, see https://github.com/godotengine/godot/pull/100317
6768
// and https://github.com/godotengine/godot/pull/100328.
6869
#[cfg(not(debug_assertions))]
@@ -840,9 +841,9 @@ pub fn is_enum_private(class_name: Option<&TyName>, enum_name: &str) -> bool {
840841
}
841842

842843
/// Certain enums that are extremely unlikely to get new identifiers in the future.
843-
///
844+
///
844845
/// `class_name` = None for global enums.
845-
///
846+
///
846847
/// Very conservative, only includes a few enums. Even `VariantType` was extended over time.
847848
/// Also does not work for any enums containing duplicate ordinals.
848849
#[rustfmt::skip]
@@ -873,7 +874,7 @@ pub fn is_enum_bitfield(class_name: Option<&TyName>, enum_name: &str) -> Option<
873874
match (class_name, enum_name) {
874875
| (Some("Object"), "ConnectFlags")
875876

876-
=> Some(true),
877+
=> Some(true),
877878
_ => None
878879
}
879880
}

0 commit comments

Comments
 (0)