@@ -32,6 +32,7 @@ import Data.String
3232import FastString
3333import qualified Language.Haskell.LSP.Types as LSP
3434import SrcLoc as GHC
35+import System.Info.Extra
3536import Text.ParserCombinators.ReadP as ReadP
3637import Data.Maybe (fromMaybe)
3738
@@ -53,7 +54,11 @@ uriToFilePath' uri
5354 | otherwise = LSP.uriToFilePath uri
5455
5556emptyPathUri :: LSP.NormalizedUri
56−emptyPathUri = LSP.NormalizedUri (hash ("" :: String)) ""
57+emptyPathUri =
58+ -- The difference here matches the behavior of platformAwareFilePathToUri.
59+ let s | isWindows = "file:///"
60+ | otherwise = "file://"
61+ in LSP.NormalizedUri (hash s) s
5762
5863filePathToUri' :: LSP.NormalizedFilePath -> LSP.NormalizedUri
5964filePathToUri' = LSP.normalizedFilePathToUri