Skip to content

Commit d9a44c9

Browse files
scheglovcommit-bot@chromium.org
authored andcommitted
Revert "Normalize Windows drive letters to uppercase for analysis"
This reverts commit 56acaee. See #32186 [email protected], [email protected] Change-Id: I76c673758e4b9acd22044985b4054b5504f4a205 Reviewed-on: https://dart-review.googlesource.com/41902 Commit-Queue: Konstantin Shcheglov <[email protected]> Reviewed-by: Brian Wilkerson <[email protected]>
1 parent 0ee460a commit d9a44c9

File tree

1 file changed

+3
-24
lines changed

1 file changed

+3
-24
lines changed

pkg/analyzer/lib/file_system/physical_file_system.dart

Lines changed: 3 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -39,27 +39,6 @@ List<int> _pathsToTimes(List<String> paths) {
3939
}).toList();
4040
}
4141

42-
/**
43-
* Return a (semi-)canonicalized version of [path] for the purpose of analysis.
44-
*
45-
* Using the built-in path's [canonicalize] results in fully lowercase paths on
46-
* Windows displayed to the user so this method uses [normalize] and then just
47-
* uppercases the drive letter on Windows to resolve the most common issues.
48-
*/
49-
String _canonicalize(String path) {
50-
path = normalize(path);
51-
// Ideally we'd call path's [canonicalize] here to ensure that on
52-
// case-insensitive file systems that different casing paths resolved to the
53-
// same thing; however these paths are used both as both as part of the
54-
// identity and also to display to users in error messages so for now we only
55-
// canonicalize the drive letter to resolve the most common issues.
56-
// https://github.com/dart-lang/sdk/issues/32095
57-
if (io.Platform.isWindows && isAbsolute(path)) {
58-
path = path.substring(0, 1).toUpperCase() + path.substring(1);
59-
}
60-
return path;
61-
}
62-
6342
/**
6443
* The name of the directory containing plugin specific subfolders used to
6544
* store data across sessions.
@@ -111,13 +90,13 @@ class PhysicalResourceProvider implements ResourceProvider {
11190

11291
@override
11392
File getFile(String path) {
114-
path = _canonicalize(path);
93+
path = normalize(path);
11594
return new _PhysicalFile(new io.File(path));
11695
}
11796

11897
@override
11998
Folder getFolder(String path) {
120-
path = _canonicalize(path);
99+
path = normalize(path);
121100
return new _PhysicalFolder(new io.Directory(path));
122101
}
123102

@@ -276,7 +255,7 @@ class _PhysicalFolder extends _PhysicalResource implements Folder {
276255

277256
@override
278257
String canonicalizePath(String relPath) {
279-
return _canonicalize(join(path, relPath));
258+
return normalize(join(path, relPath));
280259
}
281260

282261
@override

0 commit comments

Comments
 (0)