Skip to content

Commit

Permalink
update dneo_doc
Browse files Browse the repository at this point in the history
  • Loading branch information
crowlKats committed Dec 17, 2024
1 parent 4fa6b96 commit aa2c086
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 10 deletions.
8 changes: 5 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
[workspace]
members = ["api"]
resolver = "2"

[patch.crates-io]
deno_doc = { path = "../deno_doc" }
2 changes: 1 addition & 1 deletion api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
39 changes: 36 additions & 3 deletions api/src/docs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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::<Vec<_>>()
} else {
Expand Down Expand Up @@ -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::<Vec<_>>()
} else {
vec![node]
}
})
.collect::<Vec<_>>();

if name_parts.peek().is_none() {
break nodes;
}
Expand All @@ -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;
}
Expand Down

0 comments on commit aa2c086

Please sign in to comment.