File tree Expand file tree Collapse file tree 2 files changed +7
-6
lines changed
plugins/hls-fourmolu-plugin Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ library
3030 , hls-plugin-api ^>= 1.3
3131 , lens
3232 , lsp
33- , process
33+ , process-extras
3434 , text
3535
3636 default-language : Haskell2010
Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ import Control.Monad.IO.Class
1515import Data.Bifunctor (first )
1616import Data.Maybe
1717import qualified Data.Text as T
18+ import qualified Data.Text.IO as T
1819import Development.IDE hiding (pluginHandlers )
1920import Development.IDE.GHC.Compat as Compat hiding (Cpp )
2021import qualified Development.IDE.GHC.Compat.Util as S
@@ -28,8 +29,8 @@ import Language.LSP.Types.Lens (HasTabSize (tabSize))
2829import Ormolu
2930import System.Exit
3031import System.FilePath
31- import System.IO (stderr , hPutStrLn )
32- import System.Process
32+ import System.IO (stderr )
33+ import System.Process.Text ( readProcessWithExitCode )
3334
3435-- ---------------------------------------------------------------------
3536
@@ -63,11 +64,11 @@ provider ideState typ contents fp fo = withIndefiniteProgress title Cancellable
6364 ]
6465 <> map (" -o" <> ) fileOpts
6566 )
66- ( T. unpack contents)
67- hPutStrLn stderr err
67+ contents
68+ T. hPutStrLn stderr err
6869 case exitCode of
6970 ExitSuccess ->
70- pure . Right $ makeDiffTextEdit contents $ T. pack out
71+ pure . Right $ makeDiffTextEdit contents out
7172 ExitFailure n ->
7273 pure . Left . responseError $ " Fourmolu failed with exit code " <> T. pack (show n)
7374 else do
You can’t perform that action at this time.
0 commit comments