Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix platformAwareUriToFilePath for empty paths #107

Merged
merged 1 commit into from
Aug 1, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion haskell-lsp-types/src/Language/Haskell/LSP/TH/Uri.hs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ platformAwareUriToFilePath systemOS (Uri uri) = do

platformAdjustFromUriPath :: SystemOS -> String -> FilePath
platformAdjustFromUriPath systemOS srcPath =
if systemOS /= windowsOS then srcPath
if systemOS /= windowsOS || null srcPath then srcPath
else let
firstSegment:rest = (FPP.splitDirectories . tail) srcPath -- Drop leading '/' for absolute Windows paths
drive = if FPW.isDrive firstSegment then FPW.addTrailingPathSeparator firstSegment else firstSegment
Expand Down