Skip to content

Commit bcb89da

Browse files
committed
Inline utility function
1 parent ce0a26e commit bcb89da

File tree

1 file changed

+5
-7
lines changed
  • plugins/hls-hlint-plugin/src/Ide/Plugin

1 file changed

+5
-7
lines changed

plugins/hls-hlint-plugin/src/Ide/Plugin/Hlint.hs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,11 @@ applyHint ide nfp mhint =
368368
-- the "Redundant bracket" hint will never be executed
369369
-- because SrcSpan (1,20,??,??) doesn't contain position (1,13).
370370
#ifdef GHC_LIB
371+
let writeFileUTF8NoNewLineTranslation file txt =
372+
withFile file WriteMode $ \h -> do
373+
hSetEncoding h utf8
374+
hSetNewlineMode h noNewlineTranslation
375+
hPutStr h (T.unpack txt)
371376
res <-
372377
liftIO $ withSystemTempFile (takeFileName fp) $ \temp h -> do
373378
hClose h
@@ -422,10 +427,3 @@ bimapExceptT f g (ExceptT m) = ExceptT (fmap h m) where
422427
h (Left e) = Left (f e)
423428
h (Right a) = Right (g a)
424429
{-# INLINE bimapExceptT #-}
425-
426-
writeFileUTF8NoNewLineTranslation :: FilePath -> T.Text -> IO()
427-
writeFileUTF8NoNewLineTranslation file txt =
428-
withFile file WriteMode $ \h -> do
429-
hSetEncoding h utf8
430-
hSetNewlineMode h noNewlineTranslation
431-
hPutStr h (T.unpack txt)

0 commit comments

Comments
 (0)