Skip to content

Commit 6f39c09

Browse files
authored
fix: span calculation error in multi-file mode
1 parent 5eeea24 commit 6f39c09

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ export function getSpecifierOffset(
261261
) {
262262
const { specifiers } = n;
263263
const ast = specifiers[index];
264-
let end = ast.span.end;
264+
let { end } = getRealSpan({ start: 0, end: ast.span.end }, offset);
265265
const span = getRealSpan({ start: ast.span.start, end: n.span.end }, offset);
266266
if (index + 1 === specifiers.length) {
267267
const commaIdx = script.slice(span.start, span.end).indexOf(",");

0 commit comments

Comments
 (0)