Skip to content

Commit 0d56129

Browse files
committed
Fix escape characters of temp file path
1 parent b22f772 commit 0d56129

File tree

1 file changed

+2
-2
lines changed
  • plugins/hls-eval-plugin/src/Ide/Plugin/Eval

1 file changed

+2
-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
@@ -102,11 +102,11 @@ evalSetup = do
102102
myExecStmt :: String -> ExecOptions -> Ghc (Either String (Maybe String))
103103
myExecStmt stmt opts = do
104104
(temp, purge) <- liftIO newTempFile
105-
evalPrint <- head <$> runDecls ("evalPrint x = P.writeFile \"" <> temp <> "\" (P.show x)")
105+
evalPrint <- head <$> runDecls ("evalPrint x = P.writeFile "<> show temp <> " (P.show x)")
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

0 commit comments

Comments
 (0)