Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions src/runner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import { IDesktopTestConfiguration, MochaEvent, MochaEventTuple } from '@vscode/test-cli';
import styles from 'ansi-styles';
import { randomUUID } from 'crypto';
import * as path from 'path';
import split2 from 'split2';
import * as vscode from 'vscode';
import { ConfigValue } from './configValue';
Expand Down Expand Up @@ -632,9 +633,17 @@ async function deriveSourceLocation(
line: number,
col: number,
) {
const fileUri = fileUriOrPath.startsWith('file:')
? vscode.Uri.parse(fileUriOrPath)
: vscode.Uri.file(fileUriOrPath);
let fileUri: vscode.Uri;
if (fileUriOrPath.startsWith('file:')) {
fileUri = vscode.Uri.parse(fileUriOrPath);
} else if (path.isAbsolute(fileUriOrPath)) {
fileUri = vscode.Uri.file(fileUriOrPath);
} else {
// Relative paths can appear in stack traces (e.g. from certain ts-node
// sourcemap configs). vscode.Uri can't represent a relative path and
// vscode.Uri.file would prepend a bogus '/', so skip this frame.
return undefined;
}
const maintainer = store.maintain(fileUri);
const mapping = await (maintainer.value || maintainer.refresh());
const value =
Expand Down