Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support extern crate #25

Open
gilescope opened this issue Jan 18, 2024 · 3 comments
Open

support extern crate #25

gilescope opened this issue Jan 18, 2024 · 3 comments

Comments

@gilescope
Copy link

gilescope commented Jan 18, 2024

I'm looking at paritytech/polkadot-sdk#2101 but in your_first_pallet I can't see how to add in the alloc statement at the start of the crate. I thought this might work:

#[docify::export]
extern crate alloc;

but seems not. Any thoughts?

@sam0x17
Copy link
Owner

sam0x17 commented Jan 18, 2024

this line essentially governs what items are supported: https://github.com/sam0x17/docify/blob/main/macros/src/lib.rs#L618

So if all of those traits are implemented for ItemExternCrate then it should be supported. If not, would be pretty easy to add support by submitting a PR that impls whatever traits are missing on that item. I don't have much bandwidth for this right now but happy to accept a PR that adds this

@sam0x17
Copy link
Owner

sam0x17 commented Jan 18, 2024

what's weird is it looks like extern crate should be supported: https://github.com/sam0x17/docify/blob/main/macros/src/lib.rs#L173

@sam0x17
Copy link
Owner

sam0x17 commented Jan 18, 2024

actually I would try giving it an explicit name like #[docify::export(some_name)], might be a naming collision

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants