Skip to content

Commit

Permalink
Adding silly slash replacement and retry
Browse files Browse the repository at this point in the history
  • Loading branch information
idavis committed Aug 15, 2023
1 parent 4f9bf97 commit 51bb079
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions vscode/src/debugger/activate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,15 @@ export const workspaceFileAccessor: FileAccessor = {
},
async openFile(path: string): Promise<vscode.TextDocument> {
const uri: vscode.Uri = this.resolvePathToUri(path);
return await vscode.workspace.openTextDocument(uri);
return this.openUri(uri);
},
async openUri(uri: vscode.Uri): Promise<vscode.TextDocument> {
return await vscode.workspace.openTextDocument(uri);
try {
return await vscode.workspace.openTextDocument(uri);
} catch {
const path = uri.toString().replace(/\//g, "\\");
return await vscode.workspace.openTextDocument(vscode.Uri.file(path));
}
},
async readFile(path: string): Promise<Uint8Array> {
let uri: vscode.Uri = this.resolvePathToUri(path);
Expand Down

0 comments on commit 51bb079

Please sign in to comment.