Skip to content

Commit 1c1f554

Browse files
committed
Pull out an isLiterate function
1 parent ae87135 commit 1c1f554

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Development/IDE/Core/Preprocessor.hs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ preprocessor filename mbContents = do
3737
let isOnDisk = isNothing mbContents
3838

3939
-- unlit content if literate Haskell ending
40-
(isOnDisk, contents) <- if ".lhs" `isSuffixOf` filename
40+
(isOnDisk, contents) <- if isLiterate filename
4141
then do
4242
dflags <- getDynFlags
4343
newcontent <- liftIO $ runLhs dflags filename mbContents
@@ -53,6 +53,10 @@ preprocessor filename mbContents = do
5353
return (contents, dflags)
5454

5555

56+
isLiterate :: FilePath -> Bool
57+
isLiterate x = takeExtension x `elem` [".lhs",".lhs-boot"]
58+
59+
5660
-- | This reads the pragma information directly from the provided buffer.
5761
parsePragmasIntoDynFlags
5862
:: GhcMonad m

0 commit comments

Comments
 (0)