diff --git a/hls-explicit-imports-plugin.cabal b/hls-explicit-imports-plugin.cabal
--- a/hls-explicit-imports-plugin.cabal
+++ b/hls-explicit-imports-plugin.cabal
@@ -1,6 +1,6 @@
 cabal-version:      2.2
 name:               hls-explicit-imports-plugin
-version:            2.3.0.0
+version:            2.4.0.0
 synopsis:           Explicit imports plugin for Haskell Language Server
 description:
   Please see the README on GitHub at <https://github.com/haskell/haskell-language-server#readme>
@@ -29,7 +29,6 @@
 
 library
   import:           warnings
-  buildable: True
   exposed-modules:    Ide.Plugin.ExplicitImports
   hs-source-dirs:     src
   build-depends:
@@ -38,9 +37,9 @@
     , containers
     , deepseq
     , ghc
-    , ghcide                == 2.3.0.0
+    , ghcide                == 2.4.0.0
     , hls-graph
-    , hls-plugin-api        == 2.3.0.0
+    , hls-plugin-api        == 2.4.0.0
     , lens
     , lsp
     , mtl
@@ -58,7 +57,6 @@
 
 test-suite tests
   import:           warnings
-  buildable: True
   type:             exitcode-stdio-1.0
   default-language: Haskell2010
   hs-source-dirs:   test
diff --git a/src/Ide/Plugin/ExplicitImports.hs b/src/Ide/Plugin/ExplicitImports.hs
--- a/src/Ide/Plugin/ExplicitImports.hs
+++ b/src/Ide/Plugin/ExplicitImports.hs
@@ -466,9 +466,11 @@
   where importedNames = S.fromList $ map (ieName . unLoc) names
         res = flip Map.filter avails $ \a ->
                 any (`S.member` importedNames)
-                  $ concatMap availNamesWithSelectors a
+                  $ concatMap
+                      getAvailNames
+                      a
         allFilteredAvailsNames = S.fromList
-          $ concatMap availNamesWithSelectors
+          $ concatMap getAvailNames
           $ mconcat
           $ Map.elems res
 filterByImport _ _ = Nothing
@@ -496,6 +498,14 @@
           containsAvail :: LIE GhcRn -> AvailInfo -> Bool
           containsAvail name avail =
             any (\an -> printOutputable an == (printOutputable . ieName . unLoc $ name))
-              $ availNamesWithSelectors avail
+              $ getAvailNames avail
 
 constructImport _ lim _ = lim
+
+getAvailNames :: AvailInfo -> [Name]
+getAvailNames =
+#if MIN_VERSION_ghc(9,7,0)
+  availNames
+#else
+  availNamesWithSelectors
+#endif
