-
Notifications
You must be signed in to change notification settings - Fork 645
Conversation
src/debugAdapter/goDebug.ts
Outdated
// Fix for https://github.com/Microsoft/vscode-go/issues/1178 | ||
// When the pathToConvert is under GOROOT, replace the remote GOROOT with local GOROOT | ||
if (!pathToConvert.startsWith(this.delve.remotePath)) { | ||
let index = pathToConvert.indexOf('src'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is supposed to be /src/
in the goroot, right? It could match a different src, like /Users/src/goroot/src/...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated to match /src/
src/debugAdapter/goDebug.ts
Outdated
return path.join(goroot, ...pathToConvert.substr(index).split(this.remotePathSeparator)); | ||
} | ||
} | ||
return pathToConvert.replace(this.delve.remotePath, this.delve.program).split(this.remotePathSeparator).join(this.localPathSeparator); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You use path.join
above and .join(this.localPathSeparator);
here, should it be the same?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
path.join uses the path separator for the local machine so it would be the same localPathSeparator
additionally it also takes care of trailing /
at the end of goroot if there is any.
So if I do a split on the goroot, remove trailing /
if it exists, then I can use .join(this.localPathSeparator)
Fix for #1178
See #1178 (comment)