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

source_excerpt: can't find item in source v0.2.5 #18

Closed
ggwpez opened this issue Oct 27, 2023 · 1 comment · Fixed by #19
Closed

source_excerpt: can't find item in source v0.2.5 #18

ggwpez opened this issue Oct 27, 2023 · 1 comment · Fixed by #19

Comments

@ggwpez
Copy link

ggwpez commented Oct 27, 2023

Clicked the bug report button, very cool 😋

Reproduce on commit Polkadot-SDK 2058ca363 with cargo t -p pallet-parameters.

 1  error: You have found a bug in docify! Please submit a new GitHub issue at https://github.com/sam0x17/docify/issues/new?title=%60source_excerpt%60%3A%20can%27t%20find%20item%20in%20source with a sam▐
 ple of the item you are trying to embed.                                                                                                                                                                 ▐
   --> substrate/frame/parameters/src/lib.rs:42:10                                                                                                                                                        ▐
    |                                                                                                                                                                                                     ▐
 42 | #![doc = docify::embed!("src/mock.rs", dynamic_params)]                                                                                                                                             ▐
    |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^                                                                                                                                              ▐
    |                                                                                                                                                                                                     ▐
    = note: this error originates in the macro `docify::embed` (in Nightly builds, run with -Z macro-backtrace for more info)                                                                             ▐
                                                                                                                                                                                                          ▐
 error: could not compile `pallet-parameters` (lib) due to previous error 

PS: I see its probably because i wanted multiple exports?
When i remove the export on the pallet1 then it works. But would be nice if it worked as well with the nested ones.

@sam0x17
Copy link
Owner

sam0x17 commented Oct 27, 2023

Clicked the bug report button, very cool 😋

@ggwpez yeah I actually originally had it bake the item sample into the link so it would write the full issue for you with a test case that should reproduce it, but it made the link so long that it got a bit silly and broke some browsers 😆

Will look at this one. It's not always something in the actual item itself, last time it was actually multi-byte UTF-8 characters existing in the file would cause an issue, but first step for me is to write a test case for that exact item and see what happens 👍🏻

sam0x17 added a commit that referenced this issue Oct 27, 2023
sam0x17 added a commit that referenced this issue Oct 27, 2023
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

Successfully merging a pull request may close this issue.

2 participants