Open rjmholt opened 6 years ago
I've had an idea for this.
Currently we get SaveAs()
to just send the path verbatim back to VSCode to handle. But really PowerShell is the expert in filesystems and paths. So it should do all the path handling here because I believe it already has solutions for this problem. Then the extension should just see what it can do with the absolute path it requires and if it doesn't work, do nothing (and log it...).
Ah so you're saying we should handle the SaveAs inside of PSES by using PowerShell?
The save can only be done from VSCode because it has access to its window buffer content. But, PowerShell has already solved path handling. So we should resolve the path in PowerShell and then VSCode should just trust it and error if it didn't work.
I mean, there are other problems with that probably, but it's one solution. And prevents us from rewriting our own filesystem/path-resolution logic.
I like it!
The
normalizeFilePath
function we use in some file manipulation functions assumes that all macOS file systems are case-insensitive, which is not true.HFS+ and APFS have case-sensitive variants that we should try not to break. Also worth noting that NTFS is also case-sensitive, but Windows is not.
In general, I think we should not try to second guess the operating system and be case-preserving.