Skip to content

Respect file path casing in extension commands #4703

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

Merged
merged 2 commits into from
Aug 17, 2023

Conversation

andyleejordan
Copy link
Member

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.
@andyleejordan andyleejordan requested a review from a team August 16, 2023 19:49
@andyleejordan
Copy link
Member Author

@SeeminglyScience I couldn't find a way to test CloseFile...since while it's all plumbed through, I don't see us exposing it in any API.

@andyleejordan andyleejordan force-pushed the andyleejordan/fix-newfile-casing branch 2 times, most recently from edd0e05 to 6276eae Compare August 17, 2023 02:10
Copy link
Collaborator

@SeeminglyScience SeeminglyScience left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! One minor possible typo correction in a comment

The response is now `Completed` or `Failed` and returned appropriately.
`NewFile` now takes (optional) content and fills the new file with it
(which is all the VS Code API can do). `OpenFile` doesn't throw a
cryptic error in the terminal if the file isn't found. The status bar
messages are now properly disposed.
@andyleejordan andyleejordan force-pushed the andyleejordan/fix-newfile-casing branch from 06f6c2f to ae72307 Compare August 17, 2023 22:03
@andyleejordan andyleejordan added this pull request to the merge queue Aug 17, 2023
Merged via the queue into main with commit 566c8b2 Aug 17, 2023
@andyleejordan andyleejordan deleted the andyleejordan/fix-newfile-casing branch August 17, 2023 22:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

$psEditor.Workspace.OpenFile puts file name into all lower case.
2 participants