rustdoc: Automatically index crates (#13014)
This PR removes the need to use `/rustdoc --index <CRATE_NAME>` and instead indexes the crates once they are referenced. As soon as the first `:` is added after the crate name, the indexing will kick off in the background and update the index as it goes. Release Notes: - N/A
This commit is contained in:
parent
e0c1ab650e
commit
86167138a9
5 changed files with 70 additions and 102 deletions
|
@ -56,8 +56,6 @@ impl RustdocProvider for LocalProvider {
|
|||
local_cargo_doc_path.push("index.html");
|
||||
}
|
||||
|
||||
println!("Fetching {}", local_cargo_doc_path.display());
|
||||
|
||||
let Ok(contents) = self.fs.load(&local_cargo_doc_path).await else {
|
||||
return Ok(None);
|
||||
};
|
||||
|
@ -91,8 +89,6 @@ impl RustdocProvider for DocsDotRsProvider {
|
|||
.unwrap_or_default()
|
||||
);
|
||||
|
||||
println!("Fetching {}", &format!("https://docs.rs/{path}"));
|
||||
|
||||
let mut response = self
|
||||
.http_client
|
||||
.get(
|
||||
|
@ -165,8 +161,6 @@ impl RustdocIndexer {
|
|||
while let Some(item_with_history) = items_to_visit.pop_front() {
|
||||
let item = &item_with_history.item;
|
||||
|
||||
println!("Visiting {:?} {:?} {}", &item.kind, &item.path, &item.name);
|
||||
|
||||
let Some(result) = self
|
||||
.provider
|
||||
.fetch_page(&crate_name, Some(&item))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue