mirror of
https://github.com/haskell/ghcide.git
synced 2024-12-24 18:53:13 +03:00
Fix emptyPathUri
This commit is contained in:
parent
9951f35b08
commit
9b35f4a7fb
@ -32,6 +32,7 @@ import Data.String
|
||||
import FastString
|
||||
import qualified Language.Haskell.LSP.Types as LSP
|
||||
import SrcLoc as GHC
|
||||
import System.Info.Extra
|
||||
import Text.ParserCombinators.ReadP as ReadP
|
||||
import Data.Maybe (fromMaybe)
|
||||
|
||||
@ -53,7 +54,11 @@ uriToFilePath' uri
|
||||
| otherwise = LSP.uriToFilePath uri
|
||||
|
||||
emptyPathUri :: LSP.NormalizedUri
|
||||
emptyPathUri = LSP.NormalizedUri (hash ("" :: String)) ""
|
||||
emptyPathUri =
|
||||
-- The difference here matches the behavior of platformAwareFilePathToUri.
|
||||
let s | isWindows = "file:///"
|
||||
| otherwise = "file://"
|
||||
in LSP.NormalizedUri (hash s) s
|
||||
|
||||
filePathToUri' :: LSP.NormalizedFilePath -> LSP.NormalizedUri
|
||||
filePathToUri' = LSP.normalizedFilePathToUri
|
||||
|
Loading…
Reference in New Issue
Block a user