Skip to content

rustdoc: add ways of collapsing all impl blocks #141663

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

lolbinarycat
Copy link
Contributor

either shift+click the Summary button,
or use the _ key.

this collapses everything,
including (inherent) impl blocks.

no need for a special "expand all impl blocks"
method, as impl blocks are expanded during regular "expand all".
doing "expand all" -> "collapse all" will always
result in only impl blocks being expaned.

not sure the best way to add a GUI test.

fixes #134429

either shift+click the Summary button,
or use the `_` key.

this collapses everything,
including (inherent) impl blocks.

no need for a special "expand all impl blocks"
method, as impl blocks are expanded during regular
"expand all".
doing "expand all" -> "collapse all" will always
result in only impl blocks being expaned.
@rustbot
Copy link
Collaborator

rustbot commented May 27, 2025

r? @notriddle

rustbot has assigned @notriddle.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. 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 May 27, 2025
@rustbot
Copy link
Collaborator

rustbot commented May 27, 2025

Some changes occurred in HTML/CSS/JS.

cc @GuillaumeGomez, @jsha, @lolbinarycat

@rust-log-analyzer

This comment has been minimized.

done a bit awkwardly to try to avoid introducing
new whitespaces nodes, which could affect display
@GuillaumeGomez
Copy link
Member

I'm neutral about this. I don't see the need but I suppose if someone opened the issue, there is one...

cc @rust-lang/rustdoc-frontend

@lolbinarycat
Copy link
Contributor Author

It's a small improvement, but I think it is helpful, especially for internal docs. For example, if I had this, I might not have made the mistake of initially adding BufReader::peek to the wrong impl block. The feature also seems very trivial to implement and maintain.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. 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.

rustdoc: Quick way to collapse all impl blocks
5 participants