on master help sign in
Fix emptyPathUri
commit9b35f4a7fb56836cef4571719cbbbb1ed4adeb29 authorMoritz Kiefer <moritz.kiefer@purelyfunctional.org> dateMon 23 Mar 2020, 10:54 (7 years ago) parent9951f35
1 file changed+6−1
src/Development/IDE/Types/Location.hs+6−1
src/Development/IDE/Types/Location.hs+6−1
@@ -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