Merge pull request #10862 from PaulAik/master

Fix for Default Directory Provider incorrectly identifying file paths as URLs on Windows
This commit is contained in:
Damien Guard 2016-03-23 15:45:15 -07:00
commit 8b8e81efce

View File

@ -16,8 +16,8 @@ class DefaultDirectoryProvider
# * `null` if the given URI is not compatibile with this provider.
directoryForURISync: (uri) ->
normalizedPath = path.normalize(uri)
{protocol} = url.parse(uri)
directoryPath = if protocol?
{host} = url.parse(uri)
directoryPath = if host
uri
else if not fs.isDirectorySync(normalizedPath) and fs.isDirectorySync(path.dirname(normalizedPath))
path.dirname(normalizedPath)
@ -26,7 +26,7 @@ class DefaultDirectoryProvider
# TODO: Stop normalizing the path in pathwatcher's Directory.
directory = new Directory(directoryPath)
if protocol?
if host
directory.path = directoryPath
if fs.isCaseInsensitive()
directory.lowerCasePath = directoryPath.toLowerCase()