diff --git a/hls-pragmas-plugin.cabal b/hls-pragmas-plugin.cabal
--- a/hls-pragmas-plugin.cabal
+++ b/hls-pragmas-plugin.cabal
@@ -1,6 +1,6 @@
 cabal-version:      2.4
 name:               hls-pragmas-plugin
-version:            1.0.2.0
+version:            1.0.2.1
 synopsis:           Pragmas plugin for Haskell Language Server
 description:
   Please see the README on GitHub at <https://github.com/haskell/haskell-language-server#readme>
@@ -25,8 +25,8 @@
     , extra
     , fuzzy
     , ghc
-    , ghcide                ^>=1.6
-    , hls-plugin-api        ^>=1.3
+    , ghcide                ^>=1.6 || ^>=1.7
+    , hls-plugin-api        ^>=1.3 || ^>=1.4
     , lens
     , lsp
     , text
@@ -46,7 +46,7 @@
     , base
     , filepath
     , hls-pragmas-plugin
-    , hls-test-utils      ^>=1.2
+    , hls-test-utils      ^>=1.3
     , lens
     , lsp-types
     , text
diff --git a/src/Ide/Plugin/Pragmas.hs b/src/Ide/Plugin/Pragmas.hs
--- a/src/Ide/Plugin/Pragmas.hs
+++ b/src/Ide/Plugin/Pragmas.hs
@@ -42,7 +42,7 @@
                                                         Range (Range), Uri,
                                                         getFileContents,
                                                         getParsedModule,
-                                                        prettyPrint, runAction,
+                                                        printOutputable, runAction,
                                                         srcSpanToRange,
                                                         toNormalizedUri,
                                                         uriToFilePath',
@@ -151,7 +151,7 @@
     disabled
       | Just dynFlags <- mDynflags =
         -- GHC does not export 'OnOff', so we have to view it as string
-        catMaybes $ T.stripPrefix "Off " . T.pack . prettyPrint <$> extensions dynFlags
+        catMaybes $ T.stripPrefix "Off " . printOutputable <$> extensions dynFlags
       | otherwise =
         -- When the module failed to parse, we don't have access to its
         -- dynFlags. In that case, simply don't disable any pragmas.
diff --git a/test/Main.hs b/test/Main.hs
--- a/test/Main.hs
+++ b/test/Main.hs
@@ -3,7 +3,8 @@
   ( main
   ) where
 
-import           Control.Lens            ((^.))
+import           Control.Lens            ((^.), (^..), traversed)
+import           Data.Foldable           (find)
 import qualified Data.Text               as T
 import qualified Ide.Plugin.Pragmas      as Pragmas
 import qualified Language.LSP.Types.Lens as L
@@ -74,7 +75,10 @@
     _ <- waitForDiagnosticsFrom doc
     cas <- map fromAction <$> getAllCodeActions doc
     mapM_ (\(action, contains) -> go action contains cas) actions
-    executeCodeAction $ head cas
+    action <- case cas of
+      (a:_) -> pure a
+      [] -> liftIO $ assertFailure "Expected non-empty list of code actions"
+    executeCodeAction action
     where
       go action contains cas = liftIO $ action `elem` map (^. L.title) cas @? contains
 
@@ -85,8 +89,9 @@
     goldenWithPragmas "no duplication" "NamedFieldPuns" $ \doc -> do
       _ <- waitForDiagnosticsFrom doc
       cas <- map fromAction <$> getCodeActions doc (Range (Position 8 9) (Position 8 9))
-      liftIO $ length cas == 1 @? "Expected one code action, but got: " <> show cas
-      let ca = head cas
+      ca <- liftIO $ case cas of
+        [ca] -> pure ca
+        _ -> assertFailure $ "Expected one code action, but got: " <> show cas
       liftIO $ (ca ^. L.title == "Add \"NamedFieldPuns\"") @? "NamedFieldPuns code action"
       executeCodeAction ca
   , goldenWithPragmas "doesn't suggest disabling type errors" "DeferredTypeErrors" $ \doc -> do
@@ -119,7 +124,7 @@
     let te = TextEdit (Range (Position a b) (Position c d)) te'
     _ <- applyEdit doc te
     compls <- getCompletions doc (Position x y)
-    let item = head $ filter ((== label) . (^. L.label)) compls
+    item <- getCompletionByLabel label compls
     liftIO $ do
       item ^. L.label @?= label
       item ^. L.kind @?= Just CiKeyword
