-
Notifications
You must be signed in to change notification settings - Fork 29.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Casing of drive letter differs between ${workspaceRoot} and setBreakpointRequest #43959
Comments
Yes, drive-letter casing is a mess. 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. @isidorn please chime in if I misspoke. |
@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. |
Understood; but in this case both paths come from Code ( 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. |
@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. |
Reopening to investigate |
I'm fairly certain that 0d66fa0 caused this. I mis-read the date on it earlier, but it was actually very recent. So previously, Code's I have a workaround going out at the end of the month, but I really think this has to be made consistent in Code; it's likely to cause many bugs that could go unnoticed by extension authors and cause missed breakpoints for users (this is actually an ongoing battle for me, because there are many components outside of my control that are treating windows paths case-sensitively; it feels like I'm playing whack-a-mole 😞). |
@DanTup you are correct, I broke it in that commit. However you will see what issue that commit is linked to, so that was the reason for the change. |
@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!). |
A lot of people are reporting that VS Code 1.20 broke their PHP debugging: xdebug/vscode-php-debug#239 |
cries |
@felixfbecker can you fix this on the php debug side? |
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 |
@DanTup you are correct. |
@felixfbecker just a gentle reminder if we should help with the PR for PHP? |
Should be fixed in v1.12.2 |
I'm not really sure you'll consider this a bug in Code, but it's causing bugs for me and I'm not sure if I can easily fix it.
When a user sets a launch config using
${workspaceRoot}
, the path comes through with an uppercase drive letter:However if I place breakpoint in that file then the
setBreakpointRequest
comes through with a lowercase drive letter: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?
The text was updated successfully, but these errors were encountered: