From 276d4457c35cc31881289a756b36b92f6717f455 Mon Sep 17 00:00:00 2001 From: Stephen Chung Date: Mon, 25 Jul 2022 16:59:11 +0800 Subject: [PATCH] Add field to get_fn_metadata_list. --- src/packages/lang_core.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/packages/lang_core.rs b/src/packages/lang_core.rs index a82a5fa4..2390487d 100644 --- a/src/packages/lang_core.rs +++ b/src/packages/lang_core.rs @@ -174,6 +174,17 @@ fn collect_fn_metadata( .collect::() .into(), ); + #[cfg(feature = "metadata")] + if !func.comments.is_empty() { + map.insert( + dict.get("comments").expect(DICT).clone(), + func.comments + .iter() + .map(|s| Into::into(&**s)) + .collect::() + .into(), + ); + } map } @@ -188,6 +199,8 @@ fn collect_fn_metadata( "private", "is_anonymous", "params", + #[cfg(feature = "metadata")] + "comments", ] .iter() .map(|&s| s.into())