Skip to content

Commit

Permalink
Strip qualifiers properly
Browse files Browse the repository at this point in the history
  • Loading branch information
pepeiborra committed Jan 30, 2021
1 parent 5baf6e5 commit b0e4621
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions ghcide/src/Development/IDE/Plugin/CodeAction/ExactPrint.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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)

------------------------------------------------------------------------------

Expand Down Expand Up @@ -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")

Expand Down Expand Up @@ -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")

Expand Down

0 comments on commit b0e4621

Please sign in to comment.