File tree 2 files changed +7
-6
lines changed
plugins/hls-fourmolu-plugin
2 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ library
30
30
, hls-plugin-api ^>= 1.3
31
31
, lens
32
32
, lsp
33
- , process
33
+ , process-extras
34
34
, text
35
35
36
36
default-language : Haskell2010
Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ import Control.Monad.IO.Class
15
15
import Data.Bifunctor (first )
16
16
import Data.Maybe
17
17
import qualified Data.Text as T
18
+ import qualified Data.Text.IO as T
18
19
import Development.IDE hiding (pluginHandlers )
19
20
import Development.IDE.GHC.Compat as Compat hiding (Cpp )
20
21
import qualified Development.IDE.GHC.Compat.Util as S
@@ -28,8 +29,8 @@ import Language.LSP.Types.Lens (HasTabSize (tabSize))
28
29
import Ormolu
29
30
import System.Exit
30
31
import System.FilePath
31
- import System.IO (stderr , hPutStrLn )
32
- import System.Process
32
+ import System.IO (stderr )
33
+ import System.Process.Text ( readProcessWithExitCode )
33
34
34
35
-- ---------------------------------------------------------------------
35
36
@@ -63,11 +64,11 @@ provider ideState typ contents fp fo = withIndefiniteProgress title Cancellable
63
64
]
64
65
<> map (" -o" <> ) fileOpts
65
66
)
66
- ( T. unpack contents)
67
- hPutStrLn stderr err
67
+ contents
68
+ T. hPutStrLn stderr err
68
69
case exitCode of
69
70
ExitSuccess ->
70
- pure . Right $ makeDiffTextEdit contents $ T. pack out
71
+ pure . Right $ makeDiffTextEdit contents out
71
72
ExitFailure n ->
72
73
pure . Left . responseError $ " Fourmolu failed with exit code " <> T. pack (show n)
73
74
else do
You can’t perform that action at this time.
0 commit comments