toolkit for mdBook [mirror of my GitHub repo] docs.tonywu.dev/mdbookkit/
permalinks rust-analyzer mdbook
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat(rustdoc-links): warn on cache miss due to failed resolution

Tony Wu 5a1d291c c448e682

+11 -2
-1
crates/mdbook-rustdoc-links/src/env.rs
··· 64 64 #[arg(long, value_name("PATH"), value_hint(clap::ValueHint::DirPath))] 65 65 pub manifest_dir: Option<PathBuf>, 66 66 67 - // TODO: warn on cache miss due to failed resolution 68 67 /// Directory in which to persist build cache. 69 68 /// 70 69 /// Setting this will enable caching. Will skip rust-analyzer if cache hits.
+9
crates/mdbook-rustdoc-links/src/main.rs
··· 22 22 cache::{Cache, FileCache}, 23 23 client::Client, 24 24 env::{Config, Environment, RustAnalyzer}, 25 + link::diagnostic::LinkStatus, 25 26 page::Pages, 26 27 resolver::Resolver, 27 28 }; ··· 143 144 book.to_stdout(&ctx)?; 144 145 145 146 env.config.fail_on_warnings.check(status.level())?; 147 + 148 + if env.config.cache_dir.is_some() && status == LinkStatus::Unresolved { 149 + log::warn!( 150 + "The `cache-dir` option is enabled, but some items were \ 151 + not resolved, which will cause rust-analyzer to always run \ 152 + despite the cache." 153 + ); 154 + } 146 155 147 156 Ok(()) 148 157 }
+1
docs/src/index.md
··· 1 + [abc]
+1 -1
docs/src/rustdoc-links/caching.md
··· 36 36 > patterns][specify-exclude-patterns] in the mdBook documentation. 37 37 > 38 38 > Items that fail to resolve are not included in the cache. If such "broken" links 39 - > persist in the Markdown source, cache will be invalidated on every run, and 39 + > persist in the Markdown source, cache will be invalidated on every build, and 40 40 > rust-analyzer will always run. 41 41 > 42 42 > **Do not** use your book's `build-dir` as the `cache-dir`: mdbook clears the output