on master help sign in
Rename hDuplicateTo to hDuplicateTo' (#259)
0838dcbMoritz Kiefer
src/Development/IDE/GHC/Util.hs+5−5
@@ -20,7 +20,7 @@ module Development.IDE.GHC.Util(
20 moduleImportPath,
20 moduleImportPath,
21 HscEnvEq, hscEnv, newHscEnvEq,
21 HscEnvEq, hscEnv, newHscEnvEq,
22 readFileUtf8,
22 readFileUtf8,
23− hDuplicateTo,
23+ hDuplicateTo',
24 cgGutsToCoreModule
24 cgGutsToCoreModule
25 ) where
25 ) where
26
26
@@ -167,8 +167,8 @@ cgGutsToCoreModule safeMode guts modDetails = CoreModule
167
167
168-- This is a slightly modified version of hDuplicateTo in GHC.
168-- This is a slightly modified version of hDuplicateTo in GHC.
169-- See the inline comment for more details.
169-- See the inline comment for more details.
170−hDuplicateTo :: Handle -> Handle -> IO ()
170+hDuplicateTo' :: Handle -> Handle -> IO ()
171−hDuplicateTo h1@(FileHandle path m1) h2@(FileHandle _ m2) = do
171+hDuplicateTo' h1@(FileHandle path m1) h2@(FileHandle _ m2) = do
172 withHandle__' "hDuplicateTo" h2 m2 $ \h2_ -> do
172 withHandle__' "hDuplicateTo" h2 m2 $ \h2_ -> do
173 -- The implementation in base has this call to hClose_help.
173 -- The implementation in base has this call to hClose_help.
174 -- _ <- hClose_help h2_
174 -- _ <- hClose_help h2_
@@ -181,7 +181,7 @@ hDuplicateTo h1@(FileHandle path m1) h2@(FileHandle _ m2) = do
181 -- if it happens just in the right moment.
181 -- if it happens just in the right moment.
182 withHandle_' "hDuplicateTo" h1 m1 $ \h1_ -> do
182 withHandle_' "hDuplicateTo" h1 m1 $ \h1_ -> do
183 dupHandleTo path h1 Nothing h2_ h1_ (Just handleFinalizer)
183 dupHandleTo path h1 Nothing h2_ h1_ (Just handleFinalizer)
184−hDuplicateTo h1@(DuplexHandle path r1 w1) h2@(DuplexHandle _ r2 w2) = do
184+hDuplicateTo' h1@(DuplexHandle path r1 w1) h2@(DuplexHandle _ r2 w2) = do
185 withHandle__' "hDuplicateTo" h2 w2 $ \w2_ -> do
185 withHandle__' "hDuplicateTo" h2 w2 $ \w2_ -> do
186 _ <- hClose_help w2_
186 _ <- hClose_help w2_
187 withHandle_' "hDuplicateTo" h1 w1 $ \w1_ -> do
187 withHandle_' "hDuplicateTo" h1 w1 $ \w1_ -> do
@@ -190,7 +190,7 @@ hDuplicateTo h1@(DuplexHandle path r1 w1) h2@(DuplexHandle _ r2 w2) = do
190 _ <- hClose_help r2_
190 _ <- hClose_help r2_
191 withHandle_' "hDuplicateTo" h1 r1 $ \r1_ -> do
191 withHandle_' "hDuplicateTo" h1 r1 $ \r1_ -> do
192 dupHandleTo path h1 (Just w1) r2_ r1_ Nothing
192 dupHandleTo path h1 (Just w1) r2_ r1_ Nothing
193−hDuplicateTo h1 _ =
193+hDuplicateTo' h1 _ =
194 ioe_dupHandlesNotCompatible h1
194 ioe_dupHandlesNotCompatible h1
195
195
196-- | This is copied unmodified from GHC since it is not exposed.
196-- | This is copied unmodified from GHC since it is not exposed.
src/Development/IDE/LSP/LanguageServer.hs+1−1
@@ -48,7 +48,7 @@ runLanguageServer options userHandlers getIdeState = do
48 -- to stdout. This guards against stray prints from corrupting the JSON-RPC
48 -- to stdout. This guards against stray prints from corrupting the JSON-RPC
49 -- message stream.
49 -- message stream.
50 newStdout <- hDuplicate stdout
50 newStdout <- hDuplicate stdout
51− stderr `Ghcide.hDuplicateTo` stdout
51+ stderr `Ghcide.hDuplicateTo'` stdout
52 hSetBuffering stderr NoBuffering
52 hSetBuffering stderr NoBuffering
53 hSetBuffering stdout NoBuffering
53 hSetBuffering stdout NoBuffering
54
54