diff --git a/Cargo.lock b/Cargo.lock index bc72b262..61472235 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -879,7 +879,9 @@ dependencies = [ [[package]] name = "deno_doc" -version = "0.161.2" +version = "0.162.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e581acf5f25677ead79a7ff5e54019773b09ef91aa131939610b5b99c82e918" dependencies = [ "anyhow", "cfg-if", @@ -2041,9 +2043,9 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.11" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" +checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674" [[package]] name = "js-sys" diff --git a/Cargo.toml b/Cargo.toml index bcae59c9..b3df016c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,3 @@ [workspace] members = ["api"] resolver = "2" - -[patch.crates-io] -deno_doc = { path = "../deno_doc" } \ No newline at end of file diff --git a/api/Cargo.toml b/api/Cargo.toml index 6194872f..33d5e36e 100644 --- a/api/Cargo.toml +++ b/api/Cargo.toml @@ -80,7 +80,7 @@ thiserror = "2" async-tar = "0.4.2" deno_graph = "0.86.3" deno_ast = { version = "0.44.0", features = ["view"] } -deno_doc = { version = "0.161.2", features = ["comrak"] } +deno_doc = { version = "0.162.1", features = ["comrak"] } comrak = { version = "0.29.0", default-features = false } ammonia = "4.0.0" async-trait = "0.1.73" diff --git a/api/src/docs.rs b/api/src/docs.rs index 89a9b52c..1b3e0f58 100644 --- a/api/src/docs.rs +++ b/api/src/docs.rs @@ -747,7 +747,7 @@ fn generate_symbol_page( let doc_nodes = 'outer: loop { let next_part = name_parts.next()?; - let nodes = doc_nodes + let mut nodes = doc_nodes .iter() .filter(|node| { !(matches!(node.kind(), DocNodeKind::ModuleDoc | DocNodeKind::Import) @@ -757,7 +757,7 @@ fn generate_symbol_page( .flat_map(|node| { if let Some(reference) = node.reference_def() { ctx - .resolve_reference(&reference.target) + .resolve_reference(node.parent.as_deref(), &reference.target) .map(|node| node.into_owned()) .collect::>() } else { @@ -954,6 +954,20 @@ fn generate_symbol_page( } } + nodes = nodes + .into_iter() + .flat_map(|node| { + if let Some(reference) = node.reference_def() { + ctx + .resolve_reference(node.parent.as_deref(), &reference.target) + .map(|node| node.into_owned()) + .collect::>() + } else { + vec![node] + } + }) + .collect::>(); + if name_parts.peek().is_none() { break nodes; } @@ -963,7 +977,26 @@ fn generate_symbol_page( .find(|node| matches!(node.kind(), DocNodeKind::Namespace)) { namespace_paths.push(next_part.to_string()); - doc_nodes = namespace_node.namespace_children.clone().unwrap(); + doc_nodes = namespace_node + .namespace_children + .clone() + .unwrap() + .into_iter() + .flat_map(|node| { + if let Some(reference_def) = node.reference_def() { + ctx + .resolve_reference(Some(namespace_node), &reference_def.target) + .map(|node| { + let x = node.into_owned(); + dbg!(x.get_qualified_name()); + x + }) + .collect() + } else { + vec![node] + } + }) + .collect(); } else { return None; }