@@ -157,7 +157,7 @@ spec = describe "code actions" $ do
157
157
[ " {-# LANGUAGE NoImplicitPrelude #-}"
158
158
, " import System.IO ( IO"
159
159
, " , hPutStrLn"
160
- , " , stdout "
160
+ , " , stderr "
161
161
, " )"
162
162
, " import Prelude ( Bool(..) )"
163
163
, " import Control.Monad ( when )"
@@ -169,7 +169,7 @@ spec = describe "code actions" $ do
169
169
, " main :: IO ()"
170
170
, " main ="
171
171
, " when True"
172
- , " $ hPutStrLn stdout "
172
+ , " $ hPutStrLn stderr "
173
173
, " $ fromMaybe \" Good night, World!\" (Just \" Hello, World!\" )"
174
174
]
175
175
]
@@ -199,7 +199,7 @@ spec = describe "code actions" $ do
199
199
]
200
200
, -- Complex imports for Constructos and functions
201
201
[ " {-# LANGUAGE NoImplicitPrelude #-}"
202
- , " import System.IO (IO, hPutStrLn, stdout )"
202
+ , " import System.IO (IO, hPutStrLn, stderr )"
203
203
, " import Prelude (Bool(..))"
204
204
, " import Control.Monad (when)"
205
205
, " import Data.Maybe (fromMaybe, Maybe(Just))"
@@ -208,7 +208,7 @@ spec = describe "code actions" $ do
208
208
, " main :: IO ()"
209
209
, " main ="
210
210
, " when True"
211
- , " $ hPutStrLn stdout "
211
+ , " $ hPutStrLn stderr "
212
212
, " $ fromMaybe \" Good night, World!\" (Just \" Hello, World!\" )"
213
213
]
214
214
]
@@ -685,13 +685,13 @@ hsImportSpec formatterName [e1, e2, e3, e4] =
685
685
let config = def { formatOnImportOn = False , formattingProvider = formatterName }
686
686
sendNotification WorkspaceDidChangeConfiguration (DidChangeConfigurationParams (toJSON config))
687
687
688
- let wantedCodeActionTitles = [ " Import module System.IO (hPutSetrLn)"
689
- , " Import module System.IO (stdout)"
688
+ let wantedCodeActionTitles = [ " Import module System.IO (hPutStrLn)"
690
689
, " Import module Control.Monad (when)"
691
690
, " Import module Data.Maybe (fromMaybe)"
692
691
, " 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)"
695
695
]
696
696
697
697
executeAllCodeActions doc wantedCodeActionTitles
@@ -708,12 +708,12 @@ hsImportSpec formatterName [e1, e2, e3, e4] =
708
708
sendNotification WorkspaceDidChangeConfiguration (DidChangeConfigurationParams (toJSON config))
709
709
710
710
let wantedCodeActionTitles = [ " Import module System.IO (hPutStrLn)"
711
- , " Import module System.IO (stdout)"
712
711
, " Import module Control.Monad (when)"
713
712
, " Import module Data.Maybe (fromMaybe)"
714
713
, " 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)"
717
717
]
718
718
719
719
executeAllCodeActions doc wantedCodeActionTitles
@@ -722,7 +722,7 @@ hsImportSpec formatterName [e1, e2, e3, e4] =
722
722
liftIO $ do
723
723
let [l1, l2, l3, l4, l5, l6, l7, l8, l9, l10, l11, l12] = T. lines contents
724
724
l1 `shouldBe` " {-# LANGUAGE NoImplicitPrelude #-}"
725
- l2 `shouldBe` " import System.IO (IO, hPutStrLn, stdout )"
725
+ l2 `shouldBe` " import System.IO (IO, hPutStrLn, stderr )"
726
726
l3 `shouldBe` " import Prelude (Bool(..))"
727
727
l4 `shouldBe` " import Control.Monad (when)"
728
728
l5 `shouldBe` " import Data.Maybe (fromMaybe, Maybe(Just))"
@@ -731,7 +731,7 @@ hsImportSpec formatterName [e1, e2, e3, e4] =
731
731
l8 `shouldBe` " main :: IO ()"
732
732
l9 `shouldBe` " main ="
733
733
l10 `shouldBe` " when True"
734
- l11 `shouldBe` " $ hPutStrLn stdout "
734
+ l11 `shouldBe` " $ hPutStrLn stderr "
735
735
l12 `shouldBe` " $ fromMaybe \" Good night, World!\" (Just \" Hello, World!\" )"
736
736
737
737
where
@@ -754,7 +754,7 @@ hsImportSpec formatterName [e1, e2, e3, e4] =
754
754
error
755
755
$ " Found an unexpected amount of action. Expected 1, but got: "
756
756
++ show (length xs)
757
- ++ " \n . Titles: " ++ show (map (^. L. title) allActions)
757
+ ++ " . \n Titles: " ++ show (map (^. L. title) allActions)
758
758
759
759
-- Silence warnings
760
760
hsImportSpec formatter args =
0 commit comments