Skip to content

Commit

Permalink
refactor: deno_graph 0.78 (#598)
Browse files Browse the repository at this point in the history
  • Loading branch information
dsherret authored Jun 4, 2024
1 parent 1c1a414 commit 075cdf9
Show file tree
Hide file tree
Showing 128 changed files with 70 additions and 167 deletions.
72 changes: 36 additions & 36 deletions Cargo.lock

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

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ repository = "https://github.com/denoland/deno_doc"
members = ["lib"]

[workspace.dependencies]
deno_graph = { version = "0.77.0", default-features = false, features = ["symbols"] }
deno_graph = { version = "0.78.0", default-features = false, features = ["symbols"] }
import_map = "0.19.0"
serde = { version = "1.0.140", features = ["derive"] }

Expand All @@ -26,7 +26,7 @@ required-features = ["html"]
[dependencies]
anyhow = "1.0.58"
cfg-if = "1.0.0"
deno_ast = "0.38.0"
deno_ast = "0.39.0"
deno_graph.workspace = true
indexmap = "2.0.2"
futures = "0.3.26"
Expand Down
2 changes: 1 addition & 1 deletion src/decorators.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ impl DecoratorDef {
let args = call_expr
.args
.iter()
.map(|a| a.text_fast(parsed_source.text_info()).to_string())
.map(|a| a.text_fast(parsed_source.text_info_lazy()).to_string())
.collect();
return Self {
name: ident.sym.to_string(),
Expand Down
8 changes: 4 additions & 4 deletions src/diagnostics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,14 +112,14 @@ impl Diagnostic for DocDiagnostic {
fn snippet(&self) -> Option<DiagnosticSnippet<'_>> {
Some(DiagnosticSnippet {
source: Cow::Borrowed(&self.text_info),
highlight: DiagnosticSnippetHighlight {
highlights: vec![DiagnosticSnippetHighlight {
style: DiagnosticSnippetHighlightStyle::Error,
range: DiagnosticSourceRange {
start: DiagnosticSourcePos::ByteIndex(self.location.byte_index),
end: DiagnosticSourcePos::ByteIndex(self.location.byte_index + 1),
},
description: None,
},
}],
})
}

Expand All @@ -136,7 +136,7 @@ impl Diagnostic for DocDiagnostic {
DocDiagnosticKind::PrivateTypeRef(diagnostic) => {
Some(DiagnosticSnippet {
source: Cow::Borrowed(&diagnostic.reference_text_info),
highlight: DiagnosticSnippetHighlight {
highlights: vec![DiagnosticSnippetHighlight {
style: DiagnosticSnippetHighlightStyle::Hint,
range: DiagnosticSourceRange {
start: DiagnosticSourcePos::ByteIndex(
Expand All @@ -147,7 +147,7 @@ impl Diagnostic for DocDiagnostic {
),
},
description: Some(Cow::Borrowed("this is the referenced type")),
},
}],
})
}
_ => None,
Expand Down
2 changes: 1 addition & 1 deletion src/params.rs
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ pub fn prop_name_to_string(
PropName::Num(num) => num.value.to_string(),
PropName::BigInt(num) => num.value.to_string(),
PropName::Computed(comp_prop_name) => comp_prop_name
.text_fast(parsed_source.text_info())
.text_fast(parsed_source.text_info_lazy())
.to_string(),
}
}
2 changes: 1 addition & 1 deletion src/util/swc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ pub(crate) fn module_js_doc_for_source(
pub fn get_location(parsed_source: &ParsedSource, pos: SourcePos) -> Location {
get_text_info_location(
parsed_source.specifier().as_str(),
parsed_source.text_info(),
parsed_source.text_info_lazy(),
pos,
)
}
Expand Down
1 change: 0 additions & 1 deletion tests/specs/Overloads.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ error[missing-jsdoc]: exported symbol is missing JSDoc documentation
2 | export function a(b: number): number;
| ^


# output.txt
Defined in file:///mod.ts:1:1

Expand Down
1 change: 0 additions & 1 deletion tests/specs/abstract_class.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ error[missing-jsdoc]: exported symbol is missing JSDoc documentation
1 | export abstract class Class {}
| ^


# output.txt
Defined in file:///mod.ts:1:1

Expand Down
1 change: 0 additions & 1 deletion tests/specs/abstract_class_abstract_method.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ error[missing-jsdoc]: exported symbol is missing JSDoc documentation
2 | abstract method() {}
| ^


# output.txt
Defined in file:///mod.ts:1:1

Expand Down
1 change: 0 additions & 1 deletion tests/specs/class_async_method.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ error[missing-jsdoc]: exported symbol is missing JSDoc documentation
2 | async amethod(v) {}
| ^


# output.txt
Defined in file:///mod.ts:1:1

Expand Down
1 change: 0 additions & 1 deletion tests/specs/class_constructor.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ error[missing-jsdoc]: exported symbol is missing JSDoc documentation
2 | constructor(public a, readonly b) {
| ^


# output.txt
Defined in file:///mod.ts:1:1

Expand Down
1 change: 0 additions & 1 deletion tests/specs/class_declaration.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ error[missing-jsdoc]: exported symbol is missing JSDoc documentation
1 | export class Class {}
| ^


# output.txt
Defined in file:///mod.ts:1:1

Expand Down
1 change: 0 additions & 1 deletion tests/specs/class_decorators.txt
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ error[missing-return-type]: exported function is missing an explicit return type
13 | @enumerable(false)
| ^


# output.txt
Defined in file:///mod.ts:2:1

Expand Down
1 change: 0 additions & 1 deletion tests/specs/class_details.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ error[missing-jsdoc]: exported symbol is missing JSDoc documentation
4 | f: number;
| ^


# output.txt
Defined in file:///mod.ts:1:1

Expand Down
1 change: 0 additions & 1 deletion tests/specs/class_details_all_with_private.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ error[missing-jsdoc]: exported symbol is missing JSDoc documentation
4 | public pub() {}
| ^


# output.txt
Defined in file:///mod.ts:1:1

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ error[missing-jsdoc]: exported symbol is missing JSDoc documentation
4 | public pub() {}
| ^


# output.txt
Defined in file:///mod.ts:1:1

Expand Down
1 change: 0 additions & 1 deletion tests/specs/class_extends.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ error[missing-jsdoc]: exported symbol is missing JSDoc documentation
1 | export class Class extends Object {}
| ^


# output.txt
Defined in file:///mod.ts:1:1

Expand Down
1 change: 0 additions & 1 deletion tests/specs/class_extends_implements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ error[missing-jsdoc]: exported symbol is missing JSDoc documentation
1 | export class Class extends Object implements Iterator, Iterable {}
| ^


# output.txt
Defined in file:///mod.ts:1:1

Expand Down
1 change: 0 additions & 1 deletion tests/specs/class_generic_extends_implements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ error[missing-jsdoc]: exported symbol is missing JSDoc documentation
1 | export class Class<A, B> extends Map<A, B> implements Iterator<A>, Iterable<B> {}
| ^


# output.txt
Defined in file:///mod.ts:1:1

Expand Down
Loading

0 comments on commit 075cdf9

Please sign in to comment.