Skip to content

Commit

Permalink
Abs path
Browse files Browse the repository at this point in the history
  • Loading branch information
estruyf committed Oct 6, 2023
1 parent 36b3b33 commit 2423b73
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/commands/Folders.ts
Original file line number Diff line number Diff line change
Expand Up @@ -438,9 +438,14 @@ export class Folders {
public static getAbsFilePath(filePath: string): string {
const wsFolder = Folders.getWorkspaceFolder();
const isWindows = process.platform === 'win32';
let absPath = filePath.replace(WORKSPACE_PLACEHOLDER, parseWinPath(wsFolder?.fsPath || ''));
absPath = isWindows ? absPath.split('/').join('\\') : absPath;
return parseWinPath(absPath);

if (filePath.includes(WORKSPACE_PLACEHOLDER)) {
let absPath = filePath.replace(WORKSPACE_PLACEHOLDER, parseWinPath(wsFolder?.fsPath || ''));
absPath = isWindows ? absPath.split('/').join('\\') : absPath;
return parseWinPath(absPath);
}

return parseWinPath(join(parseWinPath(wsFolder?.fsPath || ''), filePath));
}

/**
Expand Down

0 comments on commit 2423b73

Please sign in to comment.