Skip to content

Commit 9530fc1

Browse files
committed
always pass absolute file paths
1 parent 02c09b5 commit 9530fc1

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/execute/julia.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ import {
5656
isJupyterPercentScript,
5757
markdownFromJupyterPercentScript,
5858
} from "./jupyter/percent.ts";
59+
import { resolve } from "path";
5960

6061
export interface SourceRange {
6162
lines: [number, number];
@@ -600,7 +601,9 @@ function buildSourceRanges(markdown: MappedString): Array<SourceRange> {
600601
const { originalString } = mapResult;
601602
const lineColFunc = mappedIndexToLineCol(originalString);
602603
const lineCol = lineColFunc(mapResult.index);
603-
const fileName = originalString.fileName;
604+
const fileName = originalString.fileName
605+
? resolve(originalString.fileName) // resolve to absolute path using cwd
606+
: undefined;
604607
const sourceLineNum = lineCol.line;
605608

606609
// Check if this line continues the current range

0 commit comments

Comments
 (0)