diff options
author | David Sherret <dsherret@users.noreply.github.com> | 2022-05-20 16:40:55 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-20 16:40:55 -0400 |
commit | 1fcecb6789c3f111bc1554766ba9347afcfd02dc (patch) | |
tree | 19cd1b121412b992994b2fe4bea0463793d3986e /cli/tools/vendor/import_map.rs | |
parent | e7c894e8f54ebd2d9fd61c97a265906ac54e2068 (diff) |
refactor: upgrade to deno_ast 0.15 (#14680)
Diffstat (limited to 'cli/tools/vendor/import_map.rs')
-rw-r--r-- | cli/tools/vendor/import_map.rs | 12 |
1 files changed, 5 insertions, 7 deletions
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 } |