summaryrefslogtreecommitdiff
path: root/cli/tools/vendor
diff options
context:
space:
mode:
Diffstat (limited to 'cli/tools/vendor')
-rw-r--r--cli/tools/vendor/analyze.rs2
-rw-r--r--cli/tools/vendor/import_map.rs12
-rw-r--r--cli/tools/vendor/test.rs3
3 files changed, 7 insertions, 10 deletions
diff --git a/cli/tools/vendor/analyze.rs b/cli/tools/vendor/analyze.rs
index 0639c0487..6a1f53aae 100644
--- a/cli/tools/vendor/analyze.rs
+++ b/cli/tools/vendor/analyze.rs
@@ -106,7 +106,7 @@ mod test {
maybe_syntax: None,
media_type: MediaType::TypeScript,
scope_analysis: false,
- source: SourceTextInfo::from_string(text.to_string()),
+ text_info: SourceTextInfo::from_string(text.to_string()),
})
.unwrap()
}
diff --git a/cli/tools/vendor/import_map.rs b/cli/tools/vendor/import_map.rs
index 1df6e36d1..4bbdbd1ae 100644
--- a/cli/tools/vendor/import_map.rs
+++ b/cli/tools/vendor/import_map.rs
@@ -120,7 +120,7 @@ fn visit_modules(
) {
for module in modules {
let text_info = match &module.maybe_parsed_source {
- Some(source) => source.source(),
+ Some(source) => source.text_info(),
None => continue,
};
let source_text = match &module.maybe_source {
@@ -272,10 +272,8 @@ fn byte_range(
fn byte_index(text_info: &SourceTextInfo, pos: &Position) -> usize {
// todo(https://github.com/denoland/deno_graph/issues/79): use byte indexes all the way down
- text_info
- .byte_index(LineAndColumnIndex {
- line_index: pos.line,
- column_index: pos.character,
- })
- .0 as usize
+ text_info.loc_to_source_pos(LineAndColumnIndex {
+ line_index: pos.line,
+ column_index: pos.character,
+ }) - text_info.range().start
}
diff --git a/cli/tools/vendor/test.rs b/cli/tools/vendor/test.rs
index 7f4c18fca..5060c493a 100644
--- a/cli/tools/vendor/test.rs
+++ b/cli/tools/vendor/test.rs
@@ -5,7 +5,6 @@ use std::collections::HashMap;
use std::collections::HashSet;
use std::path::Path;
use std::path::PathBuf;
-use std::sync::Arc;
use deno_ast::ModuleSpecifier;
use deno_core::anyhow::anyhow;
@@ -97,7 +96,7 @@ impl Loader for TestLoader {
let result = self.files.get(specifier).map(|result| match result {
Ok(result) => Ok(LoadResponse::Module {
specifier: specifier.clone(),
- content: Arc::new(result.0.clone()),
+ content: result.0.clone().into(),
maybe_headers: result.1.clone(),
}),
Err(err) => Err(err),