Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Use proper intra doc links for macro generated code #9962

Closed
gui1117 opened this issue Oct 7, 2021 · 7 comments
Closed

Use proper intra doc links for macro generated code #9962

gui1117 opened this issue Oct 7, 2021 · 7 comments
Labels
Z1-easy Can be fixed primarily by duplicating and adapting code by an intermediate coder Z6-mentor An easy task where a mentor is available. Please indicate in the issue who the mentor could be.

Comments

@gui1117
Copy link
Contributor

gui1117 commented Oct 7, 2021

doc like

/// Create with system none origin and `frame-system::Config::BaseCallFilter`.
doesn't link to the item.

We should make a correct item link.

@gui1117 gui1117 added Z6-mentor An easy task where a mentor is available. Please indicate in the issue who the mentor could be. Z1-easy Can be fixed primarily by duplicating and adapting code by an intermediate coder labels Oct 7, 2021
@zh-beep
Copy link

zh-beep commented Oct 22, 2021

@thiolliere - I'm currently learning Rust and would like to contribute, would I be able to help with this issue?

@gui1117
Copy link
Contributor Author

gui1117 commented Oct 22, 2021

in the example in the top message instead of frame-system::Config::BaseCallFilter we should have a doc link so something like

[`frame_system::Config::BaseCallFilter`]

But because frame_system crate can be renamed in the Cargo.toml we should get the correct name. So at the end the doc generated might look like:

///  Create with system none origin and `[
#[doc = #frame_system]
/// ::Config::BaseCallFilter`]

I'm not sure it works or maybe otherwise:

///  Create with system none origin and 
#[doc = #doc_item]
/// .

I mean I don't really know the implementation but at the end it should have the correct link when we generate the doc with cargo doc.

@dharjeezy
Copy link
Contributor

Is this issue done? @thiolliere can I pick the issue up?

@gui1117
Copy link
Contributor Author

gui1117 commented Nov 15, 2021

anybody can submit a PR which solve this issue, they can also ping my name on the PR top message.

On master I still see those which could have a intra doc link:

frame/support/procedural/src/construct_runtime/expand/origin.rs:185:			/// Create with system none origin and `frame-system::Config::BaseCallFilter`.
frame/support/procedural/src/construct_runtime/expand/origin.rs:189:			/// Create with system root origin and `frame-system::Config::BaseCallFilter`.
frame/support/procedural/src/construct_runtime/expand/origin.rs:193:			/// Create with system signed origin and `frame-system::Config::BaseCallFilter`.
frame/support/procedural/src/construct_runtime/expand/origin.rs:219:			/// Convert to runtime origin, using as filter: `frame-system::Config::BaseCallFilter`.
frame/support/procedural/src/construct_runtime/expand/origin.rs:251:			/// `frame-system::Config::BaseCallFilter`.
frame/support/procedural/src/construct_runtime/expand/origin.rs:314:			/// Convert to runtime origin using `frame-system::Config::BaseCallFilter`.
frame/support/procedural/src/construct_runtime/expand/origin.rs:78:		/// Origin is always created with the base filter configured in `frame_system::Config::BaseCallFilter`.

@dharjeezy
Copy link
Contributor

can you check the PR i created @thiolliere

@dharjeezy
Copy link
Contributor

@thiolliere i have updated the PR i opened. could you take a look now.

@KiChjang
Copy link
Contributor

KiChjang commented Dec 8, 2021

Fixed by #10271.

@KiChjang KiChjang closed this as completed Dec 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Z1-easy Can be fixed primarily by duplicating and adapting code by an intermediate coder Z6-mentor An easy task where a mentor is available. Please indicate in the issue who the mentor could be.
Projects
None yet
Development

No branches or pull requests

4 participants