mirror of
https://github.com/github/semantic.git
synced 2024-12-22 14:21:31 +03:00
Remove TODO and leave readFile behavior alone for now
This commit is contained in:
parent
6be9b9c3cd
commit
975304097c
@ -14,9 +14,6 @@ import qualified Data.Text.ICU.Detect as Detect
|
||||
-- | Read a file to a SourceBlob, transcoding to UTF-8 along the way.
|
||||
readFile :: FilePath -> IO SourceBlob
|
||||
readFile path = do
|
||||
-- source <- readFile' path
|
||||
-- pure $ sourceBlob source path
|
||||
-- TODO: Do we want to swallow IOExceptions for files that don't exist? I'm not sure this is a good idea.
|
||||
source <- (Just <$> readFile' path) `catch` (const (pure Nothing) :: IOException -> IO (Maybe Source))
|
||||
pure $ fromMaybe (emptySourceBlob path) (flip sourceBlob path <$> source)
|
||||
where
|
||||
|
Loading…
Reference in New Issue
Block a user