Skip to content

Commit 58146d0

Browse files
authored
Fix mapping of breakpoints when debugging a local file on Windows (#1586)
1 parent a868865 commit 58146d0

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/debug/debugSession.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,11 @@ export class ObjectScriptDebugSession extends LoggingDebugSession {
361361
try {
362362
await this._waitForDebugTarget();
363363

364-
const uri = vscode.Uri.parse(args.source.path);
364+
// args.source.path is a file path if the file is local and is a stringified Uri if the file is virtual
365+
const uri =
366+
(this._workspaceFolderUri ?? vscode.workspace.workspaceFolders[0]?.uri)?.scheme == "file"
367+
? vscode.Uri.file(args.source.path)
368+
: vscode.Uri.parse(args.source.path);
365369
const wsFolder = vscode.workspace.getWorkspaceFolder(uri);
366370
if (!wsFolder || (this._workspaceFolderUri && wsFolder.uri.toString() != this._workspaceFolderUri.toString())) {
367371
response.body = {

0 commit comments

Comments
 (0)