-
Notifications
You must be signed in to change notification settings - Fork 512
$psEditor.Workspace.OpenFile puts file name into all lower case. #2960
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
Comments
@jhoneill can you give a particular example of where you've used this and what happened? There's not quite enough information here for me to work out what's going on and where the problem lies |
@rjmholt I think we store # In PSIC
New-Item Something.ps1 | Out-Null
psedit ./Something.ps1 And then look at the tab title. I think it only happens when you haven't already opened the file at least once (so it's not in the workspace cache). I'm guessing the path is always lowercase in the request and if VSCode hasn't already cached some state for that file it'll take our word for it. |
Sounds like our approach with surfacing the keys is wrong and they should be considered internal keys only, rather than something we expose somewhere. Still, if I can get the example where it's caused a Pester issue in full detail, we'll be able to fix this in a much more reliable way than if I just guess where the issue is and claim it's solved. |
It's working with the module from https://github.com/MethodsAndPractices/vsteam and the author has
So I
Pester then runs add-vsteam.tests.ps1 and I know I could fix this by using |
Thanks for the additional info @jhoneill |
This issue was closed automatically as repro info was indicated as needed, but there has been no activity in over a week. Please feel free to reopen with any available information! |
The bot auto closed this but the problem persists. I thought there was sufficient info to repro it ? Despite what the message, says it looks like one cannot reopen an issue which has has been closed by the bot. |
Oops, we just updated the bot rules. Looks like it was closed because it was still marked as needing repro info. I'll reopen and try to repro with the info you've given. |
I saw this when bringing the debug service unit tests back online...it's strange. |
vscode-powershell/src/features/ExtensionCommands.ts Lines 370 to 373 in 2b8e4c2
|
Per https://nodejs.org/en/docs/guides/working-with-different-filesystems we should really just keep the file path we're given, no "normalizing" to be done especially since it is wrong to infer from the OS if the filesystem is case-sensitive or not. Gone are the days where Windows and macOS could be presumed case-insensitive, they now both support and are often found with with case-sensitive filesystems. Plus, there was really no reason to be doing this in the first place. Tested interactively, this works just fine since the VS Code APIs we're using handle case-insensitivity for us. Resolves #2960.
Per https://nodejs.org/en/docs/guides/working-with-different-filesystems we should really just keep the file path we're given, no "normalizing" to be done especially since it is wrong to infer from the OS if the filesystem is case-sensitive or not. Gone are the days where Windows and macOS could be presumed case-insensitive, they now both support and are often found with with case-sensitive filesystems. Plus, there was really no reason to be doing this in the first place. Tested interactively, this works just fine since the VS Code APIs we're using handle case-insensitivity for us. Resolves #2960.
System Details Output
This also appears with vs-code insiders and the 2020.9.0 extension ...
The issue is that the $psEditor.Workspace.OpenFile - which is called from various places - like PsEdit, changes the file name to lower case. This is usually just a cosmetic problem, but I have found a case were pester ran a script using its lower-cased name and the script failed because it tried to do a case sensitive replace on part of its own name.
The text was updated successfully, but these errors were encountered: