| Age | Commit message (Collapse) | Author | Lines |
|
|
|
|
|
setup typos check in CI
This allows to check typos in CI, currently for compiler only (to reduce commit size with fixes). With current setup, exclude list is quite short, so it worth trying?
Also includes commits with actual typo fixes.
MCP: https://github.com/rust-lang/compiler-team/issues/817
typos check currently turned for:
* ./compiler
* ./library
* ./src/bootstrap
* ./src/librustdoc
After merging, PRs which enables checks for other crates (tools) can be implemented too.
Found typos will **not break** other jobs immediately: (tests, building compiler for perf run). Job will be marked as red on completion in ~ 20 secs, so you will not forget to fix it whenever you want, before merging pr.
Check typos: `python x.py test tidy --extra-checks=spellcheck`
Apply typo fixes: `python x.py test tidy --extra-checks=spellcheck:fix` (in case if there only 1 suggestion of each typo)
Current fail in this pr is expected and shows how typo errors emitted. Commit with error will be removed after r+.
|
|
|
|
|
|
r=GuillaumeGomez
Rustdoc js: even more typechecking improvements
I noticed some oddities when I went to start working on type aliases, so I've gone and cleaned up a bunch of stuff. Notably `fullId` was nearly always an integer in practice, but tsc was being told it should be a string.
r? ``@notriddle``
|
|
non-exhaustive list of changes:
* rustdoc.Results has a max_dist field
* improve typechecking around pathDist and addIntoResults
* give handleNameSearch a type signature
* typecheck sortQ
* currentCrate is string and not optional
* searchState is referenced as a global, not through window
|
|
Fixes firefox copy paste issue
|
|
|
|
r=lolbinarycat
Fix random failure when JS code is executed when the whole file was not read yet
Very randomly (and rarely), when I arrived on a page with `?search=something` in the URL, I got this error:

Moving the `initSearch` function at the bottom to ensure everything has been loaded fixes the issue.
PS: Sorry for the noise. Pushed to the wrong branch and https://github.com/rust-lang/rust/pull/142496 closed. ><
|
|
Lint about `console` calls in rustdoc JS
As discussed [here](https://github.com/rust-lang/rust/pull/142100#discussion_r2151764395), this PR enforces that `console` is not used in rustdoc JS by default.
cc `@lolbinarycat`
|
|
|
|
this is one-time initialization data, it can just
be a function parameter.
we also move the json parsing into createSrcSidebar
to save a few bytes.
|
|
`search.js`
|
|
|
|
rustdoc: on mobile, make the sidebar full width and linewrap
this is because the mobile sidebar cannot be resized, unlike on desktop.
|
|
r=notriddle
rustdoc: Fix links with inline code in trait impl docs
Fixes #140857
|
|
this is because the mobile sidebar cannot be resized,
unlike on desktop.
|
|
|
|
|
|
This change is based on some discussion on [lolbinarycat's idea],
but with a more "traditional" design. Specifically, this is the
closest thing I could find to a consensus across many systems I
looked at for inspiration:
- In Jira, resizable sidebars have a stack of four dots.
- In The GIMP, resizable sidebars have a stack of three dots.
- In [old Windows], "panes" are defined to have the same border
style as a window, which has a raised appearance.
- In [NeXT], a drag point usually had an innie, whether the line in a
slider or the circle in a scroller; I can also hide and show the
favorites bar in Workspace by dragging on a circular "grip spot"
- In [old Mac], drag handles for things usually had a "grip track"
of parallel lines.
- [OSX] kept that, but the "Source List" part of the Finder still had
the circle grip for a time the same way Workspace did
[lolbinarycat's idea]: https://github.com/rust-lang/rust/pull/139420
[old Windows]: https://archive.org/details/windowsinterface00micr/page/n9/mode/2up
[old Mac]: https://archive.org/details/apple-hig/1996_Human_Interface_Guidelines_for_Mac_OS_8_%28WWDC_Release%29/page/16/mode/2up
[NeXT]: https://archive.org/details/apple-hig/1993%20NeXTSTEP%20User%20Interface%20Guidelines%20-%20Release%203/page/145/mode/2up
[OSX]: https://dn721903.ca.archive.org/0/items/apple-hig/MacOSX_HIG_2005_09_08.pdf#page=267
|
|
Unify sidebar buttons to use the same image
Part of https://github.com/rust-lang/rust/issues/139832.
The source sidebar looks like this with the new image:

You can test it [here](https://rustdoc.crud.net/imperio/sidebar-images/src/foo/foo.rs.html).
r? `@notriddle`
|
|
|
|
|
|
|
|
|
|
r=notriddle
Rustdoc: typecheck settings.js
This makes the file fully typechecked with no instances of ``````@ts-expect-error`````` and no type casts.
r? `````@notriddle`````
|
|
|
|
|
|
|
|
this allows us to eliminate the last 3 @ts-expect-error
in this file.
|
|
"true" looks like a string value, `true` makes it more clear
that we are talking about the actual boolean value.
|
|
With this, almost the entire file is fully typechecked,
the only exception being the Element.contains(EventTarget) pattern
that is used several times, those are annotated with
@ts-expect-error
|
|
|
|
changes:
* Add type signature
* Add null checks
* getHelpButton and getSettingsButton are only called once,
which should marginally improve performance due to less queries.
unfortunatly 2 @ts-expect-error was needed,
as typescript is unaware the EventTarget is likely an Element.
|
|
|
|
|
|
this also makes `changeSetting` more robust in case it somehow
gets called before `main.js` has finished loading.
|
|
specifically, `storage.js` is not loaded during `rustdoc-js`
and `rustdoc-js-std` tests.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
only errors that are string arrays are intended to be shown
to the user, other errors are bugs,
and will be shown in the console as usual.
|
|
|