You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Casing of drive letter differs between ${workspaceRoot} and setBreakpointRequest #43959
bugIssue identified by VS Code Team member as probable bugdebugDebug viewlet, configurations, breakpoints, adapter issuesverifiedVerification succeeded
These paths get converted to file:/// URIs by two different applications for my extension (the breakpoints are converted to URIs by my debug adapter, whereas the source file is being converted to a URI inside the VM). These URIs therefore don't match and are being compared case-sensitively and my breakpoint doesn't get hit.
I'm going to ask whether the VM can do case-insensitive comparisons but suspect it's a big job. I'm going to try and put a workaround in my DA for now; but I wonder if having these consistent in Code is an easy change?
Yes, drive-letter casing is a mess.
Different casing should not make a difference on Windows but for node.js it makes a difference and in our node-debugger we register breakpoints via a regular expression that ignores the casing.
IIRC VS Code does not try to normalise the drive letter to either upper or lower case because this doesn't help a lot for the following reason:
There is always the case that you launch a debuggee from the integrated terminal (or even an external terminal): In this case VS Code has no influence on the drive letter case and there is still the possibility that a (normalized) VS Code path would be compared to an un-normalized native path coming from the debuggee.
So my only recommendation is to deal with drive letter case mismatches yourself.
Andre Weinand (@weinand) It actually seems like this has affected a bunch of things and there have already been some fixes in Code that now uppercase the drive letter:
But as I tried to explain above, normalising "some" paths in VS Code cannot fix the fundamental issue. If you launch your a program in a command shell that results in lower case drive letters, these will not match the upper case drive letters paths received from VS Code.
Understood; but in this case both paths come from Code (cwd and setBreakpointRequest) so if Code was consistent with itself, this issue at least would be solved (it's possible it used to be consistent before cwd was changed).
Ofc I'm perfectly happy to field any issues resulting from paths that didn't origin from Code.
The path received in "setBreakpointRequest" does not necessarily originates from VS Code.
If you set a breakpoint in a (readonly) source received from the DA, the subsequent "setBreakpointRequest" will use this source path without modification. So in this case the drive letter has the case that your DA returned previously.
Andre Weinand (@weinand) Understood; though those paths will match the VM already. The breakpoint sending lowercase paths here is one I'm adding on a normal source file that I've opened from the explorer and just pressed F9 on.
I've put a workaround in for now; but I do think Code should be try to be consistent with the paths that originate from it since it looks like this is a bit of a minefield.
Isidor Nikolic (@isidorn) If our (new?) strategy is to normalise drive letter casing to upper case, then reverting your change seems to be the wrong approach. Instead we should normalise drive letters everywhere where a path leaves VS Code, e.g. when sending paths to a DA.
Yeah, my preference would also be that drive letters are just always normalised to uppercase everywhere rather than reverting. And hopefully you can agree that any time something new comes up (like this one) the same fix is applied (I appreciate you shouldn't need to be messing with casing of drive letters; it's as annoying to me as it is to you; but we're all relying on other peoples coed we can't neceesarily easily influence/fix!).
If this change is reverted without 0d66fa0 also being reverted (and my fix in Dart Code removed and published), it'll break Dart and Flutter :(
Whatever way you choose to present the drive letters, it really has to be consistent between the path we get given for workspaceRoot and in breakpointRequest (it won't if you just revert this one change).
Danny Tuppeny (@DanTup) you are correct.
We just discussed this in the meeting and we should have made an anouncment about this change, however we feel like this should not be reverted and php debug should not rely on drive letters being small case.
So it would be great if Felix Becker (@felixfbecker) could fix it on the php side. If you do not have time please let us know and we can provide a PR in your extension.
bugIssue identified by VS Code Team member as probable bugdebugDebug viewlet, configurations, breakpoints, adapter issuesverifiedVerification succeeded
Activity
weinand commentedon Feb 19, 2018
Yes, drive-letter casing is a mess.
Different casing should not make a difference on Windows but for node.js it makes a difference and in our node-debugger we register breakpoints via a regular expression that ignores the casing.
IIRC VS Code does not try to normalise the drive letter to either upper or lower case because this doesn't help a lot for the following reason:
There is always the case that you launch a debuggee from the integrated terminal (or even an external terminal): In this case VS Code has no influence on the drive letter case and there is still the possibility that a (normalized) VS Code path would be compared to an un-normalized native path coming from the debuggee.
So my only recommendation is to deal with drive letter case mismatches yourself.
Isidor Nikolic (@isidorn) please chime in if I misspoke.
DanTup commentedon Feb 19, 2018
Andre Weinand (@weinand) It actually seems like this has affected a bunch of things and there have already been some fixes in Code that now uppercase the drive letter:
a2ebd67
0d66fa0
Would it make sense to be consistent with them and do the same in the debugger?
weinand commentedon Feb 19, 2018
Isidor Nikolic (@isidorn) what's your take?
But as I tried to explain above, normalising "some" paths in VS Code cannot fix the fundamental issue. If you launch your a program in a command shell that results in lower case drive letters, these will not match the upper case drive letters paths received from VS Code.
DanTup commentedon Feb 19, 2018
Understood; but in this case both paths come from Code (
cwdandsetBreakpointRequest) so if Code was consistent with itself, this issue at least would be solved (it's possible it used to be consistent beforecwdwas changed).Ofc I'm perfectly happy to field any issues resulting from paths that didn't origin from Code.
weinand commentedon Feb 19, 2018
The path received in "setBreakpointRequest" does not necessarily originates from VS Code.
If you set a breakpoint in a (readonly) source received from the DA, the subsequent "setBreakpointRequest" will use this source path without modification. So in this case the drive letter has the case that your DA returned previously.
DanTup commentedon Feb 19, 2018
Andre Weinand (@weinand) Understood; though those paths will match the VM already. The breakpoint sending lowercase paths here is one I'm adding on a normal source file that I've opened from the explorer and just pressed F9 on.
I've put a workaround in for now; but I do think Code should be try to be consistent with the paths that originate from it since it looks like this is a bit of a minefield.
isidorn commentedon Feb 19, 2018
Reopening to investigate
2 remaining items
weinand commentedon Feb 19, 2018
Isidor Nikolic (@isidorn) If our (new?) strategy is to normalise drive letter casing to upper case, then reverting your change seems to be the wrong approach. Instead we should normalise drive letters everywhere where a path leaves VS Code, e.g. when sending paths to a DA.
DanTup commentedon Feb 19, 2018
Yeah, my preference would also be that drive letters are just always normalised to uppercase everywhere rather than reverting. And hopefully you can agree that any time something new comes up (like this one) the same fix is applied (I appreciate you shouldn't need to be messing with casing of drive letters; it's as annoying to me as it is to you; but we're all relying on other peoples coed we can't neceesarily easily influence/fix!).
felixfbecker commentedon Mar 8, 2018
A lot of people are reporting that VS Code 1.20 broke their PHP debugging: xdebug/vscode-php-debug#239
XDebug always uses lowercase drive letters.
DanTup commentedon Mar 8, 2018
cries
isidorn commentedon Mar 9, 2018
Felix Becker (@felixfbecker) can you fix this on the php debug side?
If not, we can consider this as a candidate to revert this change
DanTup commentedon Mar 9, 2018
If this change is reverted without 0d66fa0 also being reverted (and my fix in Dart Code removed and published), it'll break Dart and Flutter :(
Whatever way you choose to present the drive letters, it really has to be consistent between the path we get given for
workspaceRootand inbreakpointRequest(it won't if you just revert this one change).isidorn commentedon Mar 9, 2018
Danny Tuppeny (@DanTup) you are correct.
We just discussed this in the meeting and we should have made an anouncment about this change, however we feel like this should not be reverted and php debug should not rely on drive letters being small case.
So it would be great if Felix Becker (@felixfbecker) could fix it on the php side. If you do not have time please let us know and we can provide a PR in your extension.
isidorn commentedon Mar 14, 2018
Felix Becker (@felixfbecker) just a gentle reminder if we should help with the PR for PHP?
felixfbecker commentedon Mar 15, 2018
Should be fixed in v1.12.2
Normalize all drive letters going out from vscode to debug adapters s…