diff --git a/ghcide/src/Development/IDE/Plugin/CodeAction/ExactPrint.hs b/ghcide/src/Development/IDE/Plugin/CodeAction/ExactPrint.hs index 5dc782e0b57..524016e6f72 100644 --- a/ghcide/src/Development/IDE/Plugin/CodeAction/ExactPrint.hs +++ b/ghcide/src/Development/IDE/Plugin/CodeAction/ExactPrint.hs @@ -32,7 +32,6 @@ import Language.Haskell.LSP.Types import OccName import Outputable (ppr, showSDocUnsafe) import Data.Generics (listify) -import Development.IDE.Spans.Common (showNameWithoutUniques) ------------------------------------------------------------------------------ @@ -214,9 +213,7 @@ extendImportTopLevel df idnetifier (L l it@ImportDecl {..}) top <- uniqueSrcSpanT rdr <- liftParseAST df idnetifier - let alreadyImported = - showNameWithoutUniques rdr `elem` - map (showNameWithoutUniques @RdrName) (listify (const True) lies) + let alreadyImported = occName (unLoc rdr) `elem` listify (const True) lies when alreadyImported $ lift (Left $ idnetifier <> " already imported") @@ -266,9 +263,7 @@ extendImportViaParent df parent child (L l it@ImportDecl {..}) srcChild <- uniqueSrcSpanT childRdr <- liftParseAST df child - let alreadyImported = - showNameWithoutUniques childRdr `elem` - map (showNameWithoutUniques @RdrName) (listify (const True) lies') + let alreadyImported = occName (unLoc childRdr) `elem` listify (const True) lies' when alreadyImported $ lift (Left $ child <> " already included in " <> parent <> " imports")