-
Notifications
You must be signed in to change notification settings - Fork 12.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
createGetCanonicalFileName yields non-existent paths on Windows if the path contains certain unicode letters #31819
Comments
I think I should make some things clear: The paths
The 3rd and the 5th characters look the same, and they are supposed to be the same. Same thing applies for the 4th and the 6th characters, too. (I think these pairs are convertible to one another using unicode normalization.) What strikes me as odd is the way Windows handles file name cases:
Maybe unicode needs another Turkish-specific uppercase |
Looks like in windows we always assume case insensitive paths: TypeScript/src/compiler/sys.ts Lines 798 to 804 in 4a26271
Which means TypeScript/src/compiler/core.ts Lines 2099 to 2102 in 4a26271
Will fall to: TypeScript/src/compiler/core.ts Lines 1629 to 1631 in 4a26271
Which falls back to node's implementation - the question is, do we want to add a workaround in TypeScript when there's are two open PRs for this in node? nodejs/node#27644 + nodejs/node#27662 - my gut says we probably don't. |
Hi @orta how did you conclude that |
I feel like I'm talking to a wall. I don't understand why this project is open-source if the contributions are considered write-only. |
@monoblaine We all have tons of work to be doing here. An average month here sees 2,000 comments and a team of six engineers and a lead is trying to stay on top of all of it, we cannot issue immediate responses to all comments. The bug fixing window for the 3.7 milestone is two months long; this issue will be fixed in that timeframe. Please don't interpret a delay in response as a refusal to engage - your comments are appreciated and will be addressed in due time. |
Sorry, yeah, I was hesitant to reply till I was sure after I had taken time to investigate, which I've not found yet |
I guess more specifically I mean v8's implementation of "toLowerCase", e.g. not one we have written inside TypeScript. Because it just forwards straight to the string's implementation of TypeScript/src/compiler/core.ts Lines 1629 to 1631 in 4a26271
I feel like there are three options:
|
I'm afraid this won't work because the result of
I'm actually using this solution for months in order to fix the Visual Studio issue that I've stated above. I didn't have any problems so far, but I'm not confident to say that there won't be any side effects. Still, I don't really know why the function |
…tCanonicalFileName (#36106) * Add test case to verify directory casing preservation when watching * Fix unicode file name handling when watching failed lookup locations * Add special file name lower conversion routine and use that instead of toLowerCase Fixes #31819 and #35559 * Remove unicode from code * Replace toLocaleLowerCase on filenames with ts.toFileNameLowerCase * Make the intent of using toFileNameLowerCase more clear and why we make the restriction on turkish I with dot on top of it * Update baselines for newly added tests in master
TypeScript Version: 3.1.2 Grabbed from the file
C:\Program Files (x86)\Microsoft SDKs\TypeScript\3.1\tsserver.js
:But the issue is present in the latest version, too.
Search Terms:
Code
I don't know TypeScript yet. Still, I've tried, but I couldn't figure out how the
ts
global variable is used.The function with the problem is here:
TypeScript/src/compiler/core.ts
Line 2093 in 94f19c7
If we're on Windows, this function returns a function that returns the lowercased version of the parameter given. So
C:/Users/Serhan/Desktop/İ
returnsc:/users/serhan/desktop/i̇
.Expected behavior:
All I can say is that the use of
toLowerCase
is not the expected behavior here. Because these two paths are not the same on Windows.Related Issues:
The text was updated successfully, but these errors were encountered: