Skip to content

Commit ee4f2ed

Browse files
committed
Fix check.sh itest
Fake doctest symbols for #[rpc], so that it can be used without codegen-full feature.
1 parent ba03a6d commit ee4f2ed

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

godot-macros/src/lib.rs

+14-1
Original file line numberDiff line numberDiff line change
@@ -710,10 +710,23 @@ pub fn derive_godot_class(input: TokenStream) -> TokenStream {
710710
/// `#[rpc]` implies `#[func]`. You can use both attributes together, if you need to configure other `#[func]`-specific keys.
711711
///
712712
/// For example, the following method declarations are all equivalent:
713-
/// ```
713+
/// ```no_run
714+
/// # // Polyfill without full codegen.
715+
/// # #![allow(non_camel_case_types)]
716+
/// # #[cfg(not(feature = "codegen-full"))]
717+
/// # enum RpcMode { DISABLED, ANY_PEER, AUTHORITY }
718+
/// # #[cfg(not(feature = "codegen-full"))]
719+
/// # enum TransferMode { UNRELIABLE, UNRELIABLE_ORDERED, RELIABLE }
720+
/// # #[cfg(not(feature = "codegen-full"))]
721+
/// # pub struct RpcConfig { pub rpc_mode: RpcMode, pub transfer_mode: TransferMode, pub call_local: bool, pub channel: u32 }
722+
/// # #[cfg(not(feature = "codegen-full"))]
723+
/// # impl Default for RpcConfig { fn default() -> Self { todo!("never called") } }
724+
/// # #[cfg(feature = "codegen-full")]
714725
/// use godot::classes::multiplayer_api::RpcMode;
726+
/// # #[cfg(feature = "codegen-full")]
715727
/// use godot::classes::multiplayer_peer::TransferMode;
716728
/// use godot::prelude::*;
729+
/// # #[cfg(feature = "codegen-full")]
717730
/// use godot::register::RpcConfig;
718731
///
719732
/// # #[derive(GodotClass)]

0 commit comments

Comments
 (0)