Skip to content

Commit b22f772

Browse files
committed
Use readFile'
1 parent 86dd667 commit b22f772

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

plugins/hls-eval-plugin/src/Ide/Plugin/Eval/Code.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import Ide.Plugin.Eval.Types (Language (Plain), Loc,
2424
import InteractiveEval (getContext, parseImportDecl,
2525
runDecls, setContext)
2626
import Language.LSP.Types.Lens (line, start)
27-
import System.IO.Extra (newTempFile)
27+
import System.IO.Extra (newTempFile, readFile')
2828

2929
-- | Return the ranges of the expression and result parts of the given test
3030
testRanges :: Test -> (Range, Range)
@@ -106,7 +106,7 @@ myExecStmt stmt opts = do
106106
modifySession $ \hsc -> hsc {hsc_IC = setInteractivePrintName (hsc_IC hsc) evalPrint}
107107
result <- execStmt stmt opts >>= \case
108108
ExecComplete (Left err) _ -> pure $ Left $ show err
109-
ExecComplete (Right _) _ -> liftIO $ Right . (\x -> if null x then Nothing else Just x ) <$> readFile temp
109+
ExecComplete (Right _) _ -> liftIO $ Right . (\x -> if null x then Nothing else Just x ) <$> readFile' temp
110110
ExecBreak{} -> pure $ Right $ Just "breakpoints are not supported"
111111
liftIO purge
112112
pure result

plugins/hls-eval-plugin/test/testdata/TIt.hs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,6 @@ module TIt where
22

33
-- >>> "test"
44
-- >>> it
5+
6+
-- >>> pure "test2"
7+
-- >>> it

plugins/hls-eval-plugin/test/testdata/TIt.hs.expected

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,8 @@ module TIt where
44
-- >>> it
55
-- "test"
66
-- "test"
7+
8+
-- >>> pure "test2"
9+
-- >>> it
10+
-- "test2"
11+
-- "test2"

0 commit comments

Comments
 (0)