Skip to content

Commit

Permalink
perf: update deno_doc (#24700)
Browse files Browse the repository at this point in the history
  • Loading branch information
crowlKats authored and dsherret committed Jul 26, 2024
1 parent 8924b02 commit f7749a9
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 10 deletions.
5 changes: 3 additions & 2 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ deno_ast = { workspace = true, features = ["bundler", "cjs", "codegen", "proposa
deno_cache_dir = { workspace = true }
deno_config = { version = "=0.26.1", features = ["workspace", "sync"] }
deno_core = { workspace = true, features = ["include_js_files_for_snapshotting"] }
deno_doc = { version = "=0.142.0", features = ["html", "syntect"] }
deno_doc = { version = "0.144.0", features = ["html", "syntect"] }
deno_emit = "=0.43.1"
deno_graph = { version = "=0.80.1", features = ["tokio_executor"] }
deno_lint = { version = "=0.60.1", features = ["docs"] }
Expand Down
12 changes: 6 additions & 6 deletions cli/tools/doc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -178,10 +178,10 @@ pub async fn doc(
.into_iter()
.map(|node| deno_doc::html::DocNodeWithContext {
origin: short_path.clone(),
ns_qualifiers: Rc::new(vec![]),
ns_qualifiers: Rc::new([]),
kind_with_drilldown:
deno_doc::html::DocNodeKindWithDrilldown::Other(node.kind),
inner: std::sync::Arc::new(node),
deno_doc::html::DocNodeKindWithDrilldown::Other(node.kind()),
inner: Rc::new(node),
drilldown_parent_kind: None,
parent: None,
})
Expand Down Expand Up @@ -300,7 +300,7 @@ impl deno_doc::html::HrefResolver for DocResolver {
}

fn resolve_source(&self, location: &deno_doc::Location) -> Option<String> {
Some(location.filename.clone())
Some(location.filename.to_string())
}
}

Expand Down Expand Up @@ -492,9 +492,9 @@ fn print_docs_to_stdout(
doc_flags: DocFlags,
mut doc_nodes: Vec<deno_doc::DocNode>,
) -> Result<(), AnyError> {
doc_nodes.retain(|doc_node| doc_node.kind != doc::DocNodeKind::Import);
doc_nodes.retain(|doc_node| doc_node.kind() != doc::DocNodeKind::Import);
let details = if let Some(filter) = doc_flags.filter {
let nodes = doc::find_nodes_by_name_recursively(doc_nodes, filter.clone());
let nodes = doc::find_nodes_by_name_recursively(doc_nodes, &filter);
if nodes.is_empty() {
bail!("Node {} was not found!", filter);
}
Expand Down
2 changes: 1 addition & 1 deletion tests/testdata/doc/lint_success_json.out
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
[
{
"kind": "class",
"name": "Test",
"isDefault": false,
"location": {
Expand All @@ -13,6 +12,7 @@
"jsDoc": {
"doc": "My test class."
},
"kind": "class",
"classDef": {
"isAbstract": false,
"constructors": [],
Expand Down

0 comments on commit f7749a9

Please sign in to comment.