Running `cargo codegen --check` should not generate any mdbook files,
since they are ignored in the repo and used only while releasing a new
copy of the documentation.
Signed-off-by: Prajwal S N <prajwalnadig21@gmail.com>
When running `cargo codegen` the `crates/parser/test_data/generated/runner.rs` file is only updated when some file in `crates/parser/test_data/inline` changes. However this is not sufficient in all cases
Split manual.adoc into markdown files, one for each chapter.
For the parts of the manual that are generated from source code doc
comments, update the comments to use markdown syntax and update the
code generators to write to `generated.md` files.
For the weekly release, stop copying the .adoc files to the
`rust-analyzer/rust-analyzer.github.io` at release time. Instead,
we'll sync the manual hourly from this repository.
See https://github.com/rust-analyzer/rust-analyzer.github.io/pull/226
for the sync. This PR should be merged first, and that PR needs to be
merged before the next weekly release.
This change is based on #15795, but rebased and updated. I've also
manually checked each page for markdown syntax issues and fixed any I
encountered.
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
Co-authored-by: Josh Rotenberg <joshrotenberg@gmail.com>
Previously all lints were assumed to be `#[warn]`, and we had a hand-coded list of `#[allow]` exceptions. Now the severity is autogenerated from rustdoc output.
Also support lints that change status between editions, and the `warnings` lint group.
Thanks to the observation (supported by counting) that the vast majority paths have neither generics no type anchors, and thanks to a new datastructure `ThinVecWithHeader` that is essentially `(T, Box<[U]>)` but with the size of a single pointer, we are able to reach this feat.
This (together with `ThinVecWithHeader`) makes the possibility to shrink `TypeRef`, because most types are paths.
When formatting generated code the xtask crate attempts to run `rustup run stable rustfmt`,
which fails if `rustup` is not installed. This results in test failures when another source manages
the compiler toolchain, for example when using Nix (or any other distro-specific packaging solution):
* xtask::codegen::grammar::test
* xtask::codegen::assists_doc_tests::test
With this commit xtask will first attempt to run `rustup run stable rustfmt`, and if that fails just
plain `rustfmt`. It still validates a stable version is being used.
This allows `cargo test` to pass on systems that do not use `rustup`.