@@ -9,7 +9,7 @@ use crate::context::Context;
9
9
use crate :: generator:: builtins;
10
10
use crate :: models:: domain:: { ExtensionApi , ModName , NativeStructure , TyName } ;
11
11
use crate :: util:: ident;
12
- use crate :: { conv, util, SubmitFn } ;
12
+ use crate :: { conv, special_cases , util, SubmitFn } ;
13
13
use proc_macro2:: TokenStream ;
14
14
use quote:: { format_ident, quote} ;
15
15
use std:: path:: Path ;
@@ -25,6 +25,11 @@ pub fn generate_native_structures_files(
25
25
26
26
let mut modules = vec ! [ ] ;
27
27
for native_structure in api. native_structures . iter ( ) {
28
+ // Some may be excluded in minimal codegen, because they hold codegen-excluded classes as fields.
29
+ if special_cases:: is_native_struct_excluded ( & native_structure. name ) {
30
+ continue ;
31
+ }
32
+
28
33
let module_name = ModName :: from_godot ( & native_structure. name ) ;
29
34
let class_name = TyName :: from_godot ( & native_structure. name ) ;
30
35
@@ -232,10 +237,11 @@ fn make_native_structure_field_and_accessor(
232
237
( field_def, accessor)
233
238
}
234
239
240
+ /// Native structures use a different format for enums than the rest of the JSON file.
241
+ /// If we detect a scoped field, convert it to the enum format expected by to_rust_type().
242
+ ///
243
+ /// Example: `TextServer::Direction` -> `enum::TextServer.Direction`.
235
244
fn normalize_native_structure_field_type ( field_type : & str ) -> String {
236
- // native_structures uses a different format for enums than the
237
- // rest of the JSON file. If we detect a scoped field, convert it
238
- // to the enum format expected by to_rust_type.
239
245
if field_type. contains ( "::" ) {
240
246
let with_dot = field_type. replace ( "::" , "." ) ;
241
247
format ! ( "enum::{}" , with_dot)
0 commit comments