microsoft / vscode-debugadapter-node

Debug adapter protocol and implementation for VS Code.
Other
273 stars 79 forks source link

Client path on Windows is not decoded #159

Closed DatGuyJonathan closed 6 years ago

DatGuyJonathan commented 6 years ago

I have a customer on Windows 7 whose debugging session could not hit a breakpoint because of an error like this: Unable to open '[file name]': File not found (file:///c:/Users/username/foo/Apex%20Debugger%20sample/blah/blah.cls)

The customer was able to start a session, set breakpoints, etc. My debugger extension is initialized with setDebuggerPathFormat('uri'). When a stacktraceRequest comes in, I create StackFrames with Sources whose paths use convertDebuggerPathToClient(). Is there anything else a debugger extension should do to prepare the path for VS Code on Windows?

weinand commented 6 years ago

Probably you are the first debugger using convertDebuggerPathToClient for the 'url' path format.

How does the path look like after the call to convertDebuggerPathToClient()? It should be a valid Windows path.

DatGuyJonathan commented 6 years ago

@weinand , here are the before and after for a path with a space in it:

image

I've had success with paths on Windows if I use:

import Uri from 'vscode-uri'; Uri.parse(sourceUri).fsPath

weinand commented 6 years ago

I'm using now our own "vscode-uri" module for both directions.

DatGuyJonathan commented 6 years ago

@weinand , to clarify, will there be an update to vscode-debugadapter-node/adapter/src/debugSession.ts to use vscode-uri? I see this issue got added to March 2018 milestone, but it got closed.

weinand commented 6 years ago

I've published the prerelease version (1.28.0@next) of the node modules.

DatGuyJonathan commented 6 years ago

@weinand , thanks for publishing that. uri-to-path looks good, but I think it broke path-to-uri.

screen shot 2018-03-07 at 9 56 10 am

See screenshot that shows the Windows drive name is c%3A instead of c:. I think it's the same issue as https://github.com/Microsoft/vscode-languageserver-node/issues/105. Would you be able to replace the %3A to : if it's Windows?

weinand commented 6 years ago

I've published another prerelease version (1.28.0@next) with a fix.