···11---
22source: crates/mdbookkit/tests/rustdoc_link.rs
33-assertion_line: 31
43expression: output
54---
65# mdbook-rustdoc-link
···81808281This project is released under the [Apache 2.0 License](/LICENSE-APACHE.md) and the
8382[MIT License](/LICENSE-MIT.md).
8484-8585----
86838784[^1]: Text adapted from [<cite>A Tour of The Rust Standard Library</cite>][tour]
8885
···252252253253<!-- prettier-ignore-end -->
254254255255----
256256-257255[^1]:
258256 rust-analyzer's ability to generate links for enum variants like `Option::Some` was
259257 improved only somewhat recently: before
···265265 248 │
266266 249 │ <!-- prettier-ignore-end -->
267267 250 │
268268- 251 │ ---
269269- 252 │
270270- 253 │ [^1]:
271271- 254 │ rust-analyzer's ability to generate links for enum variants like `Option::Some` was
272272- 255 │ improved only somewhat recently: before
273273- 256 │ [#19246](https://github.com/rust-lang/rust-analyzer/pull/19246), links for variants
274274- 257 │ and associated items may only point to the types themselves. If linking to such
275275- 258 │ items doesn't seem to work for you, be sure to upgrade to a newer rust-analyzer
276276- 259 │ first!
277277- 260 │
278278- 261 │ [^2]:
279279- 262 │ As of rust-analyzer <ra-version>(version)</ra-version>, links generated for macros
280280- 263 │ don't always work. Examples include [`std::format!`] (seen above) and
268268+ 251 │ [^1]:
269269+ 252 │ rust-analyzer's ability to generate links for enum variants like `Option::Some` was
270270+ 253 │ improved only somewhat recently: before
271271+ 254 │ [#19246](https://github.com/rust-lang/rust-analyzer/pull/19246), links for variants
272272+ 255 │ and associated items may only point to the types themselves. If linking to such
273273+ 256 │ items doesn't seem to work for you, be sure to upgrade to a newer rust-analyzer
274274+ 257 │ first!
275275+ 258 │
276276+ 259 │ [^2]:
277277+ 260 │ As of rust-analyzer <ra-version>(version)</ra-version>, links generated for macros
278278+ 261 │ don't always work. Examples include [`std::format!`] (seen above) and
281279 · ────────┬───────
282280 · ╰── https://doc.rust-lang.org/stable/alloc/macros/macro.format.html
283283- 264 │ [`tokio::main!`]. For more info, see [Known issues](known-issues.md#macros).
281281+ 262 │ [`tokio::main!`]. For more info, see [Known issues](known-issues.md#macros).
284282 · ────────┬───────
285283 · ╰── https://docs.rs/tokio-macros/2.5.0/tokio_macros/macro.main.html
286286- 265 │
284284+ 263 │
287285 ╰────
···7777This project is released under the [Apache 2.0 License](/LICENSE-APACHE.md) and the
7878[MIT License](/LICENSE-MIT.md).
79798080----
8181-8280[^1]: Text adapted from [<cite>A Tour of The Rust Standard Library</cite>][tour]
83818482<!-- prettier-ignore-start -->
+6-13
docs/src/rustdoc-link/caching.md
···94949595Furthermore, the preprocessor relies on the LSP [Work Done
9696Progress][lsp-work-done-progress] notifications to know when rust-analyzer has finished
9797-cache priming before actually sending out external docs requests. Because rust-analyzer
9898-seems to automatically reindex multiple times, a "cooldown" mechanism was implemented,
9999-to wait for a hard-coded 500ms after rust-analyzer reports indexing done, before
100100-continuing.
9797+cache priming, before actually sending out external docs requests. This requires parsing
9898+non-structured log messages that rust-analyzer sends out and some debouncing/throttling
9999+logic, which is not ideal, see
100100+[client.rs](/crates/mdbookkit/src/bin/rustdoc_link/client.rs#L129-L132).
101101102102-Not doing either of these things causes many links to fail to resolve.
102102+Not waiting for indexing to finish and sending out requests too early causes
103103+rust-analyzer to respond with empty results.
103104104105**Questions**:
105106···142143languages like Rust, and `mdbook` has an explicitly non-incremental architecture,
143144perfect for rendering Markdown. This makes them somewhat challenging to work well
144145together in a live-reload scenario.
145145-146146-> [!NOTE]
147147->
148148-> The above is entirely my understanding of how the two projects work, which may have
149149-> gross misconceptions or misuse of words. [Feedback of any kind is very welcome
150150-> :)][gh-issues]
151151-152152----
153146154147[^1]:
155148 It was mentioned that the [recently updated, salsa-ified rust-analyzer][salsa]
-2
docs/src/rustdoc-link/supported-syntax.md
···248248249249<!-- prettier-ignore-end -->
250250251251----
252252-253251[^1]:
254252 rust-analyzer's ability to generate links for enum variants like `Option::Some` was
255253 improved only somewhat recently: before