diff --git a/hls-cabal-fmt-plugin.cabal b/hls-cabal-fmt-plugin.cabal
--- a/hls-cabal-fmt-plugin.cabal
+++ b/hls-cabal-fmt-plugin.cabal
@@ -1,6 +1,6 @@
 cabal-version:      2.4
 name:               hls-cabal-fmt-plugin
-version:            2.1.0.0
+version:            2.2.0.0
 synopsis:           Integration with the cabal-fmt code formatter
 description:
   Please see the README on GitHub at <https://github.com/haskell/haskell-language-server#readme>
@@ -33,12 +33,12 @@
     , base            >=4.12 && <5
     , directory
     , filepath
-    , ghcide          == 2.1.0.0
-    , hls-plugin-api  == 2.1.0.0
+    , ghcide          == 2.2.0.0
+    , hls-plugin-api  == 2.2.0.0
     , lens
     , lsp-types
     , mtl
-    , process
+    , process-extras
     , text
     , transformers
 
@@ -56,7 +56,7 @@
     , directory
     , filepath
     , hls-cabal-fmt-plugin
-    , hls-test-utils        == 2.1.0.0
+    , hls-test-utils        == 2.2.0.0
 
   if flag(isolateTests)
     build-tool-depends: cabal-fmt:cabal-fmt ^>=0.1.6
diff --git a/src/Ide/Plugin/CabalFmt.hs b/src/Ide/Plugin/CabalFmt.hs
--- a/src/Ide/Plugin/CabalFmt.hs
+++ b/src/Ide/Plugin/CabalFmt.hs
@@ -11,28 +11,29 @@
 import           Ide.Plugin.Error            (PluginError (PluginInternalError, PluginInvalidParams))
 import           Ide.PluginUtils
 import           Ide.Types
-import           Language.LSP.Protocol.Lens  as L
+import qualified Language.LSP.Protocol.Lens  as L
 import           Language.LSP.Protocol.Types
 import           Prelude                     hiding (log)
 import           System.Directory
 import           System.Exit
 import           System.FilePath
-import           System.Process
+import           System.Process.ListLike
+import qualified System.Process.Text         as Process
 
 data Log
   = LogProcessInvocationFailure Int
-  | LogReadCreateProcessInfo String [String]
+  | LogReadCreateProcessInfo T.Text [String]
   | LogInvalidInvocationInfo
   | LogCabalFmtNotFound
   deriving (Show)
 
 instance Pretty Log where
   pretty = \case
-    LogProcessInvocationFailure code -> "Invocation of cabal-fmt failed with code" <+> pretty code
+    LogProcessInvocationFailure exitCode -> "Invocation of cabal-fmt failed with code" <+> pretty exitCode
     LogReadCreateProcessInfo stdErrorOut args ->
       vcat $
         ["Invocation of cabal-fmt with arguments" <+> pretty args]
-          ++ ["failed with standard error:" <+> pretty stdErrorOut | not (null stdErrorOut)]
+          ++ ["failed with standard error:" <+> pretty stdErrorOut | not (T.null stdErrorOut)]
     LogInvalidInvocationInfo -> "Invocation of cabal-fmt with range was called but is not supported."
     LogCabalFmtNotFound -> "Couldn't find executable 'cabal-fmt'"
 
@@ -50,24 +51,24 @@
   logWith recorder Info LogInvalidInvocationInfo
   throwError $ PluginInvalidParams "You cannot format a text-range using cabal-fmt."
 provider recorder _ide FormatText contents nfp opts = do
-  let cabalFmtArgs = [fp, "--indent", show tabularSize]
+  let cabalFmtArgs = [ "--indent", show tabularSize]
   x <- liftIO $ findExecutable "cabal-fmt"
   case x of
     Just _ -> do
       (exitCode, out, err) <-
-        liftIO $ readCreateProcessWithExitCode
+        liftIO $ Process.readCreateProcessWithExitCode
           ( proc "cabal-fmt" cabalFmtArgs
           )
             { cwd = Just $ takeDirectory fp
             }
-          ""
+          contents
       log Debug $ LogReadCreateProcessInfo err cabalFmtArgs
       case exitCode of
         ExitFailure code -> do
           log Error $ LogProcessInvocationFailure code
           throwError (PluginInternalError "Failed to invoke cabal-fmt")
         ExitSuccess -> do
-          let fmtDiff = makeDiffTextEdit contents (T.pack out)
+          let fmtDiff = makeDiffTextEdit contents out
           pure $ InL fmtDiff
     Nothing -> do
       log Error LogCabalFmtNotFound
diff --git a/test/Main.hs b/test/Main.hs
--- a/test/Main.hs
+++ b/test/Main.hs
@@ -39,7 +39,7 @@
     cabalFmtGolden found "formats a simple document" "simple_testdata" "formatted_document" $ \doc -> do
       formatDoc doc (FormattingOptions 2 True Nothing Nothing Nothing)
 
-  , knownBrokenOnWindows "expand:src comment bug in cabal-fmt on windows" $
+  , expectFailBecause "cabal-fmt can't expand modules if .cabal file is read from stdin. Tracking issue: https://github.com/phadej/cabal-fmt/pull/82" $
     cabalFmtGolden found "formats a document with expand:src comment" "commented_testdata" "formatted_document" $ \doc -> do
       formatDoc doc (FormattingOptions 2 True Nothing Nothing Nothing)
 
@@ -52,7 +52,7 @@
   testCase title $
     assertFailure $  "Couldn't find cabal-fmt on PATH or this is not an isolated run. "
                   <> "Use cabal flag 'isolateTests' to make it isolated or install cabal-fmt locally."
-cabalFmtGolden Found title path desc act = goldenWithCabalDocFormatter cabalFmtPlugin "cabal-fmt" conf title testDataDir path desc "cabal" act
+cabalFmtGolden Found title path desc act = goldenWithCabalDocFormatter def cabalFmtPlugin "cabal-fmt" conf title testDataDir path desc "cabal" act
   where
     conf = def
 
