Skip to content

Conversation

@GuillaumeGomez
Copy link
Member

Part of #137645.

Since it adds more information for attributes, I suppose the next step could be to add span on them as well.

cc @Urgau for the compiler changes.
r? @aDotInTheVoid

@rustbot rustbot added A-rustdoc-json Area: Rustdoc JSON backend S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output. labels Apr 28, 2025
@rustbot
Copy link
Collaborator

rustbot commented Apr 28, 2025

Some changes occurred in tests/rustdoc-json

cc @aDotInTheVoid

rustdoc-json-types is a public (although nightly-only) API. If possible, consider changing src/librustdoc/json/conversions.rs; otherwise, make sure you bump the FORMAT_VERSION constant.

cc @CraftSpider, @aDotInTheVoid, @Enselic, @obi1kenobi

@rust-log-analyzer

This comment has been minimized.

@GuillaumeGomez
Copy link
Member Author

Removed the extra empty line at the end of the file. ^^'

Copy link
Member

@Urgau Urgau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Compiler changes looks good.

@aDotInTheVoid
Copy link
Member

What's the purpose of doing this? Is their any time when someone would want this information from rustdoc-json?

My instinct is that the differentiation between inner and outer attributes is purely syntactic, and therefor it's fine for rustdoc-json to not contain this information.

@GuillaumeGomez
Copy link
Member Author

I have to admit that I mostly wanted a pretext to add a new Attribute type to be able to add Span information to attributes. I can still do it instead of adding the is_inner information.

@GuillaumeGomez
Copy link
Member Author

Now that I think about it: some attributes are only allowed to be inner only (and at crate levels). I think it's actually kinda important to allow users to know if it's inner or outer because of this.

@aDotInTheVoid
Copy link
Member

I have to admit that I mostly wanted a pretext to add a new Attribute type to be able to add Span information to attributes

What use-case do you have for this?

Now that I think about it: some attributes are only allowed to be inner only (and at crate levels). I think it's actually kinda important to allow users to know if it's inner or outer because of this.

Why? In what case does a rustdoc-json consumer need to know if an item is inner or outer.

@GuillaumeGomez
Copy link
Member Author

I have to admit that I mostly wanted a pretext to add a new Attribute type to be able to add Span information to attributes

What use-case do you have for this?

Same as for other spans I suppose? But if you don't think it's ever useful, it's fine not to add it. I'm not a rustdoc JSON user after all. 😆

Now that I think about it: some attributes are only allowed to be inner only (and at crate levels). I think it's actually kinda important to allow users to know if it's inner or outer because of this.

Why? In what case does a rustdoc-json consumer need to know if an item is inner or outer.

Well, no idea. So maybe never?

@aDotInTheVoid
Copy link
Member

I think in that case I'm gonna close this. If someone has a use-case for when they'd want this information, I'd be happy to reconsider.

@GuillaumeGomez
Copy link
Member Author

No problem! :)

@GuillaumeGomez GuillaumeGomez deleted the rustdoc-json-attrs branch April 30, 2025 18:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-rustdoc-json Area: Rustdoc JSON backend S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants