-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Need a setting to force case-sensitive folder support #1994
Comments
We currently only turn on case-sensitive file system support on Windows when using the Windows Subsystem for Linux (WSL). We need to add a proper setting for this, |
It looks like that trick won't work, unfortunately. I tried adding A setting to override the automatic WSL detection does sound promising. The case sensitivity isn't critical for what I'm doing. Case insensitive is the default for NFS on Windows. I just tried the case sensitivity option hoping that it might solve the ALL CAPS behavior with the navigation shortcuts. I think I would be happy if I could find a solution for either side of the problem. |
Sorry, I didn't check your Windows 10 version when I wrote that. |
Ah, thanks for clarifying. Unfortunately, I'm in a corporate environment where I don't have control over the Windows updates to move to a newer build. |
Is there any impetus to add a flag to control case sensitivity? Just got bit by this because the top-level directory for my projects had the |
We prioritize feature requests based on demand (measured by upvotes and duplicate issues). Please add your +1 to this issue to bump up the priority. |
I've been following this for months now. Still no progress. Do they only do the top of the (thumbs up) list first? |
Is this a request for a setting that would treat all file paths as case-sensitive, as if running on LInux/Mac/WSL or to enable case sensitivity on a per-directory basis (as described in https://blogs.msdn.microsoft.com/commandline/2018/02/28/per-directory-case-sensitivity-and-wsl/)? We might need to separate these into two issues if another issue doesn't exist. |
I would like to override the default and be able to force it one way or another. If possible, by individual folder, but for now, a global setting would work for me. Something like this would work:
|
Please put this on the high-priority list. Until you update it, I'll be using Atom instead. There are many nice features in VSCode, but this is a show-stopper for me. |
I don't understand why IntelliSense tries to convert paths to ALL CAPS, it could store actual information internally. Gives me similar problems with Visual Studio C++. Code compiles well with compiler (cl.exe), yet IntelliSense converts to ALL CAPS and fails to find file. In the past it resulted occasionally in duplicated tabs too. |
So after 6 Months..... Hope that some one answers these set of questions. |
@laukikd Our "upvote" feature list https://github.com/Microsoft/vscode-cpptools/issues?q=is%3Aissue+is%3Aopen+sort%3Areactions-%2B1-desc , so this is around 16th on that list, but this issue isn't on any of our recent planning milestones yet. |
Blindly uppercasing all alphabetic ASCII characters corrupts the paths of/when using cross-platform projects and libraries. The paths/files of these libraries and git repos are correct and fully expressed with cases. For example, this C++ extension fails to work correctly with the CMake extension. The CMake extension leads to generation of [
{
"directory": "C:/njs/dp.kinect3/build",
"command": "C:\\PROGRA~2\\MICROS~1\\2019\\COMMUN~1\\VC\\Tools\\MSVC\\1425~1.286\\bin\\Hostx64\\x64\\cl.exe /TP -DEXT_WIN_VERSION -DINTERNAL_JIT_ANIM -DMAXAPI_USE_MSCRT -DWIN64 -DWIN_VERSION -D_DEBUG -D_NO_ASYNCRTIMP -D_NO_PPLXIMP -D_USRDLL -D_WINDLL -Ddp_kinect3_EXPORTS -I. -IC:\\njs\\max-sdk\\source\\c74support\\max-includes -IC:\\njs\\max-sdk\\source\\c74support\\jit-includes -IC:\\njs\\max-sdk\\source\\c74support\\msp-includes -IC:\\njs\\maxcpp\\maxcpp -I\"C:\\Program Files\\Azure Kinect SDK v1.4.0\\sdk\\include\" /DWIN32 /D_WINDOWS /GR /EHsc /Zi /Ob0 /Od /RTC1 -MDd /GL /W4 /wd4200 /WX /ZH:SHA_256 /arch:AVX -std:c++17 /FoCMakeFiles\\dp.kinect3.dir\\dp.kinect3.cpp.obj /FdTARGET_COMPILE_PDB /FS -c C:\\njs\\dp.kinect3\\dp.kinect3.cpp",
"file": "C:/njs/dp.kinect3/dp.kinect3.cpp"
}
] The path C:\njs>fsutil.exe file queryCaseSensitiveInfo maxcpp
Case sensitive attribute on directory C:\njs\maxcpp is enabled. Unfortunately, this C++ extension corrupts the path and its debug log output surfaces this as:
The 5th include path has been corrupted and is incorrect. Various NTFS directories on this computer's SSD are case sensitive and need to be case sensitive as the dependent projects are cross-platform where case-sensitivity is needed. Projects are compiled and linked in multiple simultaneous platforms and file systems. It is not this or that. It is both at the same time. Last century when Windows didn't live in cross-platform scenarios it was possible to blindly alter case. This is no longer possible and leads to havok as this issue documents. File system case-sensitivity is orthogonal to "running on windows, WSL, etc. The following is errant logic:
Paths, configuration values, etc. should not be corrupted by changing their byte (aka ASCII) values. It is probably impossible for an app like this C++ extension to construct some logic to derive if it should alter the individual byte characters in a configuration or path. This was further cemented in 2018 when NTFS and WSL again updated shared filesystem features and ended the old ways of Win32-only-case-doesn't-matter. Workarounds like I can't easily imagine the value of blindly uppercasing paths. Why? Because if you are assuming case doesn't matter...then upper-casing doesn't matter because the case doesn't matter. Perhaps you want to uppercase them for some internal intelllisense database de-duping. Fine. Then restrict the uppercasing to your internal database and not to the broader usage of paths/configuration values. And if this extension really really won't change this "I'm Win32 so I must uppercase", then do the additional API call to query the directory to see if it is case-sensitive and for those directories do not uppercase corrupt the path. |
After having spent over one day digging through countless howtos, emails and whatnot while trying to understand why intellisense fails to find some of my includes it's a bit frustrating to see that the root cause is so old and seems to be neglected. I'm only a user of cpptools. As far as I understood the numerous comments, converting paths to uppercase is done as a step in canonicalization to make life easier when doing path comparisons. At least for local file systems (both on Mac and Windows) it should be fairly easy to have the comparison/canonicalization detect case sensitivity automatically. |
This is probably (un)related: I have experienced the following issue - when renaming a folder on macOS (or maybe Linux) and the committing it it wasn't properly renamed (changing the letter capitalization): FolderWithCapitalLetters -> folderwithsmallleters I figured out the workaround is to rename the folder to something else like -> FolderWithCapitalLetters -> somethingElse -> folderwithsmallleters I don't know if this is Unix/mac specific (or git). In the Explorer window the Folder appeared correctly but in my GitHub repository it wasn't renamed and thus there were issue. |
I had some similar issue with MSVC and code analysis a while ago. The compiler apparently converts all paths to small letters if I recall correctly and I use CamelCase names a lot in my paths and this caused issues. Or maybe I'm wrong and the paths were capitalized in any case the issue was that the paths names were changed by the compiler/analyzer. I don't know what. I tried to complain without success. |
@Zingam Linux/Mac is currently case sensitive already so the renaming of files should work -- what exactly was the failure from the rename? It may be a VS Code issue. Code analysis on Windows will use the casing of the file on disk -- there isn't a known bug in regards to the code analysis casing so if you have repro more details, can you file a bug? This #1994 issue is tracking enabling the database (and other components that operate on the "all caps" file names) to have case sensitive file handling on Windows. |
System
Windows 10, Version 1703 (OS Build 15063.966)
VSCode 1.23.1
Cpptools 0.17.0
Description
I'm seeing issues with workspaces on drives mapped using the built-in Windows NFS client (i.e., the one installed from "Windows Features -> Services for NFS -> Client for NFS").
With case sensitivity enabled (mount option
casesensitive=yes
), the extension logs an error:Unable to retrieve file system information for <path>. error = -1
for paths inbrowse.path
that reside on the NFS drive. Tooltips and navigation shortcuts (e.g., "Go to Definition" and "Switch Header/Source") subsequently fail in this configuration because the extension cannot find my files.With case sensitivity disabled (
casesensitive=no
), the error goes away and indexing seems to work, but any files opened using navigation shortcuts have their paths converted to ALL CAPS and you can end up with duplicate tabs (one with normal casing and one with all caps) or duplicate search results if the file in question was already opened through the Explorer pane.Sample mount output
Sample Cpptools log
Sample Cpptools configuration
The text was updated successfully, but these errors were encountered: