-
Notifications
You must be signed in to change notification settings - Fork 237
Description
Prerequisites
- I have written a descriptive issue title.
- I have searched all issues to ensure it has not already been requested.
Summary
When debugging a remote runspace the current logic is for PSES to retrieve back a temporary file of anything hit in a breakpoint and display it VSCode. This can be prone to some bugs and makes debugging a runspace that is not local a lot more difficult than it has to be.
Other languages work around this issue by offering an option to map local path(s) to their remote equivalent and vice versa.
For example .NET's DAP launch configuration has an option called sourceFileMap. You can do something like
{
"sourceFileMap": {
"C:\\remote\\path": "/home/local/path"
}
}
Python is similar but calls the option pathMappings and uses a different structure. For example:
{
"pathMappings": [
{
"localRoot": "/home/local/path",
"remoteRoot": "C:\\remote\\path"
}
]
}
I would like to extend the attach request in PSES to support a way to map these local <-> remote paths so we can avoid all the psedit and file copying problems.
Proposed Design
I'm more in favour of the pathMappings
option that Python uses as the C# one is more geared around to source compilation paths than actual local/remote translations. It is slightly more verbose but it is easier to see what is the local and what is the remote.
As for the implementation there are a few locations that need to do the translation:
- SetLineBreakpointsAsync when translating the local to remote breakpoint path
- FetchStackFramesAsync when translating the remote stack frame file path to local
- StackTraceHandler.Handle needs to update the breakpoint label
There may be others but I've not yet come across them. The option, if set, should also override the psedit mapping logic as well. Essentially it will treat the paths as local and just translate it to/from the remote paths when needed.