mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-22 22:55:36 -05:00
Fixes to handle file names in module resolution watching and createGetCanonicalFileName (#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
This commit is contained in:
@@ -792,7 +792,7 @@ namespace ts.server {
|
||||
// //server/location
|
||||
// ^ <- from 0 to this position
|
||||
const firstSlash = path.indexOf(directorySeparator, 2);
|
||||
return firstSlash !== -1 ? path.substring(0, firstSlash).toLowerCase() : path;
|
||||
return firstSlash !== -1 ? toFileNameLowerCase(path.substring(0, firstSlash)) : path;
|
||||
}
|
||||
const rootLength = getRootLength(path);
|
||||
if (rootLength === 0) {
|
||||
@@ -801,7 +801,7 @@ namespace ts.server {
|
||||
}
|
||||
if (path.charCodeAt(1) === CharacterCodes.colon && path.charCodeAt(2) === CharacterCodes.slash) {
|
||||
// rooted path that starts with c:/... - extract drive letter
|
||||
return path.charAt(0).toLowerCase();
|
||||
return toFileNameLowerCase(path.charAt(0));
|
||||
}
|
||||
if (path.charCodeAt(0) === CharacterCodes.slash && path.charCodeAt(1) !== CharacterCodes.slash) {
|
||||
// rooted path that starts with slash - /somename - use key for current drive
|
||||
|
||||
Reference in New Issue
Block a user