-
-
Notifications
You must be signed in to change notification settings - Fork 14.4k
Add new "hide deprecated items" setting in rustdoc #151091
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
Add new "hide deprecated items" setting in rustdoc #151091
Conversation
|
Some changes occurred in HTML/CSS/JS. |
This comment has been minimized.
This comment has been minimized.
1fe45dd to
4622f64
Compare
This comment has been minimized.
This comment has been minimized.
1 similar comment
This comment has been minimized.
This comment has been minimized.
|
Rebased so it includes #151053, which hopefully should fix the flakyness issue. |
|
This made me realize that we use the word "hide" inconsistently in this settings panel, sometimes we mean "collapse, with a button to expand it again", and sometimes we mean "act like it doesn't exist at all". I think the former should be referred to with the verb "Collapse", I think that would make things seem a bit less inconsistent. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Logic looks sound, but there's a bunch of stuff that I think could be written either more readably or more compactly, and there's a few more test cases I would like to see.
|
@rustbot author |
4622f64 to
33bbf06
Compare
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
|
@rustbot ready |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks much better (better than what I would've written, even), but I'm still not 100% satisfied with the tests.
33bbf06 to
893a742
Compare
|
Applied parts of the suggestions. |
…ng is working as expected
… setting, allowing to simplify JS code
893a742 to
bf49068
Compare
|
One final bit of test coverage I would like to see: when searching |
… value in the end, no need to keep it around. Also: takes into account "is_in_effect"
Improve the `perform-search` goml function to work when search is already open
|
Thanks! @bors r+ |
Add new "hide deprecated items" setting in rustdoc This PR adds a new JS setting which allows the JS to hide deprecated items. This is especially useful for crates like `std` which accumulates deprecated items but never removes them. Nicely enough, the "deprecation" information was already in the search index, meaning I didn't need to change anything there. Before this PR, it was only used to make the deprecated items rank lower. Well now it's also used to generate an extra CSS class, allowing the JS setting to work. This is taking over rust-lang#149551. This feature got approved by the rustdoc team in the [meeting of december](https://rust-lang.zulipchat.com/#narrow/channel/393423-t-rustdoc.2Fmeetings/topic/2025-12-08/near/562553156). You can give it a try [here](https://rustdoc.crud.net/imperio/hide-deprecated-items/foo/index.html). r? @lolbinarycat
Rollup of 8 pull requests Successful merges: - #149587 (coverage: Sort the expansion tree to help choose a single BCB for child expansions) - #150071 (Add dist step for Enzyme) - #150288 (Add scalar support for offload) - #151091 (Add new "hide deprecated items" setting in rustdoc) - #151255 (rustdoc: Fix ICE when deprecated note is not resolved on the correct `DefId`) - #151375 (Fix terminal width dependent tests) - #151384 (add basic `TokenStream` api tests) - #151391 (rustc-dev-guide subtree update) r? @ghost
Rollup merge of #151091 - hide-deprecated-items, r=lolbinarycat Add new "hide deprecated items" setting in rustdoc This PR adds a new JS setting which allows the JS to hide deprecated items. This is especially useful for crates like `std` which accumulates deprecated items but never removes them. Nicely enough, the "deprecation" information was already in the search index, meaning I didn't need to change anything there. Before this PR, it was only used to make the deprecated items rank lower. Well now it's also used to generate an extra CSS class, allowing the JS setting to work. This is taking over #149551. This feature got approved by the rustdoc team in the [meeting of december](https://rust-lang.zulipchat.com/#narrow/channel/393423-t-rustdoc.2Fmeetings/topic/2025-12-08/near/562553156). You can give it a try [here](https://rustdoc.crud.net/imperio/hide-deprecated-items/foo/index.html). r? @lolbinarycat
|
Thanks to this check, I discovered that the |
Rollup of 8 pull requests Successful merges: - rust-lang/rust#149587 (coverage: Sort the expansion tree to help choose a single BCB for child expansions) - rust-lang/rust#150071 (Add dist step for Enzyme) - rust-lang/rust#150288 (Add scalar support for offload) - rust-lang/rust#151091 (Add new "hide deprecated items" setting in rustdoc) - rust-lang/rust#151255 (rustdoc: Fix ICE when deprecated note is not resolved on the correct `DefId`) - rust-lang/rust#151375 (Fix terminal width dependent tests) - rust-lang/rust#151384 (add basic `TokenStream` api tests) - rust-lang/rust#151391 (rustc-dev-guide subtree update) r? @ghost
|
Be advised of some |
This PR adds a new JS setting which allows the JS to hide deprecated items. This is especially useful for crates like
stdwhich accumulates deprecated items but never removes them.Nicely enough, the "deprecation" information was already in the search index, meaning I didn't need to change anything there. Before this PR, it was only used to make the deprecated items rank lower. Well now it's also used to generate an extra CSS class, allowing the JS setting to work.
This is taking over #149551.
This feature got approved by the rustdoc team in the meeting of december.
You can give it a try here.
r? @lolbinarycat