diff --git a/hls-explicit-record-fields-plugin.cabal b/hls-explicit-record-fields-plugin.cabal
--- a/hls-explicit-record-fields-plugin.cabal
+++ b/hls-explicit-record-fields-plugin.cabal
@@ -1,6 +1,6 @@
 cabal-version:      3.0
 name:               hls-explicit-record-fields-plugin
-version:            1.0.0.0
+version:            1.0.1.0
 synopsis:           Explicit record fields plugin for Haskell Language Server
 description:
   Please see the README on GitHub at <https://github.com/haskell/haskell-language-server#readme>
@@ -12,7 +12,8 @@
 category:           Development
 build-type:         Simple
 extra-doc-files:    CHANGELOG.md
--- extra-source-files:
+extra-source-files:
+  test/testdata/**/*.hs
 
 source-repository head
   type:     git
@@ -28,7 +29,7 @@
     -- other-extensions:
     build-depends:
       , base                  >=4.12 && <5
-      , ghcide                ^>=1.9
+      , ghcide                ^>=1.10
       , hls-plugin-api        ^>=1.6
       , lsp
       , lens
diff --git a/src/Ide/Plugin/ExplicitFields.hs b/src/Ide/Plugin/ExplicitFields.hs
--- a/src/Ide/Plugin/ExplicitFields.hs
+++ b/src/Ide/Plugin/ExplicitFields.hs
@@ -23,7 +23,7 @@
                                                   mkQ)
 import qualified Data.HashMap.Strict             as HashMap
 import           Data.Maybe                      (isJust, listToMaybe,
-                                                  maybeToList)
+                                                  maybeToList, fromMaybe)
 import           Data.Text                       (Text)
 import           Development.IDE                 (IdeState, NormalizedFilePath,
                                                   Pretty (..), Recorder (..),
@@ -36,7 +36,8 @@
 import qualified Development.IDE.Core.Shake      as Shake
 import           Development.IDE.GHC.Compat      (HsConDetails (RecCon),
                                                   HsRecFields (..), LPat,
-                                                  Outputable, getLoc, unLoc)
+                                                  Outputable, getLoc, unLoc,
+                                                  recDotDot)
 import           Development.IDE.GHC.Compat.Core (Extension (NamedFieldPuns),
                                                   GhcPass,
                                                   HsExpr (RecordCon, rcon_flds),
@@ -304,7 +305,7 @@
   -> HsRecFields p arg
 preprocessRecord getName names flds = flds { rec_dotdot = Nothing , rec_flds = rec_flds' }
   where
-    no_pun_count = maybe (length (rec_flds flds)) unLoc (rec_dotdot flds)
+    no_pun_count = fromMaybe (length (rec_flds flds)) (recDotDot flds)
     -- Field binds of the explicit form (e.g. `{ a = a' }`) should be
     -- left as is, hence the split.
     (no_puns, puns) = splitAt no_pun_count (rec_flds flds)
diff --git a/test/testdata/Construction.expected.hs b/test/testdata/Construction.expected.hs
new file mode 100644
--- /dev/null
+++ b/test/testdata/Construction.expected.hs
@@ -0,0 +1,18 @@
+{-# LANGUAGE Haskell2010 #-}
+{-# LANGUAGE RecordWildCards #-}
+{-# LANGUAGE NamedFieldPuns #-}
+
+module Construction where
+
+data MyRec = MyRec
+  { foo :: Int
+  , bar :: Int
+  , baz :: Char
+  }
+
+convertMe :: () -> MyRec
+convertMe _ =
+  let foo = 3
+      bar = 5
+      baz = 'a'
+  in MyRec {foo, bar, baz}
diff --git a/test/testdata/Construction.hs b/test/testdata/Construction.hs
new file mode 100644
--- /dev/null
+++ b/test/testdata/Construction.hs
@@ -0,0 +1,17 @@
+{-# LANGUAGE Haskell2010 #-}
+{-# LANGUAGE RecordWildCards #-}
+
+module Construction where
+
+data MyRec = MyRec
+  { foo :: Int
+  , bar :: Int
+  , baz :: Char
+  }
+
+convertMe :: () -> MyRec
+convertMe _ =
+  let foo = 3
+      bar = 5
+      baz = 'a'
+  in MyRec {..}
diff --git a/test/testdata/Mixed.expected.hs b/test/testdata/Mixed.expected.hs
new file mode 100644
--- /dev/null
+++ b/test/testdata/Mixed.expected.hs
@@ -0,0 +1,15 @@
+{-# LANGUAGE Haskell2010 #-}
+{-# LANGUAGE RecordWildCards #-}
+{-# LANGUAGE NamedFieldPuns #-}
+
+module Mixed where
+
+data MyRec = MyRec
+  { foo :: Int
+  , bar :: Int
+  , baz :: Char
+  , quux :: Double
+  }
+
+convertMe :: MyRec -> String
+convertMe MyRec {foo, bar = bar', baz} = show foo ++ show bar' ++ show baz
diff --git a/test/testdata/Mixed.hs b/test/testdata/Mixed.hs
new file mode 100644
--- /dev/null
+++ b/test/testdata/Mixed.hs
@@ -0,0 +1,15 @@
+{-# LANGUAGE Haskell2010 #-}
+{-# LANGUAGE RecordWildCards #-}
+{-# LANGUAGE NamedFieldPuns #-}
+
+module Mixed where
+
+data MyRec = MyRec
+  { foo :: Int
+  , bar :: Int
+  , baz :: Char
+  , quux :: Double
+  }
+
+convertMe :: MyRec -> String
+convertMe MyRec {foo, bar = bar', ..} = show foo ++ show bar' ++ show baz
diff --git a/test/testdata/Unused.expected.hs b/test/testdata/Unused.expected.hs
new file mode 100644
--- /dev/null
+++ b/test/testdata/Unused.expected.hs
@@ -0,0 +1,14 @@
+{-# LANGUAGE Haskell2010 #-}
+{-# LANGUAGE RecordWildCards #-}
+{-# LANGUAGE NamedFieldPuns #-}
+
+module Unused where
+
+data MyRec = MyRec
+  { foo :: Int
+  , bar :: Int
+  , baz :: Char
+  }
+
+convertMe :: MyRec -> String
+convertMe MyRec {foo, bar} = show foo ++ show bar
diff --git a/test/testdata/Unused.hs b/test/testdata/Unused.hs
new file mode 100644
--- /dev/null
+++ b/test/testdata/Unused.hs
@@ -0,0 +1,13 @@
+{-# LANGUAGE Haskell2010 #-}
+{-# LANGUAGE RecordWildCards #-}
+
+module Unused where
+
+data MyRec = MyRec
+  { foo :: Int
+  , bar :: Int
+  , baz :: Char
+  }
+
+convertMe :: MyRec -> String
+convertMe MyRec {..} = show foo ++ show bar
diff --git a/test/testdata/Unused2.expected.hs b/test/testdata/Unused2.expected.hs
new file mode 100644
--- /dev/null
+++ b/test/testdata/Unused2.expected.hs
@@ -0,0 +1,14 @@
+{-# LANGUAGE Haskell2010 #-}
+{-# LANGUAGE RecordWildCards #-}
+{-# LANGUAGE NamedFieldPuns #-}
+
+module Unused2 where
+
+data MyRec = MyRec
+  { foo :: Int
+  , bar :: Int
+  , baz :: Char
+  }
+
+convertMe :: MyRec -> String
+convertMe MyRec {foo, bar} = let baz = "baz" in show foo ++ show bar ++ baz
diff --git a/test/testdata/Unused2.hs b/test/testdata/Unused2.hs
new file mode 100644
--- /dev/null
+++ b/test/testdata/Unused2.hs
@@ -0,0 +1,13 @@
+{-# LANGUAGE Haskell2010 #-}
+{-# LANGUAGE RecordWildCards #-}
+
+module Unused2 where
+
+data MyRec = MyRec
+  { foo :: Int
+  , bar :: Int
+  , baz :: Char
+  }
+
+convertMe :: MyRec -> String
+convertMe MyRec {..} = let baz = "baz" in show foo ++ show bar ++ baz
diff --git a/test/testdata/WildcardOnly.expected.hs b/test/testdata/WildcardOnly.expected.hs
new file mode 100644
--- /dev/null
+++ b/test/testdata/WildcardOnly.expected.hs
@@ -0,0 +1,14 @@
+{-# LANGUAGE Haskell2010 #-}
+{-# LANGUAGE RecordWildCards #-}
+{-# LANGUAGE NamedFieldPuns #-}
+
+module WildcardOnly where
+
+data MyRec = MyRec
+  { foo :: Int
+  , bar :: Int
+  , baz :: Char
+  }
+
+convertMe :: MyRec -> String
+convertMe MyRec {foo, bar, baz} = show foo ++ show bar ++ show baz
diff --git a/test/testdata/WildcardOnly.hs b/test/testdata/WildcardOnly.hs
new file mode 100644
--- /dev/null
+++ b/test/testdata/WildcardOnly.hs
@@ -0,0 +1,13 @@
+{-# LANGUAGE Haskell2010 #-}
+{-# LANGUAGE RecordWildCards #-}
+
+module WildcardOnly where
+
+data MyRec = MyRec
+  { foo :: Int
+  , bar :: Int
+  , baz :: Char
+  }
+
+convertMe :: MyRec -> String
+convertMe MyRec {..} = show foo ++ show bar ++ show baz
diff --git a/test/testdata/WithExplicitBind.expected.hs b/test/testdata/WithExplicitBind.expected.hs
new file mode 100644
--- /dev/null
+++ b/test/testdata/WithExplicitBind.expected.hs
@@ -0,0 +1,14 @@
+{-# LANGUAGE Haskell2010 #-}
+{-# LANGUAGE RecordWildCards #-}
+{-# LANGUAGE NamedFieldPuns #-}
+
+module WithExplicitBind where
+
+data MyRec = MyRec
+  { foo :: Int
+  , bar :: Int
+  , baz :: Char
+  }
+
+convertMe :: MyRec -> String
+convertMe MyRec {foo = foo', bar, baz} = show foo' ++ show bar ++ show baz
diff --git a/test/testdata/WithExplicitBind.hs b/test/testdata/WithExplicitBind.hs
new file mode 100644
--- /dev/null
+++ b/test/testdata/WithExplicitBind.hs
@@ -0,0 +1,13 @@
+{-# LANGUAGE Haskell2010 #-}
+{-# LANGUAGE RecordWildCards #-}
+
+module WithExplicitBind where
+
+data MyRec = MyRec
+  { foo :: Int
+  , bar :: Int
+  , baz :: Char
+  }
+
+convertMe :: MyRec -> String
+convertMe MyRec {foo = foo', ..} = show foo' ++ show bar ++ show baz
diff --git a/test/testdata/WithPun.expected.hs b/test/testdata/WithPun.expected.hs
new file mode 100644
--- /dev/null
+++ b/test/testdata/WithPun.expected.hs
@@ -0,0 +1,14 @@
+{-# LANGUAGE Haskell2010 #-}
+{-# LANGUAGE RecordWildCards #-}
+{-# LANGUAGE NamedFieldPuns #-}
+
+module WithPun where
+
+data MyRec = MyRec
+  { foo :: Int
+  , bar :: Int
+  , baz :: Char
+  }
+
+convertMe :: MyRec -> String
+convertMe MyRec {foo, bar, baz} = show foo ++ show bar ++ show baz
diff --git a/test/testdata/WithPun.hs b/test/testdata/WithPun.hs
new file mode 100644
--- /dev/null
+++ b/test/testdata/WithPun.hs
@@ -0,0 +1,14 @@
+{-# LANGUAGE Haskell2010 #-}
+{-# LANGUAGE RecordWildCards #-}
+{-# LANGUAGE NamedFieldPuns #-}
+
+module WithPun where
+
+data MyRec = MyRec
+  { foo :: Int
+  , bar :: Int
+  , baz :: Char
+  }
+
+convertMe :: MyRec -> String
+convertMe MyRec {foo, ..} = show foo ++ show bar ++ show baz
diff --git a/test/testdata/noop/ExplicitBinds.hs b/test/testdata/noop/ExplicitBinds.hs
new file mode 100644
--- /dev/null
+++ b/test/testdata/noop/ExplicitBinds.hs
@@ -0,0 +1,12 @@
+{-# LANGUAGE Haskell2010 #-}
+
+module ExplicitBinds where
+
+data MyRec = MyRec
+  { foo :: Int
+  , bar :: Int
+  , baz :: Char
+  }
+
+convertMe :: MyRec -> String
+convertMe MyRec {foo = foo', bar = bar', baz = baz'} = show foo' ++ show bar' ++ show baz'
diff --git a/test/testdata/noop/Infix.hs b/test/testdata/noop/Infix.hs
new file mode 100644
--- /dev/null
+++ b/test/testdata/noop/Infix.hs
@@ -0,0 +1,11 @@
+{-# LANGUAGE Haskell2010 #-}
+
+module Infix where
+
+data MyRec = MyRec
+  { foo :: Int
+  , bar :: Int
+  }
+
+convertMe :: MyRec -> String
+convertMe (foo' `MyRec` bar') = show foo' ++ show bar'
diff --git a/test/testdata/noop/Prefix.hs b/test/testdata/noop/Prefix.hs
new file mode 100644
--- /dev/null
+++ b/test/testdata/noop/Prefix.hs
@@ -0,0 +1,11 @@
+{-# LANGUAGE Haskell2010 #-}
+
+module Prefix where
+
+data MyRec = MyRec
+  { foo :: Int
+  , bar :: Int
+  }
+
+convertMe :: MyRec -> String
+convertMe (foo' `MyRec` bar') = show foo' ++ show bar'
diff --git a/test/testdata/noop/Puns.hs b/test/testdata/noop/Puns.hs
new file mode 100644
--- /dev/null
+++ b/test/testdata/noop/Puns.hs
@@ -0,0 +1,13 @@
+{-# LANGUAGE Haskell2010 #-}
+{-# LANGUAGE NamedFieldPuns #-}
+
+module Puns where
+
+data MyRec = MyRec
+  { foo :: Int
+  , bar :: Int
+  , baz :: Char
+  }
+
+convertMe :: MyRec -> String
+convertMe MyRec {foo, bar, baz} = show foo ++ show bar ++ show baz
