Skip to content

Commit c5ed449

Browse files
committed
Only strip trailing slash off paths on Windows
1 parent 88dd188 commit c5ed449

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/phpDebug.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,11 @@ class PhpDebugSession extends vscode.DebugSession {
198198
/** converts a server-side XDebug file URI to a local path for VS Code with respect to source root settings */
199199
protected convertDebuggerPathToClient(fileUri: string): string {
200200
// convert the file URI to a path
201-
const serverPath = decodeURI(url.parse(fileUri).pathname.substr(1));
201+
let serverPath = decodeURI(url.parse(fileUri).pathname);
202+
// strip the trailing slash from Windows paths (indicated by a drive letter with a colon)
203+
if (/^\/[a-zA-Z]:\//.test(serverPath)) {
204+
serverPath = serverPath.substr(1);
205+
}
202206
let localPath: string;
203207
if (this._args.serverSourceRoot && this._args.localSourceRoot) {
204208
// get the part of the path that is relative to the source root

0 commit comments

Comments
 (0)