mirror of
https://github.com/haskell/ghcide.git
synced 2024-12-02 08:53:07 +03:00
Avoid 3 space indents
This commit is contained in:
parent
a4fafc2d60
commit
20c829038c
@ -33,21 +33,21 @@ import Data.Maybe
|
||||
-- e.g. unlit/cpp. Return the resulting buffer and the DynFlags it implies.
|
||||
preprocessor :: GhcMonad m => FilePath -> Maybe StringBuffer -> ExceptT [FileDiagnostic] m (StringBuffer, DynFlags)
|
||||
preprocessor filename mbContents = do
|
||||
-- Perform unlit
|
||||
(isOnDisk, contents) <- if isLiterate filename then do
|
||||
-- Perform unlit
|
||||
(isOnDisk, contents) <- if isLiterate filename then do
|
||||
dflags <- getDynFlags
|
||||
newcontent <- liftIO $ runLhs dflags filename mbContents
|
||||
return (False, newcontent)
|
||||
else do
|
||||
contents <- liftIO $ maybe (hGetStringBuffer filename) return mbContents
|
||||
let isOnDisk = isNothing mbContents
|
||||
return (isOnDisk, contents)
|
||||
else do
|
||||
contents <- liftIO $ maybe (hGetStringBuffer filename) return mbContents
|
||||
let isOnDisk = isNothing mbContents
|
||||
return (isOnDisk, contents)
|
||||
|
||||
-- Perform cpp
|
||||
dflags <- ExceptT $ parsePragmasIntoDynFlags filename contents
|
||||
if not $ xopt LangExt.Cpp dflags then
|
||||
-- Perform cpp
|
||||
dflags <- ExceptT $ parsePragmasIntoDynFlags filename contents
|
||||
if not $ xopt LangExt.Cpp dflags then
|
||||
return (contents, dflags)
|
||||
else do
|
||||
else do
|
||||
contents <- liftIO $ runCpp dflags filename $ if isOnDisk then Nothing else Just contents
|
||||
dflags <- ExceptT $ parsePragmasIntoDynFlags filename contents
|
||||
return (contents, dflags)
|
||||
|
Loading…
Reference in New Issue
Block a user