@@ -157,7 +157,7 @@ spec = describe "code actions" $ do
157157 [ " {-# LANGUAGE NoImplicitPrelude #-}"
158158 , " import System.IO ( IO"
159159 , " , hPutStrLn"
160- , " , stdout "
160+ , " , stderr "
161161 , " )"
162162 , " import Prelude ( Bool(..) )"
163163 , " import Control.Monad ( when )"
@@ -169,7 +169,7 @@ spec = describe "code actions" $ do
169169 , " main :: IO ()"
170170 , " main ="
171171 , " when True"
172- , " $ hPutStrLn stdout "
172+ , " $ hPutStrLn stderr "
173173 , " $ fromMaybe \" Good night, World!\" (Just \" Hello, World!\" )"
174174 ]
175175 ]
@@ -199,7 +199,7 @@ spec = describe "code actions" $ do
199199 ]
200200 , -- Complex imports for Constructos and functions
201201 [ " {-# LANGUAGE NoImplicitPrelude #-}"
202- , " import System.IO (IO, hPutStrLn, stdout )"
202+ , " import System.IO (IO, hPutStrLn, stderr )"
203203 , " import Prelude (Bool(..))"
204204 , " import Control.Monad (when)"
205205 , " import Data.Maybe (fromMaybe, Maybe(Just))"
@@ -208,7 +208,7 @@ spec = describe "code actions" $ do
208208 , " main :: IO ()"
209209 , " main ="
210210 , " when True"
211- , " $ hPutStrLn stdout "
211+ , " $ hPutStrLn stderr "
212212 , " $ fromMaybe \" Good night, World!\" (Just \" Hello, World!\" )"
213213 ]
214214 ]
@@ -685,13 +685,13 @@ hsImportSpec formatterName [e1, e2, e3, e4] =
685685 let config = def { formatOnImportOn = False , formattingProvider = formatterName }
686686 sendNotification WorkspaceDidChangeConfiguration (DidChangeConfigurationParams (toJSON config))
687687
688- let wantedCodeActionTitles = [ " Import module System.IO (hPutSetrLn)"
689- , " Import module System.IO (stdout)"
688+ let wantedCodeActionTitles = [ " Import module System.IO (hPutStrLn)"
690689 , " Import module Control.Monad (when)"
691690 , " Import module Data.Maybe (fromMaybe)"
692691 , " Import module Data.Function (($))"
693- , " Import module Data.Maybe (Maybe(Just))"
694- , " Import module Prelude (Bool(..))"
692+ , " Import module Data.Maybe (Maybe (Just))"
693+ , " Import module Prelude (Bool (..))"
694+ , " Import module System.IO (stderr)"
695695 ]
696696
697697 executeAllCodeActions doc wantedCodeActionTitles
@@ -708,12 +708,12 @@ hsImportSpec formatterName [e1, e2, e3, e4] =
708708 sendNotification WorkspaceDidChangeConfiguration (DidChangeConfigurationParams (toJSON config))
709709
710710 let wantedCodeActionTitles = [ " Import module System.IO (hPutStrLn)"
711- , " Import module System.IO (stdout)"
712711 , " Import module Control.Monad (when)"
713712 , " Import module Data.Maybe (fromMaybe)"
714713 , " Import module Data.Function (($))"
715- , " Import module Data.Maybe (Maybe(Just))"
716- , " Import module Prelude (Bool(..))"
714+ , " Import module Data.Maybe (Maybe (Just))"
715+ , " Import module Prelude (Bool (..))"
716+ , " Import module System.IO (stderr)"
717717 ]
718718
719719 executeAllCodeActions doc wantedCodeActionTitles
@@ -722,7 +722,7 @@ hsImportSpec formatterName [e1, e2, e3, e4] =
722722 liftIO $ do
723723 let [l1, l2, l3, l4, l5, l6, l7, l8, l9, l10, l11, l12] = T. lines contents
724724 l1 `shouldBe` " {-# LANGUAGE NoImplicitPrelude #-}"
725- l2 `shouldBe` " import System.IO (IO, hPutStrLn, stdout )"
725+ l2 `shouldBe` " import System.IO (IO, hPutStrLn, stderr )"
726726 l3 `shouldBe` " import Prelude (Bool(..))"
727727 l4 `shouldBe` " import Control.Monad (when)"
728728 l5 `shouldBe` " import Data.Maybe (fromMaybe, Maybe(Just))"
@@ -731,7 +731,7 @@ hsImportSpec formatterName [e1, e2, e3, e4] =
731731 l8 `shouldBe` " main :: IO ()"
732732 l9 `shouldBe` " main ="
733733 l10 `shouldBe` " when True"
734- l11 `shouldBe` " $ hPutStrLn stdout "
734+ l11 `shouldBe` " $ hPutStrLn stderr "
735735 l12 `shouldBe` " $ fromMaybe \" Good night, World!\" (Just \" Hello, World!\" )"
736736
737737 where
@@ -754,7 +754,7 @@ hsImportSpec formatterName [e1, e2, e3, e4] =
754754 error
755755 $ " Found an unexpected amount of action. Expected 1, but got: "
756756 ++ show (length xs)
757- ++ " \n . Titles: " ++ show (map (^. L. title) allActions)
757+ ++ " . \n Titles: " ++ show (map (^. L. title) allActions)
758758
759759-- Silence warnings
760760hsImportSpec formatter args =
0 commit comments